pax_global_header00006660000000000000000000000064147736677350014543gustar00rootroot0000000000000052 comment=774de664976207e3c8ed61df8c9e95475d876fce pglast-7.7/000077500000000000000000000000001477366773500127125ustar00rootroot00000000000000pglast-7.7/.bumpversion.toml000066400000000000000000000022461477366773500162420ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — bump-my-version configuration # :Created: mer 30 ott 2024, 07:49:26 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2024 Lele Gaifax # [tool.bumpversion] current_version = "7.7" parse = "(?P\\d+)\\.(?P\\d+)" serialize = [ "{major}.{minor}", "{major}.{minor}", ] search = "{current_version}" replace = "{new_version}" regex = false ignore_missing_version = false ignore_missing_files = false tag = false sign_tags = false tag_name = "v{new_version}" tag_message = "Bump version: {current_version} → {new_version}" allow_dirty = false commit = false message = "Bump version: {current_version} → {new_version}" commit_args = "" [[tool.bumpversion.files]] filename = "setup.py" search = 'version="{current_version}"' replace = 'version="{new_version}"' [[tool.bumpversion.files]] filename = "pglast/__init__.py" search = "__version__ = 'v{current_version}'" replace = "__version__ = 'v{new_version}'" [[tool.bumpversion.files]] filename = "docs/conf.py" search = "release = 'v{current_version}'" replace = "release = 'v{new_version}'" pglast-7.7/.dir-locals.el000066400000000000000000000000741477366773500153440ustar00rootroot00000000000000((python-mode . ((pycov-coverage-file . "coverage.json")))) pglast-7.7/.github/000077500000000000000000000000001477366773500142525ustar00rootroot00000000000000pglast-7.7/.github/FUNDING.yml000066400000000000000000000012411477366773500160650ustar00rootroot00000000000000# These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: lele issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] pglast-7.7/.github/dependabot.yml000066400000000000000000000001661477366773500171050ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" pglast-7.7/.github/workflows/000077500000000000000000000000001477366773500163075ustar00rootroot00000000000000pglast-7.7/.github/workflows/ci.yml000066400000000000000000000062251477366773500174320ustar00rootroot00000000000000name: Build, test and upload to PyPI # Build on every branch push, tag push, and pull request change: on: [push, pull_request] jobs: doctest: name: All tests, on latest Python runs-on: ubuntu-latest strategy: matrix: python-version: ['3.13'] steps: - uses: actions/checkout@v4 with: submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install -r requirements.txt - name: Build the libpg_query library run: | make -C libpg_query build - name: Build the extension module run: | python setup.py build_ext --inplace - name: Install the module itself in development mode run: | python -m pip install -e . - name: Execute the test suite run: | python -m pytest --cov-report=xml tests/ make -C docs doctest - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 build_wheels: name: Build wheels on ${{ matrix.arch }} for ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-24.04, macos-13] arch: [auto] include: - os: ubuntu-24.04-arm arch: aarch64 - os: windows-2022 arch: x86 - os: windows-2022 arch: AMD64 - os: macos-14 arch: arm64 steps: - name: Checkout sources uses: actions/checkout@v4 with: submodules: true - name: Install Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Set up MSVC CLI tools if: ${{ matrix.os == 'windows-2022' }} uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} - name: Build wheels uses: pypa/cibuildwheel@v2.23.2 env: CIBW_TEST_REQUIRES: "coverage pytest pytest-cov" CIBW_TEST_COMMAND: "py.test {project}/tests" CIBW_SKIP: "cp36* cp37* cp38* pp*" CIBW_ARCHS: ${{ matrix.arch }} CIBW_PRERELEASE_PYTHONS: True # Skip tests on emulated hardware, take too long or not supported CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le} *-macosx_*:arm64" - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: wheels-for-${{ matrix.os }}-${{ matrix.arch }} path: ./wheelhouse/*.whl upload_pypi: name: Upload wheels to PyPI needs: build_wheels runs-on: ubuntu-latest # upload to PyPI on every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v4 with: path: dist pattern: wheels-for-* merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} pglast-7.7/.gitignore000066400000000000000000000002321477366773500146770ustar00rootroot00000000000000*.egg-info *.so *~ /.cache/ /.coverage /.emacs.desktop.lock /.pytest_cache/ /build/ /coverage.json /dist/ /docs/_build/ /emacs.desktop /env/ __pycache__/ pglast-7.7/.gitmodules000066400000000000000000000001661477366773500150720ustar00rootroot00000000000000[submodule "libpg_query"] path = libpg_query url = https://github.com/pganalyze/libpg_query.git branch = 17-latest pglast-7.7/.readthedocs.yaml000066400000000000000000000010661477366773500161440ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Configuration for Read the Docs # :Created: sab 23 dic 2023, 18:10:10 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2023 Lele Gaifax # # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details version: 2 submodules: include: all build: os: ubuntu-22.04 tools: python: "3.11" python: install: - requirements: requirements.txt - method: pip path: . sphinx: configuration: docs/conf.py pglast-7.7/CHANGES.rst000066400000000000000000000772321477366773500145270ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. _changes: Changes ------- Version 7 ######### 7.7 (2025-04-04) ~~~~~~~~~~~~~~~~ - Nothing visible, fix GitHub Actions CI environment 7.6 (2025-04-03) ~~~~~~~~~~~~~~~~ - Upgrade libpg_query to `17-6.1.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/17-6.1.0 7.5 (2025-03-17) ~~~~~~~~~~~~~~~~ - Merge with `Version 6`_ 7.4 (2025-03-17) ~~~~~~~~~~~~~~~~ - Merge with `Version 6`_ 7.3 (2025-02-09) ~~~~~~~~~~~~~~~~ - Handle the ``SET configuration_parameter FROM CURRENT`` case in the ``VariableSetStmt`` printer (`PR #168`__), thanks to Bolaji Wahab __ https://github.com/lelit/pglast/pull/168 7.2 (2024-12-21) ~~~~~~~~~~~~~~~~ - Merge with `Version 6`_ - Handle ``timestamp AT LOCAL`` expression, new in PG17 7.1 (2024-11-26) ~~~~~~~~~~~~~~~~ - Merge with `Version 6`_ 7.0 (2024-11-13) ~~~~~~~~~~~~~~~~ - No visible changes 7.0.dev1 (2024-11-01) ~~~~~~~~~~~~~~~~~~~~~ - Upgrade libpg_query to `17-6.0.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/17-6.0.0 7.0.dev0 (2024-10-31) ~~~~~~~~~~~~~~~~~~~~~ - No visible changes with respect to v6, apart from the support for new/revised syntaxes of `PostgreSQL 17`__ __ https://www.postgresql.org/docs/17/release-17.html ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - Target PostgreSQL 17, thanks to libpg_query `17-latest-dev`__ __ https://github.com/pganalyze/libpg_query/tree/17-latest-dev - Require Python >= 3.9 Version 6 ######### 6.16 (2025-03-17) ~~~~~~~~~~~~~~~~~ - No visible changes, just a workaround to a strange CI Windows-only failure on a test introduced by v6.15 6.15 (2025-03-17) ~~~~~~~~~~~~~~~~~ - Escape occurrences of C-style end markers in SQL-style comments, when changing comment style in the ``RawStream`` (issue `#170`__) __ https://github.com/lelit/pglast/issues/170 6.14 (2025-02-09) ~~~~~~~~~~~~~~~~~ - Handle the ``SET configuration_parameter FROM CURRENT`` case in the ``VariableSetStmt`` printer (backport of `PR #168`__) __ https://github.com/lelit/pglast/pull/168 6.13 (2024-12-17) ~~~~~~~~~~~~~~~~~ - Better fix to the ``x AT TIME ZONE foo`` glitch, v6.12 solution was incomplete 6.12 (2024-12-16) ~~~~~~~~~~~~~~~~~ - Properly wrap ``x AT TIME ZONE foo`` in parens when it is the argument of a ``DEFAULT`` constraint 6.11 (2024-11-26) ~~~~~~~~~~~~~~~~~ - Remove spurious trailing space in the ``ConstrTypePrinter.CONSTR_IDENTITY`` and the ``Constraint`` printers (issue `#165`__) __ https://github.com/lelit/pglast/issues/165 6.10 (2024-11-01) ~~~~~~~~~~~~~~~~~ - Upgrade libpg_query to `16-5.2.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/16-5.2.0 6.9 (2024-10-31) ~~~~~~~~~~~~~~~~ - Fix regression introduced by recent modification to the ``CommonTableExpr`` printer that impacted on the ``RawStream`` renderer (issue `#163`__) __ https://github.com/lelit/pglast/issues/163 - Expose the ``RawStream`` renderer in the CLI tool with a new ``--normalize`` option 6.8 (2024-10-29) ~~~~~~~~~~~~~~~~ - Upgrade libpg_query to not-yet-publicly-released commit__, to solve an issue related to `plpgsql` (issue `#156`__) __ https://github.com/pganalyze/libpg_query/commit/06670290ad39e61805ecacbc6267df61f6ae3d91 __ https://github.com/lelit/pglast/issues/156 6.7 (2024-10-28) ~~~~~~~~~~~~~~~~ - Generate wheels on PyPI using Python 3.13.0 final release, thanks to cibuildwheel `2.21.3`__ __ https://cibuildwheel.pypa.io/en/stable/changelog/#v2213 - Improve ``CommonTableExpr`` printer, reducing horizontal space waste 6.6 (2024-09-30) ~~~~~~~~~~~~~~~~ - Make recently introduced doctest related to issue #88 work on different Python versions 6.5 (2024-09-29) ~~~~~~~~~~~~~~~~ - Fix glitch when using the ``--preserve-comments`` flag (issue `#159`__) __ https://github.com/lelit/pglast/issues/159 - Finally add a note to ``parse_plpgsql()`` documentation mentioning how it differs from ``parse_sql()`` (issue `#88`__) __ https://github.com/lelit/pglast/issues/88 6.4 (2024-09-28) ~~~~~~~~~~~~~~~~ - Fix issue with deserialization of deeply nested ASTs (issue `#153`__) __ https://github.com/lelit/pglast/issues/153 - Upgrade libpg_query to not-yet-publicly-released commit__, to solve an issue related to `plpgsql` (issue `#154`__) __ https://github.com/pganalyze/libpg_query/commit/680f5ee67c6fdae497c8d1edfadd02b9b8eac74f __ https://github.com/lelit/pglast/issues/154 6.3 (2024-08-06) ~~~~~~~~~~~~~~~~ - Fix ``SEQUENCE NAME`` in ``create_seq_stmt_def_elem`` (`PR #151`__), thanks to orages __ https://github.com/lelit/pglast/pull/151 - Generate wheels on PyPI using Python 3.13.0rc1 release, thanks to cibuildwheel `2.20.0`__ __ https://cibuildwheel.pypa.io/en/stable/changelog/#v2200 - Use `Cython 3.0.11`__ __ https://github.com/cython/cython/blob/master/CHANGES.rst#3011-2024-08-05 6.2 (2024-02-01) ~~~~~~~~~~~~~~~~ - Almost no-op release to fix issue `144`__, producing correct wheels for macOS arm64 __ https://github.com/lelit/pglast/issues/144 6.1 (2024-01-22) ~~~~~~~~~~~~~~~~ - Inherit fix for issue `143`__ from `version 5`_ __ https://github.com/lelit/pglast/issues/143 6.0 (2024-01-22) ~~~~~~~~~~~~~~~~ - Produce wheels for macOS arm64 6.0.dev2 (2024-01-21) ~~~~~~~~~~~~~~~~~~~~~ - Enable compilation on Windows and produce related 32bit and 64bit wheels (issue `#7`__) __ https://github.com/lelit/pglast/issues/7 6.0.dev1 (2024-01-11) ~~~~~~~~~~~~~~~~~~~~~ - Re-enable Linux 32bit wheels, thanks to libpg_query to `16-5.1.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/16-5.1.0 6.0.dev0 (2023-12-29) ~~~~~~~~~~~~~~~~~~~~~ - No visible changes with respect to v5, apart from the support for new/revised syntaxes of `PostgreSQL 16`__ __ https://www.postgresql.org/docs/16/release-16.html - Do not build binary wheels for Python 3.8 - Skip compilation on Linux 32bit (see `this comment`__ for details) __ https://github.com/pganalyze/libpg_query/pull/225#issuecomment-1864145089 ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - Target PostgreSQL 16, thanks to libpg_query `16-5.0.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/16-5.0.0 Version 5 ######### 5.9 (2024-01-22) ~~~~~~~~~~~~~~~~ - Fix issue `143`__, affecting ``AlterOwnerStmt`` and ``RenameStmt`` printers __ https://github.com/lelit/pglast/issues/143 5.8 (2024-01-11) ~~~~~~~~~~~~~~~~ - Fix issue `#142`__, a glitch that affected 32-bit systems __ https://github.com/lelit/pglast/issues/142 5.7 (2023-12-23) ~~~~~~~~~~~~~~~~ - Use `Cython 3.0.7`__ __ https://github.com/cython/cython/blob/master/CHANGES.rst#307-2023-12-19 - Update libpg_query to `15-4.2.4`__ __ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.4 5.6 (2023-12-07) ~~~~~~~~~~~~~~~~ - Fix issue `#138`__, a defect that hindered the creation of AST nodes that act as *markers*, (currently ``A_Star`` and ``CheckPointStmt``), that do not carry any other information __ https://github.com/lelit/pglast/issues/138 - Use `Cython 3.0.6`__ __ https://github.com/cython/cython/blob/master/CHANGES.rst#306-2023-11-26 - Handle the ``ENABLE TRIGGER ALL`` in ``AlterTableCmd`` - Fix issue `#136`__, a regression introduced by “Avoid overly abundancy of parentheses in expressions” __ https://github.com/lelit/pglast/issues/136 5.5 (2023-10-07) ~~~~~~~~~~~~~~~~ - Use `Cython 3.0.3`__ __ https://github.com/cython/cython/blob/master/CHANGES.rst#303-2023-10-05 - Produce wheels using final Python 3.12 release, thanks to ``cibuildwheel`` `2.16.2`__ __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v2162 5.4 (2023-08-24) ~~~~~~~~~~~~~~~~ - Improve documentation, adding ``parser.Displacements``, ``parser.scan`` and ``parser.split`` examples (`issue #128`__) __ https://github.com/lelit/pglast/issues/128 - Fix issues `#129`__ and `#130`__ (merged from `version 4.4`__) __ https://github.com/lelit/pglast/issues/129 __ https://github.com/lelit/pglast/issues/130 __ `4.4 (2023-08-24)`_ 5.3 (2023-08-05) ~~~~~~~~~~~~~~~~ - Update libpg_query to `15-4.2.3`__ __ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.3 5.2 (2023-05-20) ~~~~~~~~~~~~~~~~ - Update libpg_query to `15-4.2.1`__ __ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.1 5.1 (2023-02-28) ~~~~~~~~~~~~~~~~ - Merge `version 4.2`__ changes __ `4.2 (2023-02-27)`_ 5.0 (2023-02-19) ~~~~~~~~~~~~~~~~ - No changes 5.0.dev1 (2023-02-11) ~~~~~~~~~~~~~~~~~~~~~ - Update libpg_query to `15-4.2.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/15-4.2.0 ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - Change the type of the ``ast.Float`` value from ``Decimal`` to ``str`` Using a ``Decimal`` implies potential differences in the representation of floating numbers, and already caused issues (`#91`__ and `#100`__) in the past, making it impossible to render, say, ``SELECT 0.0e1``, due to the fact that ``Decimal('0.0e1')`` resolves to ``Decimal('0')``. __ https://github.com/lelit/pglast/issues/91 __ https://github.com/lelit/pglast/issues/100 5.0.dev0 (2022-12-19) ~~~~~~~~~~~~~~~~~~~~~ - No visible changes with respect to v4, apart from the support for new/revised syntaxes of `PostgreSQL 15`__ __ https://www.postgresql.org/docs/15/release-15.html ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - Target PostgreSQL 15, thanks to libpg_query `15-4.0.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/15-4.0.0 Version 4 ######### 4.5 (unreleased) ~~~~~~~~~~~~~~~~ - Use `Cython 3.0.2`__ __ https://github.com/cython/cython/blob/master/CHANGES.rst#302-2023-08-27 4.4 (2023-08-24) ~~~~~~~~~~~~~~~~ - Fix issues `#129`__ and `#130`__ (merged from `version 3.18`__) __ https://github.com/lelit/pglast/issues/129 __ https://github.com/lelit/pglast/issues/130 __ `3.18 (2023-08-24)`_ 4.3 (2023-04-27) ~~~~~~~~~~~~~~~~ - Fix `serialization issue`__ when column's ``DEFAULT`` value is an expression __ https://github.com/pganalyze/libpg_query/issues/188 4.2 (2023-02-27) ~~~~~~~~~~~~~~~~ - Handle special syntax required by ``SET TIME ZONE INTERVAL '-08:00' hour to minute`` - Fix mistype mapping of raw C "long" and "double" attributes, that were decorated with the wrong Python type 4.1 (2022-12-19) ~~~~~~~~~~~~~~~~ - Fix serialization glitches introduced by “Avoid overly abundancy of parentheses in expressions” (to be precise, by this__ commit) __ https://github.com/lelit/pglast/commit/6cfe75eea80f9c9bec4ba467e7ec1ec0796020de 4.0 (2022-12-12) ~~~~~~~~~~~~~~~~ - Update libpg_query to final `14-3.0.0`__ __ https://github.com/pganalyze/libpg_query/releases/tag/14-3.0.0 4.0.dev0 (2022-11-24) ~~~~~~~~~~~~~~~~~~~~~ - Update libpg_query to `14-3.0.0`__ __ https://github.com/pganalyze/libpg_query/blob/14-latest/CHANGELOG.md#14-300---2022-11-17 - Avoid overly abundancy of parentheses in expressions - Prefer ``SELECT a FROM b LIMIT ALL`` to ``... LIMIT NONE`` ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - Target PostgreSQL 14 - The wrapper classes used in previous versions, implemented in ``pglast.node``, are gone: now everything works on top of the ``AST`` classes (`issue #80`__) __ https://github.com/lelit/pglast/issues/80 - The ``Ancestor`` class is not iterable anymore: it was an internal implementation facility, now moved to a ``_iter_members()`` method Version 3 ######### 3.18 (2023-08-24) ~~~~~~~~~~~~~~~~~ - Fix ``BooleanTest`` printer, enclosing expression within parens in more cases (`issue #129`__) __ https://github.com/lelit/pglast/issues/129 - Fix ``Constraint`` printer, avoiding repetition of "DEFERRABLE INITIALLY DEFERRED" on some kind of constraints (`issue #130`__) __ https://github.com/lelit/pglast/issues/130 3.17 (2022-11-04) ~~~~~~~~~~~~~~~~~ - Fix ``AlterSubscriptionStmt`` printer, handling "SET PUBLICATION" without options 3.16 (2022-11-03) ~~~~~~~~~~~~~~~~~ - Update libpg_query to `13-2.2.0`__ __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-220---2022-11-02 3.15 (2022-10-17) ~~~~~~~~~~~~~~~~~ - Produce Python 3.11 wheels (`PR #108`__), thanks to ``cibuildwheel`` 2.11.1__ and to Bastien Gandouet __ https://github.com/lelit/pglast/pull/108 __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v2111 3.14 (2022-08-08) ~~~~~~~~~~~~~~~~~ - Harden the way ``Visitor`` handle modifications to the AST (`issue #107`__) __ https://github.com/lelit/pglast/issues/107 3.13 (2022-06-29) ~~~~~~~~~~~~~~~~~ - Update libpg_query to `13-2.1.2`__ __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-212---2022-06-28 3.12 (2022-06-19) ~~~~~~~~~~~~~~~~~ - Rewrite the implementation of the ``referenced_relations()`` function, that was flawed with regard to CTEs handling (`issue #106`__), thanks to Michal Charemza for providing his own version __ https://github.com/lelit/pglast/issues/106 - Improve ``WithClause`` printer indentation - Fix minor whitespace related issues in a few printer functions 3.11 (2022-05-29) ~~~~~~~~~~~~~~~~~ - Fix the ``Visitor`` class, it was ignoring nodes nested in sub-lists - Reduce the size of the generated parser by factoring out common code into helper functions 3.10 (2022-05-11) ~~~~~~~~~~~~~~~~~ - Update libpg_query to `13-2.1.1`__ (`PR #102`__), thanks to James Guthrie __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-211---2022-05-03 __ https://github.com/lelit/pglast/pull/102 - Produce `musllinux`__ wheels, thanks to ``cibuildwheel`` `2.5.0`__ (:PEP:`656` was actually introduced in `2.2.0`__) __ https://peps.python.org/pep-0656/ __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v250 __ https://cibuildwheel.readthedocs.io/en/stable/changelog/#v220 3.9 (2022-02-24) ~~~~~~~~~~~~~~~~ - Fix bug handling node containing a ``location`` field, e.g. ``CreateTableSpaceStmt`` (`issue #98`__) __ https://github.com/lelit/pglast/issues/98 - Properly handle dereferenced array expression (`issue #99`__) __ https://github.com/lelit/pglast/issues/99 - Avoid improper "floatification" of literal integers (`issue #100`__) __ https://github.com/lelit/pglast/issues/100 3.8 (2021-12-28) ~~~~~~~~~~~~~~~~ - Fix glitch in the AST extractor tool (`issue #97`__) __ https://github.com/lelit/pglast/issues/97 - Add Linux AArch64 wheel build support (`PR #95`__), thanks to odidev __ https://github.com/lelit/pglast/pull/95 - Fix type mismatch when using ``--remove-pg_catalog-from-functions`` (`PR #93`__), thanks to Boris Zentner __ https://github.com/lelit/pglast/pull/93/ 3.7 (2021-10-13) ~~~~~~~~~~~~~~~~ - Update libpg_query to `13-2.1.0`__ __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-210---2021-10-12_ 3.6 (2021-10-09) ~~~~~~~~~~~~~~~~ - Use latest libpg_query, to fix an error parsing ``PLpgSQL`` statements (`issue #88`__) __ https://github.com/lelit/pglast/issues/88 3.5 (2021-09-26) ~~~~~~~~~~~~~~~~ - Forward the ``special_functions`` option to substream, when concatenating items (`issue #89`__) __ https://github.com/lelit/pglast/issues/89 - Fix representation of floating point numbers without decimal digits (`issue #91`__) __ https://github.com/lelit/pglast/issues/91 - Produce Python 3.10 wheels, thanks to ``cibuildwheel`` 2.1.2 - Update libpg_query to `13-2.0.7`__ __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-207---2021-07-16_ - New option ``--remove-pg_catalog-from-functions`` on the command line tool (`PR #90`__), thanks to Boris Zentner __ https://github.com/lelit/pglast/pull/90/ - Implement more *special functions* (`PR #92`__), thanks to Boris Zentner __ https://github.com/lelit/pglast/pull/92/ 3.4 (2021-08-21) ~~~~~~~~~~~~~~~~ - Fix another packaging issue, that prevented recompilation from the sdist ``.tar.gz`` (`issue #86`__), thanks to Christopher Brichford __ https://github.com/lelit/pglast/issues/82 3.3 (2021-07-04) ~~~~~~~~~~~~~~~~ - Update libpg_query to `13-2.0.6`__ __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-206---2021-06-29_ 3.2 (2021-06-25) ~~~~~~~~~~~~~~~~ - Effectively include libpg_query's vendored sources (`issue #82`__) __ https://github.com/lelit/pglast/issues/82 3.1 (2021-06-25) ~~~~~~~~~~~~~~~~ - Fix packaging glitch (`issue #82`__) __ https://github.com/lelit/pglast/issues/82 - Build wheels also for macOS - Update libpg_query to `13-2.0.5`__ __ https://github.com/pganalyze/libpg_query/blob/13-latest/CHANGELOG.md#13-205---2021-06-24_ 3.0 (2021-06-04) ~~~~~~~~~~~~~~~~ - Fix glitch in the ``RawStream``, avoiding spurious space after an open parenthesis - Improve the ``Visitor`` class, to make it easier altering the original tree - Properly handle nested lists in the serialization of AST Node 3.0.dev2 (2021-05-22) ~~~~~~~~~~~~~~~~~~~~~ - Fix bug in ``CreateStmt`` printer (`issue #79`__) __ https://github.com/lelit/pglast/issues/79 - Make it possible to pass also concrete ``ast.Node``\ s to ``RawStream``` ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - To reduce confusion, the ``printer`` module has been removed: print-specific stuff is now directly exposed by the ``printers`` subpackage while serialization classes are now in the new ``stream`` module - The default value for the ``safety_belt`` option of the ``printify()`` function is now ``False`` 3.0.dev1 (2021-05-16) ~~~~~~~~~~~~~~~~~~~~~ - Fix ``AT_SetIdentity``, ``AT_EnableReplicaTrig`` and ``AlterSubscriptionStmt`` printers - Improve ``AlterTSConfigType`` and ``IntoClause`` printers - New generic "visitor pattern" (`issue #51`__) exemplified by a new ``referenced_relations()`` function (`issue #66`__) __ https://github.com/lelit/pglast/issues/51 __ https://github.com/lelit/pglast/issues/66 - Refine printing of SQL comments - Implement ``AlterExtensionStmt`` printer 3.0.dev0 (2021-05-03) ~~~~~~~~~~~~~~~~~~~~~ - Expose the new ``pg_query_scan()`` function as ``parser.scan()`` - Expose the ``pg_query_parse()`` function as ``parser.parse_sql_json()`` - Expose the new ``pg_query_parse_protobuf()`` function as ``parser.parse_sql_protobuf()`` - Expose the new ``pg_query_deparse_protobuf()`` function as ``parser.deparse_protobuf()`` - Honor the ``catalogname`` of a ``RangeVar`` if present (`issue #71`__) __ https://github.com/lelit/pglast/issues/71 - Cover almost all ``SQL`` statements, testing against the whole ``PostgreSQL`` `regression suite`__ (`issue #68`__, `PR #72`__ and `PR #77`__), thanks to Ronan Dunklau and Hong Cheng __ https://github.com/pganalyze/libpg_query/tree/13-latest/test/sql/postgres_regress_ __ https://github.com/lelit/pglast/issues/68 __ https://github.com/lelit/pglast/pull/72 __ https://github.com/lelit/pglast/pull/77 - New rudimentary support for the `preserve comments` feature (`issue #23`__) __ https://github.com/lelit/pglast/issues/23 ~~~~~~~~~~~~~~~~~~~~ **Breaking changes** ~~~~~~~~~~~~~~~~~~~~ - Target PostgreSQL 13 - The ``pglast.parser`` module exposes all ``libpg_query`` entry points, even the new ``pg_query_deparse_protobuf()`` function that is basically equivalent to ``RawStream``\ -based printer - The ``split()`` function is now based on the lower level ``pg_query_split_with_xxx()`` functions - The ``parse_sql()`` function returns native Python objects, not a ``JSON`` string as before: all PG *nodes* are now represented by subclasses of ``pglast.ast.Node``, without exception, even ``Expr`` and ``Value`` are there. The latter impacts on ``pglast.node.Scalar``: for example it now may contains a ``ast.Integer`` instance instead of a Python ``int`` - The ``pgpp --parse-tree`` output is a `pprint`__ represention of the ``AST``, not a ``JSON`` string as before __ https://docs.python.org/3.9/library/pprint.html#pprint.pprint - The ``ParseError`` exception does not expose the ``location`` as an instance member anymore, although its still there, as the second argument (ie ``.args[1]``); furthermore, its value now corresponds to the index in the original Unicode string, instead of the offset in the ``UTF-8`` representation passed to the underlying C function Version 2 ######### 2.0.dev3 (2021-02-20) ~~~~~~~~~~~~~~~~~~~~~ - Handle ``INCLUDE`` clause in ``IndexStmt`` (`PR #67`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/67 2.0.dev2 (2020-10-24) ~~~~~~~~~~~~~~~~~~~~~ - Merge new ``fingerprint`` functionality from ``v1`` (i.e. ``master``) branch 2.0.dev1 (2020-09-26) ~~~~~~~~~~~~~~~~~~~~~ - Require Python 3.6 or greater - Handle ``ALTER TYPE .. RENAME VALUE`` in ``AlterEnumStmt`` (`PR #52`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/52 - Add support for Create / Alter / Drop PROCEDURE (`PR #48`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/48 - Use Ronan's fork__ of libpg_query, targeting PostgreSQL 12.1 (`PR #36`__) __ https://github.com/rdunklau/libpg_query __ https://github.com/lelit/pglast/pull/36 - Change get_postgresql_version() to return a ``(major, minor)`` tuple (`issue #38`__) __ https://github.com/lelit/pglast/issues/38 - Handle ``ALTER TABLE ... ALTER COLUMN ... SET STORAGE ...`` - Handle PG12 materialized CTEs (`issue #57`) - Support column numbers in ``ALTER INDEX`` (`PR #58`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/58 - Handle ``SET LOGGED`` and ``SET UNLOGGED`` in ``ALTER TABLE`` (`PR #59`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/59 - Handle ``ALTER TYPE ... RENAME`` (`PR #62`__), , thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/62 Version 1 ######### 1.18 (2021-06-01) ~~~~~~~~~~~~~~~~~ - Fix exclusion constraint printer (`issue #81`__) __ https://github.com/lelit/pglast/issues/81 1.17 (2021-02-20) ~~~~~~~~~~~~~~~~~ - Fix the generic case in the ``RenameStmt`` printer 1.16 (2021-02-20) ~~~~~~~~~~~~~~~~~ - Promote to the *stable* state - Move the job of building and uploading binary wheels from TravisCI to GitHub Actions 1.15 (2021-02-19) ~~~~~~~~~~~~~~~~~ - Fix ``IF EXISTS`` variant of ``RenameStmt`` printer (`PR #70`__), thanks to Jonathan Mortensen __ https://github.com/lelit/pglast/pull/70 - Update libpg_query to 10-1.0.5 1.14 (2020-10-24) ~~~~~~~~~~~~~~~~~ - Produce Python 3.9 wheels, thanks to ``cibuildwheel`` 1.6.3 - Expose the ``libpg_query``'s `fingerprint`__ functionality (`PR #64`__), thanks to Yiming Wang __ https://github.com/lfittl/libpg_query/wiki/Fingerprinting __ https://github.com/lelit/pglast/pull/64 1.13 (2020-09-26) ~~~~~~~~~~~~~~~~~ - Handle ``SELECT FROM foo`` 1.12 (2020-06-08) ~~~~~~~~~~~~~~~~~ - Double quote column names in the ``TYPE_FUNC_NAME_KEYWORDS`` set (`issue #55`__) __ https://github.com/lelit/pglast/issues/55 - Possibly wrap ``SELECT`` in ``UNION``/``INTERSECT`` between parens, when needed (`issue #55`__) __ https://github.com/lelit/pglast/issues/55 1.11 (2020-05-08) ~~~~~~~~~~~~~~~~~ - Fix ``A_Expr`` printer, when ``lexpr`` is missing (`PR #54`__), thanks to Aiham __ https://github.com/lelit/pglast/pull/54 - Support ``DISABLE ROW LEVEL SECURITY`` in ``AlterTableCmd`` (`PR #49`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/49 - Implement ``CreateOpClassStmt`` printer (`PR #47`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/47 1.10 (2020-01-25) ~~~~~~~~~~~~~~~~~ - Fix collation name printer (`PR #44`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/44 - Implement ``CreatePLangStmt`` printer (`PR #42`__), thanks to Bennie Swart __ https://github.com/lelit/pglast/pull/42 - Fix privileges printer (`PR #41`__), thanks to Bennie Swart __ https://github.com/lelit/pglast/pull/41 - Handle ``TRUNCATE`` event in ``CreateTrigStmt`` printer (`PR #40`__), thanks to Bennie Swart __ https://github.com/lelit/pglast/pull/40 - Fix function body dollar quoting (`PR #39`__), thanks to Bennie Swart __ https://github.com/lelit/pglast/pull/39 1.9 (2019-12-20) ~~~~~~~~~~~~~~~~ - Prettier ``INSERT`` representation 1.8 (2019-12-07) ~~~~~~~~~~~~~~~~ - Prettier ``CASE`` representation - New option to emit a semicolon after the last statement (`issue #24`__) __ https://github.com/lelit/pglast/issues/24 1.7 (2019-12-01) ~~~~~~~~~~~~~~~~ - Implement ``NotifyStmt`` printer - Implement ``RuleStmt`` printer, thanks to Gavin M. Roy for his `PR #28`__ __ https://github.com/lelit/pglast/pull/28 - Fix ``RenameStmt``, properly handling object name - Produce Python 3.8 wheels, thanks to `cibuildwheel`__ 1.0.0 __ https://github.com/joerick/cibuildwheel - Support ``ALTER TABLE RENAME CONSTRAINT`` (`PR #35`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/35 1.6 (2019-09-04) ~~~~~~~~~~~~~~~~ - Fix issue with boolean expressions precedence (`issue #29`__) __ https://github.com/lelit/pglast/issues/29 - Implement ``BitString`` printer - Support ``LEAKPROOF`` option (`PR #31`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/31 - Support ``DEFERRABLE INITIALLY DEFERRED`` option (`PR #32`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/32 1.5 (2019-06-04) ~~~~~~~~~~~~~~~~ - Fix issue with ``RETURNS SETOF`` functions, a more general solution than the one proposed by Ronan Dunklau (`PR #22`__) __ https://github.com/lelit/pglast/pull/22 - Allow more than one empty line between statements (`PR #26`__), thanks to apnewberry __ https://github.com/lelit/pglast/pull/26 1.4 (2019-04-06) ~~~~~~~~~~~~~~~~ - Fix wrap of trigger's WHEN expression (`issue #18`__) __ https://github.com/lelit/pglast/issues/18 - Support for variadic functions (`PR #19`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/19 - Support ORDER / LIMIT / OFFSET for set operations (`PR #20`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/20 - Implement ``ConstraintsSetStmt`` and improve ``VariableSetStmt`` printers 1.3 (2019-03-28) ~~~~~~~~~~~~~~~~ - Support ``CROSS JOIN`` and timezone modifiers on time and timestamp datatypes (`PR #15`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/15 - Many new printers and several enhancements (`PR #14`__), thanks to Ronan Dunklau __ https://github.com/lelit/pglast/pull/14 - Expose the package version as pglast.__version__ (`issue #12`__) __ https://github.com/lelit/pglast/issues/12 1.2 (2019-02-13) ~~~~~~~~~~~~~~~~ - Implement new `split()` function (see `PR #10`__) __ https://github.com/lelit/pglast/pull/10 - Implement ``BooleanTest`` printer (`issue #11`__) __ https://github.com/lelit/pglast/issues/11 1.1 (2018-07-20) ~~~~~~~~~~~~~~~~ - No visible changes, but now PyPI carries binary wheels for Python 3.7. 1.0 (2018-06-16) ~~~~~~~~~~~~~~~~ .. important:: The name of the package has been changed from ``pg_query`` to ``pglast``, to satisfy the request made by the author of ``libpg_query`` in `issue #9`__. This affects both the main repository on GitHub, that from now on is ``https://github.com/lelit/pglast``, and the ReadTheDocs project that hosts the documentation, ``http://pglast.readthedocs.io/en/latest/``. I'm sorry for any inconvenience this may cause. __ https://github.com/lelit/pglast/issues/9 0.28 (2018-06-06) ~~~~~~~~~~~~~~~~~ - Update libpg_query to 10-1.0.2 - Support the '?'-style parameter placeholder variant allowed by libpg_query (details__) __ https://github.com/lfittl/libpg_query/issues/45 0.27 (2018-04-15) ~~~~~~~~~~~~~~~~~ - Prettier JOINs representation, aligning them with the starting relation 0.26 (2018-04-03) ~~~~~~~~~~~~~~~~~ - Fix cosmetic issue with ANY() and ALL() 0.25 (2018-03-31) ~~~~~~~~~~~~~~~~~ - Fix issue in the safety belt check performed by ``pgpp`` (`issue #4`__) __ https://github.com/lelit/pglast/issues/4 0.24 (2018-03-02) ~~~~~~~~~~~~~~~~~ - Implement ``Null`` printer 0.23 (2017-12-28) ~~~~~~~~~~~~~~~~~ - Implement some other DDL statements printers - New alternative style to print *comma-separated-values* lists, activated by a new ``--comma-at-eoln`` option on ``pgpp`` 0.22 (2017-12-03) ~~~~~~~~~~~~~~~~~ - Implement ``TransactionStmt`` and almost all ``DROP xxx`` printers 0.21 (2017-11-22) ~~~~~~~~~~~~~~~~~ - Implement ``NamedArgExpr`` printer - New alternative printers for a set of *special functions*, activated by a new ``--special-functions`` option on ``pgpp`` (`issue #2`__) __ https://github.com/lelit/pglast/issues/2 0.20 (2017-11-21) ~~~~~~~~~~~~~~~~~ - Handle special de-reference (``A_Indirection``) cases 0.19 (2017-11-16) ~~~~~~~~~~~~~~~~~ - Fix serialization of column labels containing double quotes - Fix corner issues surfaced implementing some more DDL statement printers 0.18 (2017-11-14) ~~~~~~~~~~~~~~~~~ - Fix endless loop due to sloppy conversion of command line option - Install the command line tool as ``pgpp`` 0.17 (2017-11-12) ~~~~~~~~~~~~~~~~~ - Rename printers.sql to printers.dml (**backward incompatibility**) - List printer functions in the documentation, referencing the definition of related node type - Fix inconsistent spacing in JOIN condition inside a nested expression - Fix representation of unbound arrays - Fix representation of ``interval`` data type - Initial support for DDL statements - Fix representation of string literals containing single quotes 0.16 (2017-10-31) ~~~~~~~~~~~~~~~~~ - Update libpg_query to 10-1.0.0 0.15 (2017-10-12) ~~~~~~~~~~~~~~~~~ - Fix indentation of boolean expressions in SELECT's targets (`issue #3`__) __ https://github.com/lelit/pglast/issues/3 0.14 (2017-10-09) ~~~~~~~~~~~~~~~~~ - Update to latest libpg_query's 10-latest branch, targeting PostgreSQL 10.0 final 0.13 (2017-09-17) ~~~~~~~~~~~~~~~~~ - Fix representation of subselects requiring surrounding parens 0.12 (2017-08-22) ~~~~~~~~~~~~~~~~~ - New option ``--version`` on the command line tool - Better enums documentation - Release the GIL while calling libpg_query functions 0.11 (2017-08-11) ~~~~~~~~~~~~~~~~~ - Nicer indentation for JOINs, making OUTER JOINs stand out - Minor tweaks to lists rendering, with less spurious whitespaces - New option ``--no-location`` on the command line tool 0.10 (2017-08-11) ~~~~~~~~~~~~~~~~~ - Support Python 3.4 and Python 3.5 as well as Python 3.6 0.9 (2017-08-10) ~~~~~~~~~~~~~~~~ - Fix spacing before the $ character - Handle type modifiers - New option ``--plpgsql`` on the command line tool, just for fun 0.8 (2017-08-10) ~~~~~~~~~~~~~~~~ - Add enums subpackages to the documentation with references to their related headers - New ``compact_lists_margin`` option to produce a more compact representation when possible (see `issue #1`__) __ https://github.com/lelit/pglast/issues/1 0.7 (2017-08-10) ~~~~~~~~~~~~~~~~ - Fix sdist including the Sphinx documentation 0.6 (2017-08-10) ~~~~~~~~~~~~~~~~ - New option ``--parse-tree`` on the command line tool to show just the parse tree - Sphinx documentation, available online 0.5 (2017-08-09) ~~~~~~~~~~~~~~~~ - Handle some more cases when a name must be double-quoted - Complete the serialization of the WindowDef node, handling its frame options 0.4 (2017-08-09) ~~~~~~~~~~~~~~~~ - Expose the actual PostgreSQL version the underlying libpg_query libray is built on thru a new ``get_postgresql_version()`` function - New option `safety_belt` for the ``prettify()`` function, to protect the innocents - Handle serialization of ``CoalesceExpr`` and ``MinMaxExpr`` 0.3 (2017-08-07) ~~~~~~~~~~~~~~~~ - Handle serialization of ``ParamRef`` nodes - Expose a ``prettify()`` helper function 0.2 (2017-08-07) ~~~~~~~~~~~~~~~~ - Test coverage at 99% - First attempt at automatic wheel upload to PyPI, let's see... 0.1 (2017-08-07) ~~~~~~~~~~~~~~~~ - First release ("Hi daddy!", as my soul would tag it) pglast-7.7/MANIFEST.in000066400000000000000000000015131477366773500144500ustar00rootroot00000000000000exclude .git .gitmodules exclude .github/* include *.cfg *.py *.rst *.txt Makefile* include docs/Makefile include docs/*.rst include docs/*.py include tests/*.py include tools/*.py recursive-include pglast *.py *.pyx *.pxd recursive-include tests *.sql exclude libpg_query/* include libpg_query/LICENSE libpg_query/Makefile libpg_query/pg_query.h recursive-include libpg_query/src *.c *.h recursive-include libpg_query/vendor *.c *.h include libpg_query/srcdata/*.json prune libpg_query/.github prune libpg_query/examples prune libpg_query/patches prune libpg_query/protobuf include libpg_query/protobuf/pg_query.proto libpg_query/protobuf/pg_query.pb-c.c libpg_query/protobuf/pg_query.pb-c.h prune libpg_query/scripts prune libpg_query/test prune libpg_query/testdata prune libpg_query/tmp include libpg_query/test/sql/postgres_regress/*.sql pglast-7.7/Makefile000066400000000000000000000116021477366773500143520ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Development Makefile # :Created: gio 03 ago 2017 14:52:45 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2023, 2024 Lele Gaifax # export TOPDIR := $(CURDIR) ifeq ($(VIRTUAL_ENV),) export VENVDIR := $(TOPDIR)/env else export VENVDIR := $(VIRTUAL_ENV) endif export PYTHON := $(VENVDIR)/bin/python export CYTHON := $(VENVDIR)/bin/cython export SHELL := bash export SYS_PYTHON := $(shell command -v python3) GENERATED_DOCS := $(shell git grep -l "DO NOT EDIT: " docs/) GENERATED_SRCS := $(shell git grep -l "DO NOT EDIT: " pglast/) all: virtualenv libpg_query/Makefile help libpg_query/Makefile: git submodule update --init help:: @printf "\nBuild targets\n" @printf "=============\n\n" help:: @printf "build\n\tbuild the module and update derivated sources\n" .PHONY: build build: virtualenv build: $(VENVDIR)/libpg_query.hash build: $(VENVDIR)/extension.timestamp build: enums build: keywords build: printers-doc FORCE: $(VENVDIR)/libpg_query.hash: FORCE @git -C libpg_query rev-parse HEAD > $@.new @if test -r $@ && cmp --quiet $@ $@.new; \ then rm $@.new; \ else mv $@.new $@; echo "Updated $@"; \ fi $(VENVDIR)/extension.timestamp: setup.py $(VENVDIR)/extension.timestamp: libpg_query/libpg_query.a $(VENVDIR)/extension.timestamp: pglast/parser.c $(PYTHON) setup.py build_ext --inplace --force @touch $@ libpg_query/libpg_query.a: libpg_query/Makefile libpg_query/libpg_query.a: libpg_query/src/*.c libpg_query/src/*.h $(MAKE) -C libpg_query build pglast/parser.c: pglast/ast.pyx pglast/parser.c: pglast/parser.pyx pglast/parser.c: pglast/structs.pxd $(CYTHON) pglast/parser.pyx @: Ensure postgres.h is included as early as possible, to support win32 printf "%s\n" '/^#include "postgres.h"/m1' 'wq' | ed -s pglast/parser.c help:: @printf "recythonize\n\tforce retranslation of the pyx module\n" .PHONY: recythonize recythonize: rm -f $(VENVDIR)/extension.timestamp $(MAKE) build help:: @printf "clean\n\tremove rebuildable stuff\n" .PHONY: clean clean: $(MAKE) -C docs SPHINXBUILD=$(SPHINXBUILD) clean $(MAKE) -C libpg_query clean rm -f pglast/*.so help:: @printf "distclean\n\tremove anything superfluous\n" .PHONY: distclean distclean:: clean rm -rf build dist git submodule deinit --all help:: @printf "enums\n\textract Python enums from PG sources\n" PY_ENUMS := $(shell ls pglast/enums/*.py) PG_INCLUDE_DIR := libpg_query/src/postgres/include .PHONY: enums enums: $(PY_ENUMS) $(PY_ENUMS): tools/extract_enums.py $(PY_ENUMS): libpg_query/libpg_query.a $(PY_ENUMS): $(VENVDIR)/libpg_query.hash define extract_enums = $(PYTHON) tools/extract_enums.py -I $(PG_INCLUDE_DIR) $< $@ docs/$(basename $(notdir $@)).rst endef pglast/enums/%.py: $(PG_INCLUDE_DIR)/nodes/%.h $(extract_enums) pglast/enums/lockdefs.py: $(PG_INCLUDE_DIR)/storage/lockdefs.h $(extract_enums) pglast/enums/pg_am.py: $(PG_INCLUDE_DIR)/catalog/pg_am.h $(extract_enums) pglast/enums/pg_attribute.py: $(PG_INCLUDE_DIR)/catalog/pg_attribute.h $(extract_enums) pglast/enums/pg_class.py: $(PG_INCLUDE_DIR)/catalog/pg_class.h $(extract_enums) pglast/enums/pg_trigger.py: $(PG_INCLUDE_DIR)/catalog/pg_trigger.h $(extract_enums) pglast/enums/xml.py: $(PG_INCLUDE_DIR)/utils/xml.h $(extract_enums) help:: @printf "keywords\n\textract Python keyword sets from PG sources\n" PY_KEYWORDS := pglast/keywords.py .PHONY: keywords keywords: $(PY_KEYWORDS) $(PY_KEYWORDS): tools/extract_keywords.py $(PY_KEYWORDS): libpg_query/libpg_query.a $(PY_KEYWORDS): $(VENVDIR)/libpg_query.hash $(PY_KEYWORDS): $(PG_INCLUDE_DIR)/parser/kwlist.h $(PYTHON) tools/extract_keywords.py $(PG_INCLUDE_DIR)/parser/kwlist.h $@ pglast/ast.pyx: tools/extract_ast.py libpg_query/srcdata/struct_defs.json pglast/ast.pyx: $(PY_ENUMS) $(PYTHON) tools/extract_ast.py pglast/ docs/ast.rst help:: @printf "printers-doc\n\tupdate printers documentation\n" PG_NODES := $(PG_INCLUDE_DIR)/nodes/nodes.h $(PG_INCLUDE_DIR)/nodes/parsenodes.h \ $(PG_INCLUDE_DIR)/nodes/primnodes.h $(PG_INCLUDE_DIR)/nodes/value.h .PHONY: printers-doc printers-doc: $(GENERATED_DOCS) $(GENERATED_DOCS): $(PG_NODES) $(GENERATED_DOCS): tools/extract_printers_doc.py $(GENERATED_DOCS): libpg_query/libpg_query.a $(GENERATED_DOCS): $(VENVDIR)/libpg_query.hash docs/%.rst: pglast/printers/%.py $(PYTHON) tools/extract_printers_doc.py $< $@ $(PG_NODES) help:: @printf "doc\n\tbuild Sphinx documentation\n" SPHINXBUILD := $(VENVDIR)/bin/sphinx-build .PHONY: doc doc: $(MAKE) -C docs SPHINXBUILD=$(SPHINXBUILD) html help:: @printf "check\n\trun the test suite\n" PYTEST = $(VENVDIR)/bin/pytest $(PYTEST_OPTIONS) COVERAGE = $(VENVDIR)/bin/coverage .PHONY: check check: build $(PYTEST) tests/ $(MAKE) -C docs SPHINXBUILD=$(SPHINXBUILD) doctest $(COVERAGE) json -o $(TOPDIR)/coverage.json include Makefile.virtualenv include Makefile.release pglast-7.7/Makefile.release000066400000000000000000000050031477366773500157670ustar00rootroot00000000000000# -*- mode: makefile-gmake; coding: utf-8 -*- # :Project: pglast — Release targets # :Created: gio 03 ago 2017 14:53:18 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax # BUMPER := $(VENVDIR)/bin/bump-my-version bump VERSION = $(shell bump-my-version show current_version 2>/dev/null) MOD_INIT := pglast/__init__.py DOCS_CONF := docs/conf.py TWINE := $(VENVDIR)/bin/twine help:: @printf "\nRelease management\n" @printf "==================\n\n" .PHONY: assert-clean-tree assert-clean-tree: @(test -z "$(shell git status -s --untracked=no)" || \ (echo "UNCOMMITTED STUFF" && false)) bump-version: $(VENVDIR)/extension.timestamp enums keywords printers-doc $(BUMPER) $(VERSION_PART) @echo ">>>" @echo ">>> Do your duties (update CHANGES.rst for example), then" @echo ">>> execute “make $(RELEASE_KIND)tag-release”." @echo ">>>" help:: @printf "release\n\tBump version number\n" .PHONY: release release: VERSION_PART = minor release: bump-version help:: @printf "dev-release\n\tBump the development version number\n" .PHONY: dev-release dev-release: VERSION_PART = pre_number dev-release: RELEASE_KIND = dev- dev-release: bump-version help:: @printf "tag-release\n\tComplete the release tagging the working tree\n" .PHONY: tag-release tag-release: check-release-date check-long-description-markup git commit -a -m "Release $(VERSION)" git tag -a -m "Version $(VERSION)" v$(VERSION) help:: @printf "dev-tag-release\n\tComplete the development release tagging the working tree\n" .PHONY: dev-tag-release dev-tag-release: check-release-date check-long-description-markup git commit -a -m "Development release $(VERSION)" git tag -a -m "Development version $(VERSION)" v$(VERSION) .PHONY: check-long-description-markup check-long-description-markup: @$(PYTHON) setup.py --quiet sdist @$(TWINE) check dist/pglast-$(VERSION).tar.gz .PHONY: check-release-date check-release-date: @fgrep -q "$(VERSION) ($(shell date --iso-8601))" CHANGES.rst \ || (echo "ERROR: release date of version $(VERSION) not set in CHANGES.rst"; exit 1) help:: @printf "pypi-upload\n\tUpload the source distribution to PyPI\n" .PHONY: pypi-upload pypi-upload: assert-clean-tree @$(PYTHON) setup.py sdist $(TWINE) upload dist/pglast-$(VERSION).tar.gz help:: @printf "publish\n\tUpload to PyPI, push changes and tags to the remote repo\n" .PHONY: publish publish: pypi-upload git push --follow-tags pglast-7.7/Makefile.virtualenv000066400000000000000000000024671477366773500165610ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Virtualenv targets # :Created: gio 03 ago 2017 16:55:55 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2020, 2024 Lele Gaifax # ACTIVATE_SCRIPT := $(VENVDIR)/bin/activate PIP := $(VENVDIR)/bin/pip REQUIREMENTS ?= requirements.txt REQUIREMENTS_TIMESTAMP := $(VENVDIR)/$(REQUIREMENTS).timestamp help:: @printf "\nPython virtualenv related targets\n" @printf "=================================\n\n" help:: @printf "virtualenv\n\tsetup the Python virtualenv and install required packages\n" .PHONY: virtualenv virtualenv: $(VENVDIR) requirements $(VENVDIR): @echo "Bootstrapping Python 3 virtualenv..." @$(SYS_PYTHON) -m venv --prompt $(notdir $(TOPDIR)) $@ @$(MAKE) upgrade-pip help:: @printf "upgrade-pip\n\tupgrade pip\n" .PHONY: upgrade-pip upgrade-pip: @echo "Upgrading pip..." @$(PIP) install --no-cache-dir --upgrade pip help:: @printf "requirements\n\tinstall/update required Python packages\n" .PHONY: requirements requirements: $(REQUIREMENTS_TIMESTAMP) $(REQUIREMENTS_TIMESTAMP): $(REQUIREMENTS) @echo "Installing pre-requirements..." @PATH="$(TOPDIR)/bin:$(PATH)" $(PIP) install --no-cache-dir -r $(REQUIREMENTS) @touch $@ distclean:: rm -rf $(VENVDIR) pglast-7.7/README.rst000066400000000000000000000046011477366773500144020ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — PostgreSQL Languages AST .. :Created: mer 02 ago 2017 14:49:24 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax .. ======== pglast ======== PostgreSQL Languages AST and statements prettifier ================================================== :Author: Lele Gaifax :Contact: lele@metapensiero.it :License: `GNU General Public License version 3 or later`__ :Status: |build| |doc| |codecov| :Version: `7`__ __ https://www.gnu.org/licenses/gpl.html __ https://pglast.readthedocs.io/en/v7/development.html#history .. |build| image:: https://github.com/lelit/pglast/actions/workflows/ci.yml/badge.svg?branch=v7 :target: https://github.com/lelit/pglast/actions/workflows/ci.yml :alt: Build status .. |doc| image:: https://readthedocs.org/projects/pglast/badge/?version=v7 :target: https://readthedocs.org/projects/pglast/builds/ :alt: Documentation status .. |codecov| image:: https://codecov.io/gh/lelit/pglast/branch/v3/graph/badge.svg?token=A90D8tWnft :target: https://codecov.io/gh/lelit/pglast :alt: Test coverage status This is a Python 3 module that exposes the *parse tree* of a PostgreSQL__ statement (extracted by the almost standard PG parser repackaged as a standalone static library by `libpg_query`__) as set of interconnected *nodes*, usually called an *abstract syntax tree*. __ https://www.postgresql.org/ __ https://github.com/pganalyze/libpg_query See a `more detailed introduction`__ in the documentation_. __ https://pglast.readthedocs.io/en/v7/introduction.html Installation ------------ As usual, the easiest way is with pip:: $ pip install pglast Alternatively you can clone the repository:: $ git clone https://github.com/lelit/pglast.git --recursive and install from there:: $ pip install ./pglast Development ----------- There is a set of *makefiles* implementing the most common operations, a ``make help`` will show a brief table of contents. A comprehensive test suite, based on pytest__, covers__ nearly 99% of the source lines. __ https://docs.pytest.org/en/latest/ __ https://codecov.io/gh/lelit/pglast/branch/v7/ Documentation ------------- Latest documentation is hosted by `Read the Docs`__ at https://pglast.readthedocs.io/en/v7 __ https://readthedocs.org/ pglast-7.7/docs/000077500000000000000000000000001477366773500136425ustar00rootroot00000000000000pglast-7.7/docs/Makefile000066400000000000000000000011371477366773500153040ustar00rootroot00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = python -msphinx SPHINXPROJ = pglast SOURCEDIR = . BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) pglast-7.7/docs/api.rst000066400000000000000000000012261477366773500151460ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — API documentation .. :Created: gio 10 ago 2017 10:14:17 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2019, 2021, 2022, 2024, 2025 Lele Gaifax .. =================== API documentation =================== This chapter briefly explains some implementation detail. .. automodule:: pglast :members: Comment, Error, parse_plpgsql, prettify, split, __author__, __version__ .. toctree:: :maxdepth: 2 :caption: Packages parser ast enums keywords stream printers sfuncs visitors pglast-7.7/docs/ast.rst000066400000000000000000004634311477366773500151760ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2021-2025 Lele Gaifax .. .. _pglast.ast: =================================================================== :mod:`pglast.ast` --- Python classes representing PG parser nodes =================================================================== The module implements a set of *data* classes, one for each ``C`` structure defined in several PostgreSQL headers, primarily those in the `include/nodes/`__ directory. __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/nodes The :class:`pglast.ast.Node` is an abstract class that implements the common behaviour of all the concrete classes. In particular any node can be :meth:`compared ` with another instance, is able to :meth:`serialize ` itself and can be :meth:`altered `. .. module:: pglast.ast .. autoclass:: Node :special-members: __repr__, __eq__, __call__, __setattr__ .. class:: A_ArrayExpr(elements=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: elements :type: tuple Array element expressions .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: A_Const(isnull=None, val=None) Wrapper for the `homonymous `__ parser node. .. attribute:: isnull :type: bool .. attribute:: val :type: ValUnion .. class:: A_Expr(kind=None, name=None, lexpr=None, rexpr=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: A_Expr_Kind .. attribute:: name :type: tuple Possibly-qualified name of operator .. attribute:: lexpr :type: Node Left argument, or NULL if none .. attribute:: rexpr :type: Node Right argument, or NULL if none .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: A_Indices(is_slice=None, lidx=None, uidx=None) Wrapper for the `homonymous `__ parser node. .. attribute:: is_slice :type: bool True if slice (i.e., colon present) .. attribute:: lidx :type: Node Slice lower bound, if any .. attribute:: uidx :type: Node Subscript, or slice upper bound if any .. class:: A_Indirection(arg=None, indirection=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Node The thing being selected from .. attribute:: indirection :type: tuple Subscripts and/or field names and/or * .. class:: A_Star() Wrapper for the `homonymous `__ parser node. .. class:: AccessPriv(priv_name=None, cols=None) Wrapper for the `homonymous `__ parser node. .. attribute:: priv_name :type: str String name of privilege .. attribute:: cols :type: tuple List of String .. class:: Aggref(aggargtypes=None, aggdirectargs=None, args=None, aggorder=None, aggdistinct=None, aggfilter=None, aggstar=None, aggvariadic=None, aggkind=None, agglevelsup=None, aggsplit=None, aggno=None, aggtransno=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: aggargtypes :type: tuple .. attribute:: aggdirectargs :type: tuple .. attribute:: args :type: tuple .. attribute:: aggorder :type: tuple .. attribute:: aggdistinct :type: tuple .. attribute:: aggfilter :type: Expr* .. attribute:: aggstar :type: bool .. attribute:: aggvariadic :type: bool .. attribute:: aggkind :type: str .. attribute:: agglevelsup :type: Index .. attribute:: aggsplit :type: AggSplit .. attribute:: aggno :type: int .. attribute:: aggtransno :type: int .. attribute:: location :type: ParseLoc .. class:: Alias(aliasname=None, colnames=None) Wrapper for the `homonymous `__ parser node. .. attribute:: aliasname :type: str Aliased rel name (never qualified) .. attribute:: colnames :type: tuple Optional list of column aliases .. class:: AlterCollationStmt(collname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: collname :type: tuple .. class:: AlterDatabaseRefreshCollStmt(dbname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: dbname :type: str .. class:: AlterDatabaseSetStmt(dbname=None, setstmt=None) Wrapper for the `homonymous `__ parser node. .. attribute:: dbname :type: str Database name .. attribute:: setstmt :type: VariableSetStmt* SET or RESET subcommand .. class:: AlterDatabaseStmt(dbname=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: dbname :type: str Name of database to alter .. attribute:: options :type: tuple List of DefElem nodes .. class:: AlterDefaultPrivilegesStmt(options=None, action=None) Wrapper for the `homonymous `__ parser node. .. attribute:: options :type: tuple List of DefElem .. attribute:: action :type: GrantStmt* GRANT/REVOKE action (with objects=NIL) .. class:: AlterDomainStmt(subtype=None, typeName=None, name=None, def_=None, behavior=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subtype :type: str * T = alter column default * N = alter column drop not null * O = alter column set not null * C = add constraint * X = drop constraint .. attribute:: typeName :type: tuple Domain to work on .. attribute:: name :type: str Column or constraint name to act on .. attribute:: def_ :type: Node Definition of default or constraint .. attribute:: behavior :type: DropBehavior RESTRICT or CASCADE for DROP cases .. attribute:: missing_ok :type: bool Skip error if missing? .. class:: AlterEnumStmt(typeName=None, oldVal=None, newVal=None, newValNeighbor=None, newValIsAfter=None, skipIfNewValExists=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeName :type: tuple Qualified name (list of String) .. attribute:: oldVal :type: str Old enum value's name, if renaming .. attribute:: newVal :type: str New enum value's name .. attribute:: newValNeighbor :type: str Neighboring enum value, if specified .. attribute:: newValIsAfter :type: bool Place new enum value after neighbor? .. attribute:: skipIfNewValExists :type: bool No error if new already exists? .. class:: AlterEventTrigStmt(trigname=None, tgenabled=None) Wrapper for the `homonymous `__ parser node. .. attribute:: trigname :type: str TRIGGER's name .. attribute:: tgenabled :type: str Trigger's firing configuration WRT session_replication_role .. class:: AlterExtensionContentsStmt(extname=None, action=None, objtype=None, object=None) Wrapper for the `homonymous `__ parser node. .. attribute:: extname :type: str Extension's name .. attribute:: action :type: int +1 = add object, -1 = drop object .. attribute:: objtype :type: ObjectType Object's type .. attribute:: object :type: Node Qualified name of the object .. class:: AlterExtensionStmt(extname=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: extname :type: str .. attribute:: options :type: tuple List of DefElem nodes .. class:: AlterFdwStmt(fdwname=None, func_options=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: fdwname :type: str Foreign-data wrapper name .. attribute:: func_options :type: tuple HANDLER/VALIDATOR options .. attribute:: options :type: tuple Generic options to FDW .. class:: AlterForeignServerStmt(servername=None, version=None, options=None, has_version=None) Wrapper for the `homonymous `__ parser node. .. attribute:: servername :type: str Server name .. attribute:: version :type: str Optional server version .. attribute:: options :type: tuple Generic options to server .. attribute:: has_version :type: bool Version specified .. class:: AlterFunctionStmt(objtype=None, func=None, actions=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objtype :type: ObjectType .. attribute:: func :type: ObjectWithArgs* Name and args of function .. attribute:: actions :type: tuple List of DefElem .. class:: AlterObjectDependsStmt(objectType=None, relation=None, object=None, extname=None, remove=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objectType :type: ObjectType OBJECT_FUNCTION, OBJECT_TRIGGER, etc .. attribute:: relation :type: RangeVar* In case a table is involved .. attribute:: object :type: Node Name of the object .. attribute:: extname :type: String* Extension name .. attribute:: remove :type: bool Set true to remove dep rather than add .. class:: AlterObjectSchemaStmt(objectType=None, relation=None, object=None, newschema=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objectType :type: ObjectType OBJECT_TABLE, OBJECT_TYPE, etc .. attribute:: relation :type: RangeVar* In case it's a table .. attribute:: object :type: Node In case it's some other object .. attribute:: newschema :type: str The new schema .. attribute:: missing_ok :type: bool Skip error if missing? .. class:: AlterOpFamilyStmt(opfamilyname=None, amname=None, isDrop=None, items=None) Wrapper for the `homonymous `__ parser node. .. attribute:: opfamilyname :type: tuple Qualified name (list of String) .. attribute:: amname :type: str Name of index AM opfamily is for .. attribute:: isDrop :type: bool ADD or DROP the items? .. attribute:: items :type: tuple List of CreateOpClassItem nodes .. class:: AlterOperatorStmt(opername=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: opername :type: ObjectWithArgs* Operator name and argument types .. attribute:: options :type: tuple List of DefElem nodes .. class:: AlterOwnerStmt(objectType=None, relation=None, object=None, newowner=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objectType :type: ObjectType OBJECT_TABLE, OBJECT_TYPE, etc .. attribute:: relation :type: RangeVar* In case it's a table .. attribute:: object :type: Node In case it's some other object .. attribute:: newowner :type: RoleSpec* The new owner .. class:: AlterPolicyStmt(policy_name=None, table=None, roles=None, qual=None, with_check=None) Wrapper for the `homonymous `__ parser node. .. attribute:: policy_name :type: str Policy's name .. attribute:: table :type: RangeVar* The table name the policy applies to .. attribute:: roles :type: tuple The roles associated with the policy .. attribute:: qual :type: Node The policy's condition .. attribute:: with_check :type: Node The policy's WITH CHECK condition. .. class:: AlterPublicationStmt(pubname=None, options=None, pubobjects=None, for_all_tables=None, action=None) Wrapper for the `homonymous `__ parser node. .. attribute:: pubname :type: str Name of the publication .. attribute:: options :type: tuple List of DefElem nodes .. attribute:: pubobjects :type: tuple Optional list of publication objects .. attribute:: for_all_tables :type: bool Special publication for all tables in db .. attribute:: action :type: AlterPublicationAction What action to perform with the given objects .. class:: AlterRoleSetStmt(role=None, database=None, setstmt=None) Wrapper for the `homonymous `__ parser node. .. attribute:: role :type: RoleSpec* Role .. attribute:: database :type: str Database name, or NULL .. attribute:: setstmt :type: VariableSetStmt* SET or RESET subcommand .. class:: AlterRoleStmt(role=None, options=None, action=None) Wrapper for the `homonymous `__ parser node. .. attribute:: role :type: RoleSpec* Role .. attribute:: options :type: tuple List of DefElem nodes .. attribute:: action :type: int +1 = add members, -1 = drop members .. class:: AlterSeqStmt(sequence=None, options=None, for_identity=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: sequence :type: RangeVar* The sequence to alter .. attribute:: options :type: tuple .. attribute:: for_identity :type: bool .. attribute:: missing_ok :type: bool Skip error if a role is missing? .. class:: AlterStatsStmt(defnames=None, stxstattarget=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: defnames :type: tuple Qualified name (list of String) .. attribute:: stxstattarget :type: Node Statistics target .. attribute:: missing_ok :type: bool Skip error if statistics object is missing .. class:: AlterSubscriptionStmt(kind=None, subname=None, conninfo=None, publication=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: AlterSubscriptionType ALTER_SUBSCRIPTION_OPTIONS, etc .. attribute:: subname :type: str Name of the subscription .. attribute:: conninfo :type: str Connection string to publisher .. attribute:: publication :type: tuple One or more publication to subscribe to .. attribute:: options :type: tuple List of DefElem nodes .. class:: AlterSystemStmt(setstmt=None) Wrapper for the `homonymous `__ parser node. .. attribute:: setstmt :type: VariableSetStmt* SET subcommand .. class:: AlterTSConfigurationStmt(kind=None, cfgname=None, tokentype=None, dicts=None, override=None, replace=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: AlterTSConfigType ALTER_TSCONFIG_ADD_MAPPING, etc .. attribute:: cfgname :type: tuple Qualified name (list of String) .. attribute:: tokentype :type: tuple List of String .. attribute:: dicts :type: tuple List of list of String .. attribute:: override :type: bool If true - remove old variant .. attribute:: replace :type: bool If true - replace dictionary by another .. attribute:: missing_ok :type: bool For DROP - skip error if missing? .. class:: AlterTSDictionaryStmt(dictname=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: dictname :type: tuple Qualified name (list of String) .. attribute:: options :type: tuple List of DefElem nodes .. class:: AlterTableCmd(subtype=None, name=None, num=None, newowner=None, def_=None, behavior=None, missing_ok=None, recurse=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subtype :type: AlterTableType Type of table alteration to apply .. attribute:: name :type: str Column, constraint, or trigger to act on, or tablespace, access method .. attribute:: num :type: int16 Attribute number for columns referenced by number .. attribute:: newowner :type: RoleSpec* .. attribute:: def_ :type: Node Definition of new column, index, constraint, or parent table .. attribute:: behavior :type: DropBehavior RESTRICT or CASCADE for DROP cases .. attribute:: missing_ok :type: bool Skip error if missing? .. attribute:: recurse :type: bool Exec-time recursion .. class:: AlterTableMoveAllStmt(orig_tablespacename=None, objtype=None, roles=None, new_tablespacename=None, nowait=None) Wrapper for the `homonymous `__ parser node. .. attribute:: orig_tablespacename :type: str .. attribute:: objtype :type: ObjectType Object type to move .. attribute:: roles :type: tuple List of roles to move objects of .. attribute:: new_tablespacename :type: str .. attribute:: nowait :type: bool .. class:: AlterTableSpaceOptionsStmt(tablespacename=None, options=None, isReset=None) Wrapper for the `homonymous `__ parser node. .. attribute:: tablespacename :type: str .. attribute:: options :type: tuple .. attribute:: isReset :type: bool .. class:: AlterTableStmt(relation=None, cmds=None, objtype=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Table to work on .. attribute:: cmds :type: tuple List of subcommands .. attribute:: objtype :type: ObjectType Type of object .. attribute:: missing_ok :type: bool Skip error if table missing .. class:: AlterTypeStmt(typeName=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeName :type: tuple Type name (possibly qualified) .. attribute:: options :type: tuple List of DefElem nodes .. class:: AlterUserMappingStmt(user=None, servername=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: user :type: RoleSpec* User role .. attribute:: servername :type: str Server name .. attribute:: options :type: tuple Generic options to server .. class:: AlternativeSubPlan(subplans=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subplans :type: tuple SubPlan(s) with equivalent results .. class:: ArrayCoerceExpr(arg=None, elemexpr=None, resulttypmod=None, coerceformat=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression (yields an array) .. attribute:: elemexpr :type: Expr* Expression representing per-element work .. attribute:: resulttypmod :type: int32 .. attribute:: coerceformat :type: CoercionForm .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: ArrayExpr(elements=None, multidims=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: elements :type: tuple .. attribute:: multidims :type: bool .. attribute:: location :type: ParseLoc .. class:: BitString(bsval=None) Wrapper for the `homonymous `__ parser node. .. attribute:: bsval :type: str .. class:: BoolExpr(boolop=None, args=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: boolop :type: BoolExprType .. attribute:: args :type: tuple Arguments to this expression .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: Boolean(boolval=None) Wrapper for the `homonymous `__ parser node. .. attribute:: boolval :type: bool .. class:: BooleanTest(arg=None, booltesttype=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: booltesttype :type: BoolTestType Test type .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CTECycleClause(cycle_col_list=None, cycle_mark_column=None, cycle_mark_value=None, cycle_mark_default=None, cycle_path_column=None, location=None, cycle_mark_typmod=None) Wrapper for the `homonymous `__ parser node. .. attribute:: cycle_col_list :type: tuple .. attribute:: cycle_mark_column :type: str .. attribute:: cycle_mark_value :type: Node .. attribute:: cycle_mark_default :type: Node .. attribute:: cycle_path_column :type: str .. attribute:: location :type: ParseLoc .. attribute:: cycle_mark_typmod :type: int .. class:: CTESearchClause(search_col_list=None, search_breadth_first=None, search_seq_column=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: search_col_list :type: tuple .. attribute:: search_breadth_first :type: bool .. attribute:: search_seq_column :type: str .. attribute:: location :type: ParseLoc .. class:: CallContext(atomic=None) Wrapper for the `homonymous `__ parser node. .. attribute:: atomic :type: bool .. class:: CallStmt(funccall=None, funcexpr=None, outargs=None) Wrapper for the `homonymous `__ parser node. .. attribute:: funccall :type: FuncCall* .. attribute:: funcexpr :type: FuncExpr* .. attribute:: outargs :type: tuple .. class:: CaseExpr(arg=None, args=None, defresult=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Implicit equality comparison argument .. attribute:: args :type: tuple The arguments (list of WHEN clauses) .. attribute:: defresult :type: Expr* The default result (ELSE clause) .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CaseTestExpr(typeMod=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeMod :type: int32 .. class:: CaseWhen(expr=None, result=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: Expr* Condition expression .. attribute:: result :type: Expr* Substitution result .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CheckPointStmt() Wrapper for the `homonymous `__ parser node. .. class:: ClosePortalStmt(portalname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: portalname :type: str Name of the portal (cursor) .. class:: ClusterStmt(relation=None, indexname=None, params=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation being indexed, or NULL if all .. attribute:: indexname :type: str Original index defined .. attribute:: params :type: tuple List of DefElem nodes .. class:: CoalesceExpr(args=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: args :type: tuple .. attribute:: location :type: ParseLoc .. class:: CoerceToDomain(arg=None, resulttypmod=None, coercionformat=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: resulttypmod :type: int32 .. attribute:: coercionformat :type: CoercionForm .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CoerceToDomainValue(typeMod=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeMod :type: int32 .. attribute:: location :type: ParseLoc .. class:: CoerceViaIO(arg=None, coerceformat=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: coerceformat :type: CoercionForm .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CollateClause(arg=None, collname=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Node Input expression .. attribute:: collname :type: tuple Possibly-qualified collation name .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CollateExpr(arg=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: ColumnDef(colname=None, typeName=None, compression=None, inhcount=None, is_local=None, is_not_null=None, is_from_type=None, storage=None, storage_name=None, raw_default=None, cooked_default=None, identity=None, identitySequence=None, generated=None, collClause=None, constraints=None, fdwoptions=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: colname :type: str Name of column .. attribute:: typeName :type: TypeName* Type of column .. attribute:: compression :type: str Compression method for column .. attribute:: inhcount :type: int Number of times column is inherited .. attribute:: is_local :type: bool Column has local (non-inherited) def'n .. attribute:: is_not_null :type: bool NOT NULL constraint specified? .. attribute:: is_from_type :type: bool Column definition came from table type .. attribute:: storage :type: str Attstorage setting, or 0 for default .. attribute:: storage_name :type: str Attstorage setting name or NULL for default .. attribute:: raw_default :type: Node Default value (untransformed parse tree) .. attribute:: cooked_default :type: Node Default value (transformed expr tree) .. attribute:: identity :type: str Attidentity setting .. attribute:: identitySequence :type: RangeVar* To store identity sequence name for ALTER TABLE ... ADD COLUMN .. attribute:: generated :type: str Attgenerated setting .. attribute:: collClause :type: CollateClause* Untransformed COLLATE spec, if any .. attribute:: constraints :type: tuple Other constraints on column .. attribute:: fdwoptions :type: tuple Per-column FDW options .. attribute:: location :type: ParseLoc Parse location, or -1 if none/unknown .. class:: ColumnRef(fields=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: fields :type: tuple Field names (String nodes) or A_Star .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CommentStmt(objtype=None, object=None, comment=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objtype :type: ObjectType Object's type .. attribute:: object :type: Node Qualified name of the object .. attribute:: comment :type: str Comment to insert, or NULL to remove .. class:: CommonTableExpr(ctename=None, aliascolnames=None, ctematerialized=None, ctequery=None, search_clause=None, cycle_clause=None, location=None, cterecursive=None, cterefcount=None, ctecolnames=None, ctecoltypes=None, ctecoltypmods=None, ctecolcollations=None) Wrapper for the `homonymous `__ parser node. .. attribute:: ctename :type: str .. attribute:: aliascolnames :type: tuple .. attribute:: ctematerialized :type: CTEMaterialize Is this an optimization fence? .. attribute:: ctequery :type: Node The CTE's subquery .. attribute:: search_clause :type: CTESearchClause* .. attribute:: cycle_clause :type: CTECycleClause* .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. attribute:: cterecursive :type: bool .. attribute:: cterefcount :type: int .. attribute:: ctecolnames :type: tuple .. attribute:: ctecoltypes :type: tuple .. attribute:: ctecoltypmods :type: tuple .. attribute:: ctecolcollations :type: tuple .. class:: CompositeTypeStmt(typevar=None, coldeflist=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typevar :type: RangeVar* The composite type to be created .. attribute:: coldeflist :type: tuple List of ColumnDef nodes .. class:: Constraint(contype=None, conname=None, deferrable=None, initdeferred=None, skip_validation=None, initially_valid=None, is_no_inherit=None, raw_expr=None, cooked_expr=None, generated_when=None, inhcount=None, nulls_not_distinct=None, keys=None, including=None, exclusions=None, options=None, indexname=None, indexspace=None, reset_default_tblspc=None, access_method=None, where_clause=None, pktable=None, fk_attrs=None, pk_attrs=None, fk_matchtype=None, fk_upd_action=None, fk_del_action=None, fk_del_set_cols=None, old_conpfeqop=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: contype :type: ConstrType .. attribute:: conname :type: str Constraint name, or NULL if unnamed .. attribute:: deferrable :type: bool DEFERRABLE? .. attribute:: initdeferred :type: bool INITIALLY DEFERRED? .. attribute:: skip_validation :type: bool Skip validation of existing rows? .. attribute:: initially_valid :type: bool Mark the new constraint as valid? .. attribute:: is_no_inherit :type: bool Is constraint non-inheritable? .. attribute:: raw_expr :type: Node CHECK or DEFAULT expression, as untransformed parse tree .. attribute:: cooked_expr :type: str CHECK or DEFAULT expression, as nodeToString representation .. attribute:: generated_when :type: str ALWAYS or BY DEFAULT .. attribute:: inhcount :type: int Initial inheritance count to apply, for "raw" NOT NULL constraints .. attribute:: nulls_not_distinct :type: bool Null treatment for UNIQUE constraints .. attribute:: keys :type: tuple String nodes naming referenced key column(s); for UNIQUE/PK/NOT NULL .. attribute:: including :type: tuple String nodes naming referenced nonkey column(s); for UNIQUE/PK .. attribute:: exclusions :type: tuple List of (IndexElem, operator name) pairs; for exclusion constraints .. attribute:: options :type: tuple Options from WITH clause .. attribute:: indexname :type: str Existing index to use; otherwise NULL .. attribute:: indexspace :type: str Index tablespace; NULL for default .. attribute:: reset_default_tblspc :type: bool Reset default_tablespace prior to creating the index .. attribute:: access_method :type: str Index access method; NULL for default .. attribute:: where_clause :type: Node Partial index predicate .. attribute:: pktable :type: RangeVar* Primary key table .. attribute:: fk_attrs :type: tuple Attributes of foreign key .. attribute:: pk_attrs :type: tuple Corresponding attrs in PK table .. attribute:: fk_matchtype :type: str FULL, PARTIAL, SIMPLE .. attribute:: fk_upd_action :type: str ON UPDATE action .. attribute:: fk_del_action :type: str ON DELETE action .. attribute:: fk_del_set_cols :type: tuple ON DELETE SET NULL/DEFAULT (col1, col2) .. attribute:: old_conpfeqop :type: tuple Pg_constraint.conpfeqop of my former self .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: ConstraintsSetStmt(constraints=None, deferred=None) Wrapper for the `homonymous `__ parser node. .. attribute:: constraints :type: tuple List of names as RangeVars .. attribute:: deferred :type: bool .. class:: ConvertRowtypeExpr(arg=None, convertformat=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: convertformat :type: CoercionForm .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: CopyStmt(relation=None, query=None, attlist=None, is_from=None, is_program=None, filename=None, options=None, whereClause=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* The relation to copy .. attribute:: query :type: Node The query (SELECT or DML statement with RETURNING) to copy, as a raw parse tree .. attribute:: attlist :type: tuple List of column names (as Strings), or NIL for all columns .. attribute:: is_from :type: bool TO or FROM .. attribute:: is_program :type: bool Is 'filename' a program to popen? .. attribute:: filename :type: str Filename, or NULL for STDIN/STDOUT .. attribute:: options :type: tuple List of DefElem nodes .. attribute:: whereClause :type: Node WHERE condition (or NULL) .. class:: CreateAmStmt(amname=None, handler_name=None, amtype=None) Wrapper for the `homonymous `__ parser node. .. attribute:: amname :type: str Access method name .. attribute:: handler_name :type: tuple Handler function name .. attribute:: amtype :type: str Type of access method .. class:: CreateCastStmt(sourcetype=None, targettype=None, func=None, context=None, inout=None) Wrapper for the `homonymous `__ parser node. .. attribute:: sourcetype :type: TypeName* .. attribute:: targettype :type: TypeName* .. attribute:: func :type: ObjectWithArgs* .. attribute:: context :type: CoercionContext .. attribute:: inout :type: bool .. class:: CreateConversionStmt(conversion_name=None, for_encoding_name=None, to_encoding_name=None, func_name=None, def_=None) Wrapper for the `homonymous `__ parser node. .. attribute:: conversion_name :type: tuple Name of the conversion .. attribute:: for_encoding_name :type: str Source encoding name .. attribute:: to_encoding_name :type: str Destination encoding name .. attribute:: func_name :type: tuple Qualified conversion function name .. attribute:: def_ :type: bool Is this a default conversion? .. class:: CreateDomainStmt(domainname=None, typeName=None, collClause=None, constraints=None) Wrapper for the `homonymous `__ parser node. .. attribute:: domainname :type: tuple Qualified name (list of String) .. attribute:: typeName :type: TypeName* The base type .. attribute:: collClause :type: CollateClause* Untransformed COLLATE spec, if any .. attribute:: constraints :type: tuple Constraints (list of Constraint nodes) .. class:: CreateEnumStmt(typeName=None, vals=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeName :type: tuple Qualified name (list of String) .. attribute:: vals :type: tuple Enum values (list of String) .. class:: CreateEventTrigStmt(trigname=None, eventname=None, whenclause=None, funcname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: trigname :type: str TRIGGER's name .. attribute:: eventname :type: str Event's identifier .. attribute:: whenclause :type: tuple List of DefElems indicating filtering .. attribute:: funcname :type: tuple Qual. name of function to call .. class:: CreateExtensionStmt(extname=None, if_not_exists=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: extname :type: str .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. attribute:: options :type: tuple List of DefElem nodes .. class:: CreateFdwStmt(fdwname=None, func_options=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: fdwname :type: str Foreign-data wrapper name .. attribute:: func_options :type: tuple HANDLER/VALIDATOR options .. attribute:: options :type: tuple Generic options to FDW .. class:: CreateForeignServerStmt(servername=None, servertype=None, version=None, fdwname=None, if_not_exists=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: servername :type: str Server name .. attribute:: servertype :type: str Optional server type .. attribute:: version :type: str Optional server version .. attribute:: fdwname :type: str FDW name .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. attribute:: options :type: tuple Generic options to server .. class:: CreateForeignTableStmt(base=None, servername=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: base :type: CreateStmt .. attribute:: servername :type: str .. attribute:: options :type: tuple .. class:: CreateFunctionStmt(is_procedure=None, replace=None, funcname=None, parameters=None, returnType=None, options=None, sql_body=None) Wrapper for the `homonymous `__ parser node. .. attribute:: is_procedure :type: bool It's really CREATE PROCEDURE .. attribute:: replace :type: bool T => replace if already exists .. attribute:: funcname :type: tuple Qualified name of function to create .. attribute:: parameters :type: tuple A list of FunctionParameter .. attribute:: returnType :type: TypeName* The return type .. attribute:: options :type: tuple A list of DefElem .. attribute:: sql_body :type: Node .. class:: CreateOpClassItem(itemtype=None, name=None, number=None, order_family=None, class_args=None, storedtype=None) Wrapper for the `homonymous `__ parser node. .. attribute:: itemtype :type: int See codes above .. attribute:: name :type: ObjectWithArgs* Operator or function name and args .. attribute:: number :type: int Strategy num or support proc num .. attribute:: order_family :type: tuple Only used for ordering operators .. attribute:: class_args :type: tuple Amproclefttype/amprocrighttype or amoplefttype/amoprighttype .. attribute:: storedtype :type: TypeName* Datatype stored in index .. class:: CreateOpClassStmt(opclassname=None, opfamilyname=None, amname=None, datatype=None, items=None, isDefault=None) Wrapper for the `homonymous `__ parser node. .. attribute:: opclassname :type: tuple Qualified name (list of String) .. attribute:: opfamilyname :type: tuple Qualified name (ditto); NIL if omitted .. attribute:: amname :type: str Name of index AM opclass is for .. attribute:: datatype :type: TypeName* Datatype of indexed column .. attribute:: items :type: tuple List of CreateOpClassItem nodes .. attribute:: isDefault :type: bool Should be marked as default for type? .. class:: CreateOpFamilyStmt(opfamilyname=None, amname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: opfamilyname :type: tuple Qualified name (list of String) .. attribute:: amname :type: str Name of index AM opfamily is for .. class:: CreatePLangStmt(replace=None, plname=None, plhandler=None, plinline=None, plvalidator=None, pltrusted=None) Wrapper for the `homonymous `__ parser node. .. attribute:: replace :type: bool T => replace if already exists .. attribute:: plname :type: str PL name .. attribute:: plhandler :type: tuple PL call handler function (qual. name) .. attribute:: plinline :type: tuple Optional inline function (qual. name) .. attribute:: plvalidator :type: tuple Optional validator function (qual. name) .. attribute:: pltrusted :type: bool PL is trusted .. class:: CreatePolicyStmt(policy_name=None, table=None, cmd_name=None, permissive=None, roles=None, qual=None, with_check=None) Wrapper for the `homonymous `__ parser node. .. attribute:: policy_name :type: str Policy's name .. attribute:: table :type: RangeVar* The table name the policy applies to .. attribute:: cmd_name :type: str The command name the policy applies to .. attribute:: permissive :type: bool Restrictive or permissive policy .. attribute:: roles :type: tuple The roles associated with the policy .. attribute:: qual :type: Node The policy's condition .. attribute:: with_check :type: Node The policy's WITH CHECK condition. .. class:: CreatePublicationStmt(pubname=None, options=None, pubobjects=None, for_all_tables=None) Wrapper for the `homonymous `__ parser node. .. attribute:: pubname :type: str Name of the publication .. attribute:: options :type: tuple List of DefElem nodes .. attribute:: pubobjects :type: tuple Optional list of publication objects .. attribute:: for_all_tables :type: bool Special publication for all tables in db .. class:: CreateRangeStmt(typeName=None, params=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeName :type: tuple Qualified name (list of String) .. attribute:: params :type: tuple Range parameters (list of DefElem) .. class:: CreateRoleStmt(stmt_type=None, role=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: stmt_type :type: RoleStmtType ROLE/USER/GROUP .. attribute:: role :type: str Role name .. attribute:: options :type: tuple List of DefElem nodes .. class:: CreateSchemaStmt(schemaname=None, authrole=None, schemaElts=None, if_not_exists=None) Wrapper for the `homonymous `__ parser node. .. attribute:: schemaname :type: str The name of the schema to create .. attribute:: authrole :type: RoleSpec* The owner of the created schema .. attribute:: schemaElts :type: tuple Schema components (list of parsenodes) .. attribute:: if_not_exists :type: bool Just do nothing if schema already exists? .. class:: CreateSeqStmt(sequence=None, options=None, for_identity=None, if_not_exists=None) Wrapper for the `homonymous `__ parser node. .. attribute:: sequence :type: RangeVar* The sequence to create .. attribute:: options :type: tuple .. attribute:: for_identity :type: bool .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. class:: CreateStatsStmt(defnames=None, stat_types=None, exprs=None, relations=None, stxcomment=None, transformed=None, if_not_exists=None) Wrapper for the `homonymous `__ parser node. .. attribute:: defnames :type: tuple Qualified name (list of String) .. attribute:: stat_types :type: tuple Stat types (list of String) .. attribute:: exprs :type: tuple Expressions to build statistics on .. attribute:: relations :type: tuple Rels to build stats on (list of RangeVar) .. attribute:: stxcomment :type: str Comment to apply to stats, or NULL .. attribute:: transformed :type: bool True when transformStatsStmt is finished .. attribute:: if_not_exists :type: bool Do nothing if stats name already exists .. class:: CreateStmt(relation=None, tableElts=None, inhRelations=None, partbound=None, partspec=None, ofTypename=None, constraints=None, options=None, oncommit=None, tablespacename=None, accessMethod=None, if_not_exists=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation to create .. attribute:: tableElts :type: tuple Column definitions (list of ColumnDef) .. attribute:: inhRelations :type: tuple Relations to inherit from (list of RangeVar) .. attribute:: partbound :type: PartitionBoundSpec* FOR VALUES clause .. attribute:: partspec :type: PartitionSpec* PARTITION BY clause .. attribute:: ofTypename :type: TypeName* OF typename .. attribute:: constraints :type: tuple Constraints (list of Constraint nodes) .. attribute:: options :type: tuple Options from WITH clause .. attribute:: oncommit :type: OnCommitAction What do we do at COMMIT? .. attribute:: tablespacename :type: str Table space to use, or NULL .. attribute:: accessMethod :type: str Table access method .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. class:: CreateSubscriptionStmt(subname=None, conninfo=None, publication=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subname :type: str Name of the subscription .. attribute:: conninfo :type: str Connection string to publisher .. attribute:: publication :type: tuple One or more publication to subscribe to .. attribute:: options :type: tuple List of DefElem nodes .. class:: CreateTableAsStmt(query=None, into=None, objtype=None, is_select_into=None, if_not_exists=None) Wrapper for the `homonymous `__ parser node. .. attribute:: query :type: Node The query (see comments above) .. attribute:: into :type: IntoClause* Destination table .. attribute:: objtype :type: ObjectType OBJECT_TABLE or OBJECT_MATVIEW .. attribute:: is_select_into :type: bool It was written as SELECT INTO .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. class:: CreateTableSpaceStmt(tablespacename=None, owner=None, location=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: tablespacename :type: str .. attribute:: owner :type: RoleSpec* .. attribute:: location :type: str .. attribute:: options :type: tuple .. class:: CreateTransformStmt(replace=None, type_name=None, lang=None, fromsql=None, tosql=None) Wrapper for the `homonymous `__ parser node. .. attribute:: replace :type: bool .. attribute:: type_name :type: TypeName* .. attribute:: lang :type: str .. attribute:: fromsql :type: ObjectWithArgs* .. attribute:: tosql :type: ObjectWithArgs* .. class:: CreateTrigStmt(replace=None, isconstraint=None, trigname=None, relation=None, funcname=None, args=None, row=None, timing=None, events=None, columns=None, whenClause=None, transitionRels=None, deferrable=None, initdeferred=None, constrrel=None) Wrapper for the `homonymous `__ parser node. .. attribute:: replace :type: bool Replace trigger if already exists .. attribute:: isconstraint :type: bool This is a constraint trigger .. attribute:: trigname :type: str TRIGGER's name .. attribute:: relation :type: RangeVar* Relation trigger is on .. attribute:: funcname :type: tuple Qual. name of function to call .. attribute:: args :type: tuple List of String or NIL .. attribute:: row :type: bool ROW/STATEMENT .. attribute:: timing :type: int16 BEFORE, AFTER, or INSTEAD .. attribute:: events :type: int16 "OR" of INSERT/UPDATE/DELETE/TRUNCATE .. attribute:: columns :type: tuple Column names, or NIL for all columns .. attribute:: whenClause :type: Node Qual expression, or NULL if none .. attribute:: transitionRels :type: tuple TriggerTransition nodes, or NIL if none .. attribute:: deferrable :type: bool [NOT] DEFERRABLE .. attribute:: initdeferred :type: bool INITIALLY {DEFERRED|IMMEDIATE} .. attribute:: constrrel :type: RangeVar* Opposite relation, if RI trigger .. class:: CreateUserMappingStmt(user=None, servername=None, if_not_exists=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: user :type: RoleSpec* User role .. attribute:: servername :type: str Server name .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. attribute:: options :type: tuple Generic options to server .. class:: CreatedbStmt(dbname=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: dbname :type: str Name of database to create .. attribute:: options :type: tuple List of DefElem nodes .. class:: CurrentOfExpr(cvarno=None, cursor_name=None, cursor_param=None) Wrapper for the `homonymous `__ parser node. .. attribute:: cvarno :type: Index RT index of target relation .. attribute:: cursor_name :type: str Name of referenced cursor, or NULL .. attribute:: cursor_param :type: int Refcursor parameter number, or 0 .. class:: DeallocateStmt(name=None, isall=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str .. attribute:: isall :type: bool .. attribute:: location :type: ParseLoc .. class:: DeclareCursorStmt(portalname=None, options=None, query=None) Wrapper for the `homonymous `__ parser node. .. attribute:: portalname :type: str Name of the portal (cursor) .. attribute:: options :type: int Bitmask of options (see above) .. attribute:: query :type: Node The query (see comments above) .. class:: DefElem(defnamespace=None, defname=None, arg=None, defaction=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: defnamespace :type: str NULL if unqualified name .. attribute:: defname :type: str .. attribute:: arg :type: Node Typically Integer, Float, String, or TypeName .. attribute:: defaction :type: DefElemAction Unspecified action, or SET/ADD/DROP .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: DefineStmt(kind=None, oldstyle=None, defnames=None, args=None, definition=None, if_not_exists=None, replace=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: ObjectType Aggregate, operator, type .. attribute:: oldstyle :type: bool Hack to signal old CREATE AGG syntax .. attribute:: defnames :type: tuple Qualified name (list of String) .. attribute:: args :type: tuple A list of TypeName (if needed) .. attribute:: definition :type: tuple A list of DefElem .. attribute:: if_not_exists :type: bool Just do nothing if it already exists? .. attribute:: replace :type: bool Replace if already exists? .. class:: DeleteStmt(relation=None, usingClause=None, whereClause=None, returningList=None, withClause=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation to delete from .. attribute:: usingClause :type: tuple Optional using clause for more tables .. attribute:: whereClause :type: Node Qualifications .. attribute:: returningList :type: tuple List of expressions to return .. attribute:: withClause :type: WithClause* WITH clause .. class:: DiscardStmt(target=None) Wrapper for the `homonymous `__ parser node. .. attribute:: target :type: DiscardMode .. class:: DoStmt(args=None) Wrapper for the `homonymous `__ parser node. .. attribute:: args :type: tuple List of DefElem nodes .. class:: DropOwnedStmt(roles=None, behavior=None) Wrapper for the `homonymous `__ parser node. .. attribute:: roles :type: tuple .. attribute:: behavior :type: DropBehavior .. class:: DropRoleStmt(roles=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: roles :type: tuple List of roles to remove .. attribute:: missing_ok :type: bool Skip error if a role is missing? .. class:: DropStmt(objects=None, removeType=None, behavior=None, missing_ok=None, concurrent=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objects :type: tuple List of names .. attribute:: removeType :type: ObjectType Object type .. attribute:: behavior :type: DropBehavior RESTRICT or CASCADE behavior .. attribute:: missing_ok :type: bool Skip error if object is missing? .. attribute:: concurrent :type: bool Drop index concurrently? .. class:: DropSubscriptionStmt(subname=None, missing_ok=None, behavior=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subname :type: str Name of the subscription .. attribute:: missing_ok :type: bool Skip error if missing? .. attribute:: behavior :type: DropBehavior RESTRICT or CASCADE behavior .. class:: DropTableSpaceStmt(tablespacename=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: tablespacename :type: str .. attribute:: missing_ok :type: bool Skip error if missing? .. class:: DropUserMappingStmt(user=None, servername=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: user :type: RoleSpec* User role .. attribute:: servername :type: str Server name .. attribute:: missing_ok :type: bool Ignore missing mappings .. class:: DropdbStmt(dbname=None, missing_ok=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: dbname :type: str Database to drop .. attribute:: missing_ok :type: bool Skip error if db is missing? .. attribute:: options :type: tuple Currently only FORCE is supported .. class:: ExecuteStmt(name=None, params=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str The name of the plan to execute .. attribute:: params :type: tuple Values to assign to parameters .. class:: ExplainStmt(query=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: query :type: Node The query (see comments above) .. attribute:: options :type: tuple List of DefElem nodes .. class:: FetchStmt(direction=None, howMany=None, portalname=None, ismove=None) Wrapper for the `homonymous `__ parser node. .. attribute:: direction :type: FetchDirection .. attribute:: howMany :type: long Number of rows, or position argument .. attribute:: portalname :type: str Name of portal (cursor) .. attribute:: ismove :type: bool True if MOVE .. class:: FieldSelect(arg=None, fieldnum=None, resulttypmod=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: fieldnum :type: AttrNumber Attribute number of field to extract .. attribute:: resulttypmod :type: int32 .. class:: FieldStore(arg=None, newvals=None, fieldnums=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input tuple value .. attribute:: newvals :type: tuple New value(s) for field(s) .. attribute:: fieldnums :type: tuple .. class:: Float(fval=None) Wrapper for the `homonymous `__ parser node. .. attribute:: fval :type: str .. class:: FromExpr(fromlist=None, quals=None) Wrapper for the `homonymous `__ parser node. .. attribute:: fromlist :type: tuple List of join subtrees .. attribute:: quals :type: Node Qualifiers on join, if any .. class:: FuncCall(funcname=None, args=None, agg_order=None, agg_filter=None, over=None, agg_within_group=None, agg_star=None, agg_distinct=None, func_variadic=None, funcformat=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: funcname :type: tuple Qualified name of function .. attribute:: args :type: tuple The arguments (list of exprs) .. attribute:: agg_order :type: tuple ORDER BY (list of SortBy) .. attribute:: agg_filter :type: Node FILTER clause, if any .. attribute:: over :type: WindowDef* OVER clause, if any .. attribute:: agg_within_group :type: bool ORDER BY appeared in WITHIN GROUP .. attribute:: agg_star :type: bool Argument was really '*' .. attribute:: agg_distinct :type: bool Arguments were labeled DISTINCT .. attribute:: func_variadic :type: bool Last argument was labeled VARIADIC .. attribute:: funcformat :type: CoercionForm How to display this node .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: FuncExpr(funcretset=None, funcvariadic=None, funcformat=None, args=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: funcretset :type: bool .. attribute:: funcvariadic :type: bool .. attribute:: funcformat :type: CoercionForm .. attribute:: args :type: tuple .. attribute:: location :type: ParseLoc .. class:: FunctionParameter(name=None, argType=None, mode=None, defexpr=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Parameter name, or NULL if not given .. attribute:: argType :type: TypeName* TypeName for parameter type .. attribute:: mode :type: FunctionParameterMode IN/OUT/etc .. attribute:: defexpr :type: Node Raw default expr, or NULL if not given .. class:: GrantRoleStmt(granted_roles=None, grantee_roles=None, is_grant=None, opt=None, grantor=None, behavior=None) Wrapper for the `homonymous `__ parser node. .. attribute:: granted_roles :type: tuple List of roles to be granted/revoked .. attribute:: grantee_roles :type: tuple List of member roles to add/delete .. attribute:: is_grant :type: bool True = GRANT, false = REVOKE .. attribute:: opt :type: tuple Options e.g. WITH GRANT OPTION .. attribute:: grantor :type: RoleSpec* Set grantor to other than current role .. attribute:: behavior :type: DropBehavior Drop behavior (for REVOKE) .. class:: GrantStmt(is_grant=None, targtype=None, objtype=None, objects=None, privileges=None, grantees=None, grant_option=None, grantor=None, behavior=None) Wrapper for the `homonymous `__ parser node. .. attribute:: is_grant :type: bool True = GRANT, false = REVOKE .. attribute:: targtype :type: GrantTargetType Type of the grant target .. attribute:: objtype :type: ObjectType Kind of object being operated on .. attribute:: objects :type: tuple List of RangeVar nodes, ObjectWithArgs nodes, or plain names (as String values) .. attribute:: privileges :type: tuple List of AccessPriv nodes .. attribute:: grantees :type: tuple List of RoleSpec nodes .. attribute:: grant_option :type: bool Grant or revoke grant option .. attribute:: grantor :type: RoleSpec* .. attribute:: behavior :type: DropBehavior Drop behavior (for REVOKE) .. class:: GroupingFunc(args=None, refs=None, agglevelsup=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: args :type: tuple .. attribute:: refs :type: tuple .. attribute:: agglevelsup :type: Index .. attribute:: location :type: ParseLoc .. class:: GroupingSet(kind=None, content=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: GroupingSetKind .. attribute:: content :type: tuple .. attribute:: location :type: ParseLoc .. class:: ImportForeignSchemaStmt(server_name=None, remote_schema=None, local_schema=None, list_type=None, table_list=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: server_name :type: str FDW server name .. attribute:: remote_schema :type: str Remote schema name to query .. attribute:: local_schema :type: str Local schema to create objects in .. attribute:: list_type :type: ImportForeignSchemaType Type of table list .. attribute:: table_list :type: tuple List of RangeVar .. attribute:: options :type: tuple List of options to pass to FDW .. class:: IndexElem(name=None, expr=None, indexcolname=None, collation=None, opclass=None, opclassopts=None, ordering=None, nulls_ordering=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Name of attribute to index, or NULL .. attribute:: expr :type: Node Expression to index, or NULL .. attribute:: indexcolname :type: str Name for index column; NULL = default .. attribute:: collation :type: tuple Name of collation; NIL = default .. attribute:: opclass :type: tuple Name of desired opclass; NIL = default .. attribute:: opclassopts :type: tuple Opclass-specific options, or NIL .. attribute:: ordering :type: SortByDir ASC/DESC/default .. attribute:: nulls_ordering :type: SortByNulls FIRST/LAST/default .. class:: IndexStmt(idxname=None, relation=None, accessMethod=None, tableSpace=None, indexParams=None, indexIncludingParams=None, options=None, whereClause=None, excludeOpNames=None, idxcomment=None, oldNumber=None, oldCreateSubid=None, oldFirstRelfilelocatorSubid=None, unique=None, nulls_not_distinct=None, primary=None, isconstraint=None, deferrable=None, initdeferred=None, transformed=None, concurrent=None, if_not_exists=None, reset_default_tblspc=None) Wrapper for the `homonymous `__ parser node. .. attribute:: idxname :type: str Name of new index, or NULL for default .. attribute:: relation :type: RangeVar* Relation to build index on .. attribute:: accessMethod :type: str Name of access method (eg. btree) .. attribute:: tableSpace :type: str Tablespace, or NULL for default .. attribute:: indexParams :type: tuple Columns to index: a list of IndexElem .. attribute:: indexIncludingParams :type: tuple Additional columns to index: a list of IndexElem .. attribute:: options :type: tuple WITH clause options: a list of DefElem .. attribute:: whereClause :type: Node Qualification (partial-index predicate) .. attribute:: excludeOpNames :type: tuple Exclusion operator names, or NIL if none .. attribute:: idxcomment :type: str Comment to apply to index, or NULL .. attribute:: oldNumber :type: RelFileNumber Relfilenumber of existing storage, if any .. attribute:: oldCreateSubid :type: SubTransactionId Rd_createSubid of oldNumber .. attribute:: oldFirstRelfilelocatorSubid :type: SubTransactionId Rd_firstRelfilelocatorSubid of oldNumber .. attribute:: unique :type: bool Is index unique? .. attribute:: nulls_not_distinct :type: bool Null treatment for UNIQUE constraints .. attribute:: primary :type: bool Is index a primary key? .. attribute:: isconstraint :type: bool Is it for a pkey/unique constraint? .. attribute:: deferrable :type: bool Is the constraint DEFERRABLE? .. attribute:: initdeferred :type: bool Is the constraint INITIALLY DEFERRED? .. attribute:: transformed :type: bool True when transformIndexStmt is finished .. attribute:: concurrent :type: bool Should this be a concurrent index build? .. attribute:: if_not_exists :type: bool Just do nothing if index already exists? .. attribute:: reset_default_tblspc :type: bool Reset default_tablespace prior to executing .. class:: InferClause(indexElems=None, whereClause=None, conname=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: indexElems :type: tuple IndexElems to infer unique index .. attribute:: whereClause :type: Node Qualification (partial-index predicate) .. attribute:: conname :type: str Constraint name, or NULL if unnamed .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: InferenceElem(expr=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: Node Expression to infer from, or NULL .. class:: InlineCodeBlock(source_text=None, langIsTrusted=None, atomic=None) Wrapper for the `homonymous `__ parser node. .. attribute:: source_text :type: str Source text of anonymous code block .. attribute:: langIsTrusted :type: bool Trusted property of the language .. attribute:: atomic :type: bool Atomic execution context .. class:: InsertStmt(relation=None, cols=None, selectStmt=None, onConflictClause=None, returningList=None, withClause=None, override=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation to insert into .. attribute:: cols :type: tuple Optional: names of the target columns .. attribute:: selectStmt :type: Node The source SELECT/VALUES, or NULL .. attribute:: onConflictClause :type: OnConflictClause* ON CONFLICT clause .. attribute:: returningList :type: tuple List of expressions to return .. attribute:: withClause :type: WithClause* WITH clause .. attribute:: override :type: OverridingKind OVERRIDING clause .. class:: Integer(ival=None) Wrapper for the `homonymous `__ parser node. .. attribute:: ival :type: long .. class:: IntoClause(rel=None, colNames=None, accessMethod=None, options=None, onCommit=None, tableSpaceName=None, viewQuery=None, skipData=None) Wrapper for the `homonymous `__ parser node. .. attribute:: rel :type: RangeVar* Target relation name .. attribute:: colNames :type: tuple Column names to assign, or NIL .. attribute:: accessMethod :type: str Table access method .. attribute:: options :type: tuple Options from WITH clause .. attribute:: onCommit :type: OnCommitAction What do we do at COMMIT? .. attribute:: tableSpaceName :type: str Table space to use, or NULL .. attribute:: viewQuery :type: Node .. attribute:: skipData :type: bool True for WITH NO DATA .. class:: JoinExpr(jointype=None, isNatural=None, larg=None, rarg=None, usingClause=None, join_using_alias=None, quals=None, alias=None, rtindex=None) Wrapper for the `homonymous `__ parser node. .. attribute:: jointype :type: JoinType Type of join .. attribute:: isNatural :type: bool Natural join? Will need to shape table .. attribute:: larg :type: Node Left subtree .. attribute:: rarg :type: Node Right subtree .. attribute:: usingClause :type: tuple .. attribute:: join_using_alias :type: Alias* .. attribute:: quals :type: Node .. attribute:: alias :type: Alias* .. attribute:: rtindex :type: int .. class:: JsonAggConstructor(output=None, agg_filter=None, agg_order=None, over=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: output :type: JsonOutput* RETURNING clause, if any .. attribute:: agg_filter :type: Node FILTER clause, if any .. attribute:: agg_order :type: tuple ORDER BY clause, if any .. attribute:: over :type: WindowDef* OVER clause, if any .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonArgument(val=None, name=None) Wrapper for the `homonymous `__ parser node. .. attribute:: val :type: JsonValueExpr* Argument value expression .. attribute:: name :type: str Argument name .. class:: JsonArrayAgg(constructor=None, arg=None, absent_on_null=None) Wrapper for the `homonymous `__ parser node. .. attribute:: constructor :type: JsonAggConstructor* Common fields .. attribute:: arg :type: JsonValueExpr* Array element expression .. attribute:: absent_on_null :type: bool Skip NULL elements? .. class:: JsonArrayConstructor(exprs=None, output=None, absent_on_null=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: exprs :type: tuple List of JsonValueExpr elements .. attribute:: output :type: JsonOutput* RETURNING clause, if specified .. attribute:: absent_on_null :type: bool Skip NULL elements? .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonArrayQueryConstructor(query=None, output=None, format=None, absent_on_null=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: query :type: Node Subquery .. attribute:: output :type: JsonOutput* RETURNING clause, if specified .. attribute:: format :type: JsonFormat* FORMAT clause for subquery, if specified .. attribute:: absent_on_null :type: bool Skip NULL elements? .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonBehavior(btype=None, expr=None, coerce=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: btype :type: JsonBehaviorType .. attribute:: expr :type: Node .. attribute:: coerce :type: bool .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonConstructorExpr(type=None, args=None, func=None, coercion=None, returning=None, absent_on_null=None, unique=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: type :type: JsonConstructorType Constructor type .. attribute:: args :type: tuple .. attribute:: func :type: Expr* Underlying json[b]_xxx() function call .. attribute:: coercion :type: Expr* Coercion to RETURNING type .. attribute:: returning :type: JsonReturning* RETURNING clause .. attribute:: absent_on_null :type: bool ABSENT ON NULL? .. attribute:: unique :type: bool WITH UNIQUE KEYS? (JSON_OBJECT[AGG] only) .. attribute:: location :type: ParseLoc .. class:: JsonExpr(op=None, column_name=None, formatted_expr=None, format=None, path_spec=None, returning=None, passing_names=None, passing_values=None, on_empty=None, on_error=None, use_io_coercion=None, use_json_coercion=None, wrapper=None, omit_quotes=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: op :type: JsonExprOp .. attribute:: column_name :type: str JSON_TABLE() column name or NULL if this is not for a JSON_TABLE() .. attribute:: formatted_expr :type: Node .. attribute:: format :type: JsonFormat* .. attribute:: path_spec :type: Node .. attribute:: returning :type: JsonReturning* .. attribute:: passing_names :type: tuple .. attribute:: passing_values :type: tuple .. attribute:: on_empty :type: JsonBehavior* .. attribute:: on_error :type: JsonBehavior* .. attribute:: use_io_coercion :type: bool .. attribute:: use_json_coercion :type: bool .. attribute:: wrapper :type: JsonWrapper .. attribute:: omit_quotes :type: bool .. attribute:: location :type: ParseLoc .. class:: JsonFormat(format_type=None, encoding=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: format_type :type: JsonFormatType Format type .. attribute:: encoding :type: JsonEncoding JSON encoding .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonFuncExpr(op=None, column_name=None, context_item=None, pathspec=None, passing=None, output=None, on_empty=None, on_error=None, wrapper=None, quotes=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: op :type: JsonExprOp Expression type .. attribute:: column_name :type: str JSON_TABLE() column name or NULL if this is not for a JSON_TABLE() .. attribute:: context_item :type: JsonValueExpr* Context item expression .. attribute:: pathspec :type: Node JSON path specification expression .. attribute:: passing :type: tuple List of PASSING clause arguments, if any .. attribute:: output :type: JsonOutput* Output clause, if specified .. attribute:: on_empty :type: JsonBehavior* ON EMPTY behavior .. attribute:: on_error :type: JsonBehavior* ON ERROR behavior .. attribute:: wrapper :type: JsonWrapper Array wrapper behavior (JSON_QUERY only) .. attribute:: quotes :type: JsonQuotes Omit or keep quotes? (JSON_QUERY only) .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonIsPredicate(expr=None, format=None, item_type=None, unique_keys=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: Node Subject expression .. attribute:: format :type: JsonFormat* FORMAT clause, if specified .. attribute:: item_type :type: JsonValueType JSON item type .. attribute:: unique_keys :type: bool Check key uniqueness? .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonKeyValue(key=None, value=None) Wrapper for the `homonymous `__ parser node. .. attribute:: key :type: Expr* Key expression .. attribute:: value :type: JsonValueExpr* JSON value expression .. class:: JsonObjectAgg(constructor=None, arg=None, absent_on_null=None, unique=None) Wrapper for the `homonymous `__ parser node. .. attribute:: constructor :type: JsonAggConstructor* Common fields .. attribute:: arg :type: JsonKeyValue* Object key-value pair .. attribute:: absent_on_null :type: bool Skip NULL values? .. attribute:: unique :type: bool Check key uniqueness? .. class:: JsonObjectConstructor(exprs=None, output=None, absent_on_null=None, unique=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: exprs :type: tuple List of JsonKeyValue pairs .. attribute:: output :type: JsonOutput* RETURNING clause, if specified .. attribute:: absent_on_null :type: bool Skip NULL values? .. attribute:: unique :type: bool Check key uniqueness? .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonOutput(typeName=None, returning=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeName :type: TypeName* RETURNING type name, if specified .. attribute:: returning :type: JsonReturning* RETURNING FORMAT clause and type Oids .. class:: JsonParseExpr(expr=None, output=None, unique_keys=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: JsonValueExpr* String expression .. attribute:: output :type: JsonOutput* RETURNING clause, if specified .. attribute:: unique_keys :type: bool WITH UNIQUE KEYS? .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonReturning(format=None, typmod=None) Wrapper for the `homonymous `__ parser node. .. attribute:: format :type: JsonFormat* Output JSON format .. attribute:: typmod :type: int32 Target type modifier .. class:: JsonScalarExpr(expr=None, output=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: Expr* Scalar expression .. attribute:: output :type: JsonOutput* RETURNING clause, if specified .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonSerializeExpr(expr=None, output=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: JsonValueExpr* Json value expression .. attribute:: output :type: JsonOutput* RETURNING clause, if specified .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonTable(context_item=None, pathspec=None, passing=None, columns=None, on_error=None, alias=None, lateral=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: context_item :type: JsonValueExpr* Context item expression .. attribute:: pathspec :type: JsonTablePathSpec* JSON path specification .. attribute:: passing :type: tuple List of PASSING clause arguments, if any .. attribute:: columns :type: tuple List of JsonTableColumn .. attribute:: on_error :type: JsonBehavior* ON ERROR behavior .. attribute:: alias :type: Alias* Table alias in FROM clause .. attribute:: lateral :type: bool Does it have LATERAL prefix? .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonTableColumn(coltype=None, name=None, typeName=None, pathspec=None, format=None, wrapper=None, quotes=None, columns=None, on_empty=None, on_error=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: coltype :type: JsonTableColumnType Column type .. attribute:: name :type: str Column name .. attribute:: typeName :type: TypeName* Column type name .. attribute:: pathspec :type: JsonTablePathSpec* JSON path specification .. attribute:: format :type: JsonFormat* JSON format clause, if specified .. attribute:: wrapper :type: JsonWrapper WRAPPER behavior for formatted columns .. attribute:: quotes :type: JsonQuotes Omit or keep quotes on scalar strings? .. attribute:: columns :type: tuple Nested columns .. attribute:: on_empty :type: JsonBehavior* ON EMPTY behavior .. attribute:: on_error :type: JsonBehavior* ON ERROR behavior .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: JsonTablePathSpec(string=None, name=None, name_location=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: string :type: Node .. attribute:: name :type: str .. attribute:: name_location :type: ParseLoc .. attribute:: location :type: ParseLoc Location of 'string' .. class:: JsonValueExpr(raw_expr=None, formatted_expr=None, format=None) Wrapper for the `homonymous `__ parser node. .. attribute:: raw_expr :type: Expr* Raw expression .. attribute:: formatted_expr :type: Expr* Formatted expression .. attribute:: format :type: JsonFormat* FORMAT clause, if specified .. class:: ListenStmt(conditionname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: conditionname :type: str Condition name to listen on .. class:: LoadStmt(filename=None) Wrapper for the `homonymous `__ parser node. .. attribute:: filename :type: str File to load .. class:: LockStmt(relations=None, mode=None, nowait=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relations :type: tuple Relations to lock .. attribute:: mode :type: int Lock mode .. attribute:: nowait :type: bool No wait mode .. class:: LockingClause(lockedRels=None, strength=None, waitPolicy=None) Wrapper for the `homonymous `__ parser node. .. attribute:: lockedRels :type: tuple FOR [KEY] UPDATE/SHARE relations .. attribute:: strength :type: LockClauseStrength .. attribute:: waitPolicy :type: LockWaitPolicy NOWAIT and SKIP LOCKED .. class:: MergeAction(matchKind=None, commandType=None, override=None, qual=None, targetList=None, updateColnos=None) Wrapper for the `homonymous `__ parser node. .. attribute:: matchKind :type: MergeMatchKind MATCHED/NOT MATCHED BY SOURCE/TARGET .. attribute:: commandType :type: CmdType INSERT/UPDATE/DELETE/DO NOTHING .. attribute:: override :type: OverridingKind .. attribute:: qual :type: Node Transformed WHEN conditions .. attribute:: targetList :type: tuple The target list (of TargetEntry) .. attribute:: updateColnos :type: tuple .. class:: MergeStmt(relation=None, sourceRelation=None, joinCondition=None, mergeWhenClauses=None, returningList=None, withClause=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Target relation to merge into .. attribute:: sourceRelation :type: Node Source relation .. attribute:: joinCondition :type: Node Join condition between source and target .. attribute:: mergeWhenClauses :type: tuple List of MergeWhenClause(es) .. attribute:: returningList :type: tuple List of expressions to return .. attribute:: withClause :type: WithClause* WITH clause .. class:: MergeSupportFunc(location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: location :type: ParseLoc .. class:: MergeWhenClause(matchKind=None, commandType=None, override=None, condition=None, targetList=None, values=None) Wrapper for the `homonymous `__ parser node. .. attribute:: matchKind :type: MergeMatchKind MATCHED/NOT MATCHED BY SOURCE/TARGET .. attribute:: commandType :type: CmdType INSERT/UPDATE/DELETE/DO NOTHING .. attribute:: override :type: OverridingKind OVERRIDING clause .. attribute:: condition :type: Node WHEN conditions (raw parser) .. attribute:: targetList :type: tuple INSERT/UPDATE targetlist .. attribute:: values :type: tuple VALUES to INSERT, or NULL .. class:: MinMaxExpr(op=None, args=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: op :type: MinMaxOp .. attribute:: args :type: tuple .. attribute:: location :type: ParseLoc .. class:: MultiAssignRef(source=None, colno=None, ncolumns=None) Wrapper for the `homonymous `__ parser node. .. attribute:: source :type: Node The row-valued expression .. attribute:: colno :type: int Column number for this target (1..n) .. attribute:: ncolumns :type: int Number of targets in the construct .. class:: NamedArgExpr(arg=None, name=None, argnumber=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* .. attribute:: name :type: str .. attribute:: argnumber :type: int .. attribute:: location :type: ParseLoc .. class:: NotifyStmt(conditionname=None, payload=None) Wrapper for the `homonymous `__ parser node. .. attribute:: conditionname :type: str Condition name to notify .. attribute:: payload :type: str The payload string, or NULL if none .. class:: NullTest(arg=None, nulltesttype=None, argisrow=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: nulltesttype :type: NullTestType IS NULL, IS NOT NULL .. attribute:: argisrow :type: bool .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: ObjectWithArgs(objname=None, objargs=None, objfuncargs=None, args_unspecified=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objname :type: tuple Qualified name of function/operator .. attribute:: objargs :type: tuple List of Typename nodes (input args only) .. attribute:: objfuncargs :type: tuple List of FunctionParameter nodes .. attribute:: args_unspecified :type: bool Argument list was omitted? .. class:: OnConflictClause(action=None, infer=None, targetList=None, whereClause=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: action :type: OnConflictAction DO NOTHING or UPDATE? .. attribute:: infer :type: InferClause* Optional index inference clause .. attribute:: targetList :type: tuple The target list (of ResTarget) .. attribute:: whereClause :type: Node Qualifications .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: OnConflictExpr(action=None, arbiterElems=None, arbiterWhere=None, onConflictSet=None, onConflictWhere=None, exclRelIndex=None, exclRelTlist=None) Wrapper for the `homonymous `__ parser node. .. attribute:: action :type: OnConflictAction DO NOTHING or UPDATE? .. attribute:: arbiterElems :type: tuple Unique index arbiter list (of InferenceElem's) .. attribute:: arbiterWhere :type: Node Unique index arbiter WHERE clause .. attribute:: onConflictSet :type: tuple List of ON CONFLICT SET TargetEntrys .. attribute:: onConflictWhere :type: Node Qualifiers to restrict UPDATE to .. attribute:: exclRelIndex :type: int RT index of 'excluded' relation .. attribute:: exclRelTlist :type: tuple Tlist of the EXCLUDED pseudo relation .. class:: OpExpr(opretset=None, args=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: opretset :type: bool .. attribute:: args :type: tuple .. attribute:: location :type: ParseLoc .. class:: PLAssignStmt(name=None, indirection=None, nnames=None, val=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Initial column name .. attribute:: indirection :type: tuple Subscripts and field names, if any .. attribute:: nnames :type: int Number of names to use in ColumnRef .. attribute:: val :type: SelectStmt* The PL/pgSQL expression to assign .. attribute:: location :type: ParseLoc Name's token location, or -1 if unknown .. class:: Param(paramkind=None, paramid=None, paramtypmod=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: paramkind :type: ParamKind Kind of parameter. See above .. attribute:: paramid :type: int Numeric ID for parameter .. attribute:: paramtypmod :type: int32 .. attribute:: location :type: ParseLoc .. class:: ParamRef(number=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: number :type: int The number of the parameter .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: PartitionBoundSpec(strategy=None, is_default=None, modulus=None, remainder=None, listdatums=None, lowerdatums=None, upperdatums=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: strategy :type: str See PARTITION_STRATEGY codes above .. attribute:: is_default :type: bool Is it a default partition bound? .. attribute:: modulus :type: int .. attribute:: remainder :type: int .. attribute:: listdatums :type: tuple List of Consts (or A_Consts in raw tree) .. attribute:: lowerdatums :type: tuple List of PartitionRangeDatums .. attribute:: upperdatums :type: tuple List of PartitionRangeDatums .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: PartitionCmd(name=None, bound=None, concurrent=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: RangeVar* Name of partition to attach/detach .. attribute:: bound :type: PartitionBoundSpec* FOR VALUES, if attaching .. attribute:: concurrent :type: bool .. class:: PartitionElem(name=None, expr=None, collation=None, opclass=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Name of column to partition on, or NULL .. attribute:: expr :type: Node Expression to partition on, or NULL .. attribute:: collation :type: tuple Name of collation; NIL = default .. attribute:: opclass :type: tuple Name of desired opclass; NIL = default .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: PartitionRangeDatum(kind=None, value=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: PartitionRangeDatumKind .. attribute:: value :type: Node Const (or A_Const in raw tree), if kind is PARTITION_RANGE_DATUM_VALUE, else NULL .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: PartitionSpec(strategy=None, partParams=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: strategy :type: PartitionStrategy .. attribute:: partParams :type: tuple List of PartitionElems .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: PrepareStmt(name=None, argtypes=None, query=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Name of plan, arbitrary .. attribute:: argtypes :type: tuple Types of parameters (List of TypeName) .. attribute:: query :type: Node The query itself (as a raw parsetree) .. class:: PublicationObjSpec(pubobjtype=None, name=None, pubtable=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: pubobjtype :type: PublicationObjSpecType Type of this publication object .. attribute:: name :type: str .. attribute:: pubtable :type: PublicationTable* .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: PublicationTable(relation=None, whereClause=None, columns=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation to be published .. attribute:: whereClause :type: Node Qualifications .. attribute:: columns :type: tuple List of columns in a publication table .. class:: Query(commandType=None, querySource=None, canSetTag=None, utilityStmt=None, resultRelation=None, hasAggs=None, hasWindowFuncs=None, hasTargetSRFs=None, hasSubLinks=None, hasDistinctOn=None, hasRecursive=None, hasModifyingCTE=None, hasForUpdate=None, hasRowSecurity=None, isReturn=None, cteList=None, rtable=None, rteperminfos=None, jointree=None, mergeActionList=None, mergeTargetRelation=None, mergeJoinCondition=None, targetList=None, override=None, onConflict=None, returningList=None, groupClause=None, groupDistinct=None, groupingSets=None, havingQual=None, windowClause=None, distinctClause=None, sortClause=None, limitOffset=None, limitCount=None, limitOption=None, rowMarks=None, setOperations=None, constraintDeps=None, withCheckOptions=None, stmt_location=None, stmt_len=None) Wrapper for the `homonymous `__ parser node. .. attribute:: commandType :type: CmdType Select|insert|update|delete|merge|utility .. attribute:: querySource :type: QuerySource .. attribute:: canSetTag :type: bool .. attribute:: utilityStmt :type: Node Non-null if commandType == CMD_UTILITY .. attribute:: resultRelation :type: int .. attribute:: hasAggs :type: bool .. attribute:: hasWindowFuncs :type: bool .. attribute:: hasTargetSRFs :type: bool .. attribute:: hasSubLinks :type: bool .. attribute:: hasDistinctOn :type: bool .. attribute:: hasRecursive :type: bool .. attribute:: hasModifyingCTE :type: bool .. attribute:: hasForUpdate :type: bool .. attribute:: hasRowSecurity :type: bool .. attribute:: isReturn :type: bool .. attribute:: cteList :type: tuple WITH list (of CommonTableExpr's) .. attribute:: rtable :type: tuple List of range table entries .. attribute:: rteperminfos :type: tuple .. attribute:: jointree :type: FromExpr* Table join tree (FROM and WHERE clauses); also USING clause for MERGE .. attribute:: mergeActionList :type: tuple List of actions for MERGE (only) .. attribute:: mergeTargetRelation :type: int .. attribute:: mergeJoinCondition :type: Node .. attribute:: targetList :type: tuple Target list (of TargetEntry) .. attribute:: override :type: OverridingKind .. attribute:: onConflict :type: OnConflictExpr* ON CONFLICT DO [NOTHING | UPDATE] .. attribute:: returningList :type: tuple Return-values list (of TargetEntry) .. attribute:: groupClause :type: tuple A list of SortGroupClause's .. attribute:: groupDistinct :type: bool Is the group by clause distinct? .. attribute:: groupingSets :type: tuple A list of GroupingSet's if present .. attribute:: havingQual :type: Node Qualifications applied to groups .. attribute:: windowClause :type: tuple A list of WindowClause's .. attribute:: distinctClause :type: tuple A list of SortGroupClause's .. attribute:: sortClause :type: tuple A list of SortGroupClause's .. attribute:: limitOffset :type: Node # of result tuples to skip (int8 expr) .. attribute:: limitCount :type: Node # of result tuples to return (int8 expr) .. attribute:: limitOption :type: LimitOption Limit type .. attribute:: rowMarks :type: tuple A list of RowMarkClause's .. attribute:: setOperations :type: Node Set-operation tree if this is top level of a UNION/INTERSECT/EXCEPT query .. attribute:: constraintDeps :type: tuple .. attribute:: withCheckOptions :type: tuple .. attribute:: stmt_location :type: ParseLoc .. attribute:: stmt_len :type: ParseLoc .. class:: RTEPermissionInfo(inh=None, requiredPerms=None, selectedCols=None, insertedCols=None, updatedCols=None) Wrapper for the `homonymous `__ parser node. .. attribute:: inh :type: bool Separately check inheritance children? .. attribute:: requiredPerms :type: AclMode Bitmask of required access permissions .. attribute:: selectedCols :type: Bitmapset* Columns needing SELECT permission .. attribute:: insertedCols :type: Bitmapset* Columns needing INSERT permission .. attribute:: updatedCols :type: Bitmapset* Columns needing UPDATE permission .. class:: RangeFunction(lateral=None, ordinality=None, is_rowsfrom=None, functions=None, alias=None, coldeflist=None) Wrapper for the `homonymous `__ parser node. .. attribute:: lateral :type: bool Does it have LATERAL prefix? .. attribute:: ordinality :type: bool Does it have WITH ORDINALITY suffix? .. attribute:: is_rowsfrom :type: bool Is result of ROWS FROM() syntax? .. attribute:: functions :type: tuple Per-function information, see above .. attribute:: alias :type: Alias* Table alias & optional column aliases .. attribute:: coldeflist :type: tuple List of ColumnDef nodes to describe result of function returning RECORD .. class:: RangeSubselect(lateral=None, subquery=None, alias=None) Wrapper for the `homonymous `__ parser node. .. attribute:: lateral :type: bool Does it have LATERAL prefix? .. attribute:: subquery :type: Node The untransformed sub-select clause .. attribute:: alias :type: Alias* Table alias & optional column aliases .. class:: RangeTableFunc(lateral=None, docexpr=None, rowexpr=None, namespaces=None, columns=None, alias=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: lateral :type: bool Does it have LATERAL prefix? .. attribute:: docexpr :type: Node Document expression .. attribute:: rowexpr :type: Node Row generator expression .. attribute:: namespaces :type: tuple List of namespaces as ResTarget .. attribute:: columns :type: tuple List of RangeTableFuncCol .. attribute:: alias :type: Alias* Table alias & optional column aliases .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: RangeTableFuncCol(colname=None, typeName=None, for_ordinality=None, is_not_null=None, colexpr=None, coldefexpr=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: colname :type: str Name of generated column .. attribute:: typeName :type: TypeName* Type of generated column .. attribute:: for_ordinality :type: bool Does it have FOR ORDINALITY? .. attribute:: is_not_null :type: bool Does it have NOT NULL? .. attribute:: colexpr :type: Node Column filter expression .. attribute:: coldefexpr :type: Node Column default value expression .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: RangeTableSample(relation=None, method=None, args=None, repeatable=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: Node Relation to be sampled .. attribute:: method :type: tuple Sampling method name (possibly qualified) .. attribute:: args :type: tuple Argument(s) for sampling method .. attribute:: repeatable :type: Node REPEATABLE expression, or NULL if none .. attribute:: location :type: ParseLoc Method name location, or -1 if unknown .. class:: RangeTblEntry(alias=None, eref=None, rtekind=None, inh=None, relkind=None, rellockmode=None, perminfoindex=None, tablesample=None, subquery=None, security_barrier=None, jointype=None, joinmergedcols=None, joinaliasvars=None, joinleftcols=None, joinrightcols=None, join_using_alias=None, functions=None, funcordinality=None, tablefunc=None, values_lists=None, ctename=None, ctelevelsup=None, self_reference=None, coltypes=None, coltypmods=None, colcollations=None, enrname=None, enrtuples=None, lateral=None, inFromCl=None, securityQuals=None) Wrapper for the `homonymous `__ parser node. .. attribute:: alias :type: Alias* .. attribute:: eref :type: Alias* .. attribute:: rtekind :type: RTEKind .. attribute:: inh :type: bool .. attribute:: relkind :type: str .. attribute:: rellockmode :type: int .. attribute:: perminfoindex :type: Index .. attribute:: tablesample :type: TableSampleClause* .. attribute:: subquery :type: Query* .. attribute:: security_barrier :type: bool .. attribute:: jointype :type: JoinType .. attribute:: joinmergedcols :type: int .. attribute:: joinaliasvars :type: tuple .. attribute:: joinleftcols :type: tuple .. attribute:: joinrightcols :type: tuple .. attribute:: join_using_alias :type: Alias* .. attribute:: functions :type: tuple .. attribute:: funcordinality :type: bool .. attribute:: tablefunc :type: TableFunc* .. attribute:: values_lists :type: tuple .. attribute:: ctename :type: str .. attribute:: ctelevelsup :type: Index .. attribute:: self_reference :type: bool .. attribute:: coltypes :type: tuple .. attribute:: coltypmods :type: tuple .. attribute:: colcollations :type: tuple .. attribute:: enrname :type: str .. attribute:: enrtuples :type: Cardinality .. attribute:: lateral :type: bool .. attribute:: inFromCl :type: bool .. attribute:: securityQuals :type: tuple .. class:: RangeTblFunction(funcexpr=None, funccolcount=None, funccolnames=None, funccoltypes=None, funccoltypmods=None, funccolcollations=None, funcparams=None) Wrapper for the `homonymous `__ parser node. .. attribute:: funcexpr :type: Node Expression tree for func call .. attribute:: funccolcount :type: int .. attribute:: funccolnames :type: tuple .. attribute:: funccoltypes :type: tuple .. attribute:: funccoltypmods :type: tuple .. attribute:: funccolcollations :type: tuple .. attribute:: funcparams :type: Bitmapset* .. class:: RangeTblRef(rtindex=None) Wrapper for the `homonymous `__ parser node. .. attribute:: rtindex :type: int .. class:: RangeVar(catalogname=None, schemaname=None, relname=None, inh=None, relpersistence=None, alias=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: catalogname :type: str .. attribute:: schemaname :type: str .. attribute:: relname :type: str .. attribute:: inh :type: bool .. attribute:: relpersistence :type: str .. attribute:: alias :type: Alias* .. attribute:: location :type: ParseLoc .. class:: RawStmt(stmt=None, stmt_location=None, stmt_len=None) Wrapper for the `homonymous `__ parser node. .. attribute:: stmt :type: Node Raw parse tree .. attribute:: stmt_location :type: ParseLoc Start location, or -1 if unknown .. attribute:: stmt_len :type: ParseLoc Length in bytes; 0 means "rest of string" .. class:: ReassignOwnedStmt(roles=None, newrole=None) Wrapper for the `homonymous `__ parser node. .. attribute:: roles :type: tuple .. attribute:: newrole :type: RoleSpec* .. class:: RefreshMatViewStmt(concurrent=None, skipData=None, relation=None) Wrapper for the `homonymous `__ parser node. .. attribute:: concurrent :type: bool Allow concurrent access? .. attribute:: skipData :type: bool True for WITH NO DATA .. attribute:: relation :type: RangeVar* Relation to insert into .. class:: ReindexStmt(kind=None, relation=None, name=None, params=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: ReindexObjectType REINDEX_OBJECT_INDEX, REINDEX_OBJECT_TABLE, etc. .. attribute:: relation :type: RangeVar* Table or index to reindex .. attribute:: name :type: str Name of database to reindex .. attribute:: params :type: tuple List of DefElem nodes .. class:: RelabelType(arg=None, resulttypmod=None, relabelformat=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Expr* Input expression .. attribute:: resulttypmod :type: int32 .. attribute:: relabelformat :type: CoercionForm .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: RenameStmt(renameType=None, relationType=None, relation=None, object=None, subname=None, newname=None, behavior=None, missing_ok=None) Wrapper for the `homonymous `__ parser node. .. attribute:: renameType :type: ObjectType OBJECT_TABLE, OBJECT_COLUMN, etc .. attribute:: relationType :type: ObjectType If column name, associated relation type .. attribute:: relation :type: RangeVar* In case it's a table .. attribute:: object :type: Node In case it's some other object .. attribute:: subname :type: str Name of contained object (column, rule, trigger, etc) .. attribute:: newname :type: str The new name .. attribute:: behavior :type: DropBehavior RESTRICT or CASCADE behavior .. attribute:: missing_ok :type: bool Skip error if missing? .. class:: ReplicaIdentityStmt(identity_type=None, name=None) Wrapper for the `homonymous `__ parser node. .. attribute:: identity_type :type: str .. attribute:: name :type: str .. class:: ResTarget(name=None, indirection=None, val=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Column name or NULL .. attribute:: indirection :type: tuple Subscripts, field names, and '*', or NIL .. attribute:: val :type: Node The value expression to compute or assign .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: ReturnStmt(returnval=None) Wrapper for the `homonymous `__ parser node. .. attribute:: returnval :type: Node .. class:: RoleSpec(roletype=None, rolename=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: roletype :type: RoleSpecType Type of this rolespec .. attribute:: rolename :type: str Filled only for ROLESPEC_CSTRING .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: RowCompareExpr(rctype=None, opnos=None, opfamilies=None, inputcollids=None, largs=None, rargs=None) Wrapper for the `homonymous `__ parser node. .. attribute:: rctype :type: RowCompareType .. attribute:: opnos :type: tuple .. attribute:: opfamilies :type: tuple .. attribute:: inputcollids :type: tuple .. attribute:: largs :type: tuple .. attribute:: rargs :type: tuple .. class:: RowExpr(args=None, row_format=None, colnames=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: args :type: tuple The fields .. attribute:: row_format :type: CoercionForm .. attribute:: colnames :type: tuple .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: RowMarkClause(rti=None, strength=None, waitPolicy=None, pushedDown=None) Wrapper for the `homonymous `__ parser node. .. attribute:: rti :type: Index Range table index of target relation .. attribute:: strength :type: LockClauseStrength .. attribute:: waitPolicy :type: LockWaitPolicy NOWAIT and SKIP LOCKED .. attribute:: pushedDown :type: bool Pushed down from higher query level? .. class:: RuleStmt(relation=None, rulename=None, whereClause=None, event=None, instead=None, actions=None, replace=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation the rule is for .. attribute:: rulename :type: str Name of the rule .. attribute:: whereClause :type: Node Qualifications .. attribute:: event :type: CmdType SELECT, INSERT, etc .. attribute:: instead :type: bool Is a 'do instead'? .. attribute:: actions :type: tuple The action statements .. attribute:: replace :type: bool OR REPLACE .. class:: SQLValueFunction(op=None, typmod=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: op :type: SQLValueFunctionOp Which function this is .. attribute:: typmod :type: int32 .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: ScalarArrayOpExpr(useOr=None, args=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: useOr :type: bool .. attribute:: args :type: tuple .. attribute:: location :type: ParseLoc .. class:: SecLabelStmt(objtype=None, object=None, provider=None, label=None) Wrapper for the `homonymous `__ parser node. .. attribute:: objtype :type: ObjectType Object's type .. attribute:: object :type: Node Qualified name of the object .. attribute:: provider :type: str Label provider (or NULL) .. attribute:: label :type: str New security label to be assigned .. class:: SelectStmt(distinctClause=None, intoClause=None, targetList=None, fromClause=None, whereClause=None, groupClause=None, groupDistinct=None, havingClause=None, windowClause=None, valuesLists=None, sortClause=None, limitOffset=None, limitCount=None, limitOption=None, lockingClause=None, withClause=None, op=None, all=None, larg=None, rarg=None) Wrapper for the `homonymous `__ parser node. .. attribute:: distinctClause :type: tuple NULL, list of DISTINCT ON exprs, or lcons(NIL,NIL) for all (SELECT DISTINCT) .. attribute:: intoClause :type: IntoClause* Target for SELECT INTO .. attribute:: targetList :type: tuple The target list (of ResTarget) .. attribute:: fromClause :type: tuple The FROM clause .. attribute:: whereClause :type: Node WHERE qualification .. attribute:: groupClause :type: tuple GROUP BY clauses .. attribute:: groupDistinct :type: bool Is this GROUP BY DISTINCT? .. attribute:: havingClause :type: Node HAVING conditional-expression .. attribute:: windowClause :type: tuple WINDOW window_name AS (...), ... .. attribute:: valuesLists :type: tuple Untransformed list of expression lists .. attribute:: sortClause :type: tuple Sort clause (a list of SortBy's) .. attribute:: limitOffset :type: Node # of result tuples to skip .. attribute:: limitCount :type: Node # of result tuples to return .. attribute:: limitOption :type: LimitOption Limit type .. attribute:: lockingClause :type: tuple FOR UPDATE (list of LockingClause's) .. attribute:: withClause :type: WithClause* WITH clause .. attribute:: op :type: SetOperation Type of set op .. attribute:: all :type: bool ALL specified? .. attribute:: larg :type: SelectStmt* Left child .. attribute:: rarg :type: SelectStmt* Right child .. class:: SetOperationStmt(op=None, all=None, larg=None, rarg=None, colTypes=None, colTypmods=None, colCollations=None, groupClauses=None) Wrapper for the `homonymous `__ parser node. .. attribute:: op :type: SetOperation Type of set op .. attribute:: all :type: bool ALL specified? .. attribute:: larg :type: Node Left child .. attribute:: rarg :type: Node Right child .. attribute:: colTypes :type: tuple .. attribute:: colTypmods :type: tuple .. attribute:: colCollations :type: tuple .. attribute:: groupClauses :type: tuple .. class:: SetToDefault(typeMod=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: typeMod :type: int32 .. attribute:: location :type: ParseLoc .. class:: SinglePartitionSpec() Wrapper for the `homonymous `__ parser node. .. class:: SortBy(node=None, sortby_dir=None, sortby_nulls=None, useOp=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: node :type: Node Expression to sort on .. attribute:: sortby_dir :type: SortByDir ASC/DESC/USING/default .. attribute:: sortby_nulls :type: SortByNulls NULLS FIRST/LAST .. attribute:: useOp :type: tuple Name of op to use, if SORTBY_USING .. attribute:: location :type: ParseLoc Operator location, or -1 if none/unknown .. class:: SortGroupClause(tleSortGroupRef=None, nulls_first=None, hashable=None) Wrapper for the `homonymous `__ parser node. .. attribute:: tleSortGroupRef :type: Index Reference into targetlist .. attribute:: nulls_first :type: bool Do NULLs come before normal values? .. attribute:: hashable :type: bool .. class:: StatsElem(name=None, expr=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Name of attribute to index, or NULL .. attribute:: expr :type: Node Expression to index, or NULL .. class:: String(sval=None) Wrapper for the `homonymous `__ parser node. .. attribute:: sval :type: str .. class:: SubLink(subLinkType=None, subLinkId=None, testexpr=None, operName=None, subselect=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subLinkType :type: SubLinkType .. attribute:: subLinkId :type: int ID (1..n); 0 if not MULTIEXPR .. attribute:: testexpr :type: Node Outer-query test for ALL/ANY/ROWCOMPARE .. attribute:: operName :type: tuple .. attribute:: subselect :type: Node .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: SubPlan(subLinkType=None, testexpr=None, paramIds=None, plan_id=None, plan_name=None, firstColTypmod=None, useHashTable=None, unknownEqFalse=None, parallel_safe=None, setParam=None, parParam=None, args=None, startup_cost=None, per_call_cost=None) Wrapper for the `homonymous `__ parser node. .. attribute:: subLinkType :type: SubLinkType .. attribute:: testexpr :type: Node OpExpr or RowCompareExpr expression tree .. attribute:: paramIds :type: tuple IDs of Params embedded in the above .. attribute:: plan_id :type: int Index (from 1) in PlannedStmt.subplans .. attribute:: plan_name :type: str A name assigned during planning .. attribute:: firstColTypmod :type: int32 Typmod of first column of subplan result .. attribute:: useHashTable :type: bool True to store subselect output in a hash table (implies we are doing "IN") .. attribute:: unknownEqFalse :type: bool True if it's okay to return FALSE when the spec result is UNKNOWN; this allows much simpler handling of null values .. attribute:: parallel_safe :type: bool Is the subplan parallel-safe? .. attribute:: setParam :type: tuple Initplan and MULTIEXPR subqueries have to set these Params for parent plan .. attribute:: parParam :type: tuple Indices of input Params from parent plan .. attribute:: args :type: tuple Exprs to pass as parParam values .. attribute:: startup_cost :type: Cost One-time setup cost .. attribute:: per_call_cost :type: Cost Cost for each subplan evaluation .. class:: SubscriptingRef(reftypmod=None, refupperindexpr=None, reflowerindexpr=None, refexpr=None, refassgnexpr=None) Wrapper for the `homonymous `__ parser node. .. attribute:: reftypmod :type: int32 .. attribute:: refupperindexpr :type: tuple .. attribute:: reflowerindexpr :type: tuple .. attribute:: refexpr :type: Expr* .. attribute:: refassgnexpr :type: Expr* .. class:: TableFunc(functype=None, ns_uris=None, ns_names=None, docexpr=None, rowexpr=None, colnames=None, coltypes=None, coltypmods=None, colcollations=None, colexprs=None, coldefexprs=None, colvalexprs=None, passingvalexprs=None, notnulls=None, plan=None, ordinalitycol=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: functype :type: TableFuncType .. attribute:: ns_uris :type: tuple .. attribute:: ns_names :type: tuple .. attribute:: docexpr :type: Node .. attribute:: rowexpr :type: Node .. attribute:: colnames :type: tuple .. attribute:: coltypes :type: tuple .. attribute:: coltypmods :type: tuple .. attribute:: colcollations :type: tuple .. attribute:: colexprs :type: tuple .. attribute:: coldefexprs :type: tuple .. attribute:: colvalexprs :type: tuple .. attribute:: passingvalexprs :type: tuple .. attribute:: notnulls :type: Bitmapset* .. attribute:: plan :type: Node .. attribute:: ordinalitycol :type: int .. attribute:: location :type: ParseLoc .. class:: TableLikeClause(relation=None, options=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* .. attribute:: options :type: bits32 OR of TableLikeOption flags .. class:: TableSampleClause(args=None, repeatable=None) Wrapper for the `homonymous `__ parser node. .. attribute:: args :type: tuple Tablesample argument expression(s) .. attribute:: repeatable :type: Expr* REPEATABLE expression, or NULL if none .. class:: TargetEntry(expr=None, resno=None, resname=None, ressortgroupref=None, resorigcol=None, resjunk=None) Wrapper for the `homonymous `__ parser node. .. attribute:: expr :type: Expr* .. attribute:: resno :type: AttrNumber .. attribute:: resname :type: str .. attribute:: ressortgroupref :type: Index .. attribute:: resorigcol :type: AttrNumber .. attribute:: resjunk :type: bool .. class:: TransactionStmt(kind=None, options=None, savepoint_name=None, gid=None, chain=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: TransactionStmtKind .. attribute:: options :type: tuple For BEGIN/START commands .. attribute:: savepoint_name :type: str .. attribute:: gid :type: str .. attribute:: chain :type: bool AND CHAIN option .. attribute:: location :type: ParseLoc .. class:: TriggerTransition(name=None, isNew=None, isTable=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str .. attribute:: isNew :type: bool .. attribute:: isTable :type: bool .. class:: TruncateStmt(relations=None, restart_seqs=None, behavior=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relations :type: tuple Relations (RangeVars) to be truncated .. attribute:: restart_seqs :type: bool Restart owned sequences? .. attribute:: behavior :type: DropBehavior RESTRICT or CASCADE behavior .. class:: TypeCast(arg=None, typeName=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: arg :type: Node The expression being casted .. attribute:: typeName :type: TypeName* The target type .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: TypeName(names=None, setof=None, pct_type=None, typmods=None, typemod=None, arrayBounds=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: names :type: tuple Qualified name (list of String nodes) .. attribute:: setof :type: bool Is a set? .. attribute:: pct_type :type: bool %TYPE specified? .. attribute:: typmods :type: tuple Type modifier expression(s) .. attribute:: typemod :type: int32 Prespecified type modifier .. attribute:: arrayBounds :type: tuple Array bounds .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: UnlistenStmt(conditionname=None) Wrapper for the `homonymous `__ parser node. .. attribute:: conditionname :type: str Name to unlisten on, or NULL for all .. class:: UpdateStmt(relation=None, targetList=None, whereClause=None, fromClause=None, returningList=None, withClause=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Relation to update .. attribute:: targetList :type: tuple The target list (of ResTarget) .. attribute:: whereClause :type: Node Qualifications .. attribute:: fromClause :type: tuple Optional from clause for more tables .. attribute:: returningList :type: tuple List of expressions to return .. attribute:: withClause :type: WithClause* WITH clause .. class:: VacuumRelation(relation=None, va_cols=None) Wrapper for the `homonymous `__ parser node. .. attribute:: relation :type: RangeVar* Table name to process, or NULL .. attribute:: va_cols :type: tuple List of column names, or NIL for all .. class:: VacuumStmt(options=None, rels=None, is_vacuumcmd=None) Wrapper for the `homonymous `__ parser node. .. attribute:: options :type: tuple List of DefElem nodes .. attribute:: rels :type: tuple List of VacuumRelation, or NIL for all .. attribute:: is_vacuumcmd :type: bool True for VACUUM, false for ANALYZE .. class:: Var(varno=None, varattno=None, vartypmod=None, varnullingrels=None, varlevelsup=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: varno :type: int .. attribute:: varattno :type: AttrNumber .. attribute:: vartypmod :type: int32 .. attribute:: varnullingrels :type: Bitmapset* .. attribute:: varlevelsup :type: Index .. attribute:: location :type: ParseLoc .. class:: VariableSetStmt(kind=None, name=None, args=None, is_local=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: VariableSetKind .. attribute:: name :type: str Variable to be set .. attribute:: args :type: tuple List of A_Const nodes .. attribute:: is_local :type: bool SET LOCAL? .. class:: VariableShowStmt(name=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str .. class:: ViewStmt(view=None, aliases=None, query=None, replace=None, options=None, withCheckOption=None) Wrapper for the `homonymous `__ parser node. .. attribute:: view :type: RangeVar* The view to be created .. attribute:: aliases :type: tuple Target column names .. attribute:: query :type: Node The SELECT query (as a raw parse tree) .. attribute:: replace :type: bool Replace an existing view? .. attribute:: options :type: tuple Options from WITH clause .. attribute:: withCheckOption :type: ViewCheckOption WITH CHECK OPTION .. class:: WindowClause(name=None, refname=None, partitionClause=None, orderClause=None, frameOptions=None, startOffset=None, endOffset=None, inRangeAsc=None, inRangeNullsFirst=None, winref=None, copiedOrder=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str .. attribute:: refname :type: str .. attribute:: partitionClause :type: tuple PARTITION BY list .. attribute:: orderClause :type: tuple .. attribute:: frameOptions :type: int Frame_clause options, see WindowDef .. attribute:: startOffset :type: Node Expression for starting bound, if any .. attribute:: endOffset :type: Node Expression for ending bound, if any .. attribute:: inRangeAsc :type: bool .. attribute:: inRangeNullsFirst :type: bool .. attribute:: winref :type: Index ID referenced by window functions .. attribute:: copiedOrder :type: bool .. class:: WindowDef(name=None, refname=None, partitionClause=None, orderClause=None, frameOptions=None, startOffset=None, endOffset=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: name :type: str Window's own name .. attribute:: refname :type: str Referenced window name, if any .. attribute:: partitionClause :type: tuple PARTITION BY expression list .. attribute:: orderClause :type: tuple ORDER BY (list of SortBy) .. attribute:: frameOptions :type: int Frame_clause options, see below .. attribute:: startOffset :type: Node Expression for starting bound, if any .. attribute:: endOffset :type: Node Expression for ending bound, if any .. attribute:: location :type: ParseLoc Parse location, or -1 if none/unknown .. class:: WindowFunc(args=None, aggfilter=None, runCondition=None, winref=None, winstar=None, winagg=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: args :type: tuple .. attribute:: aggfilter :type: Expr* .. attribute:: runCondition :type: tuple .. attribute:: winref :type: Index .. attribute:: winstar :type: bool .. attribute:: winagg :type: bool .. attribute:: location :type: ParseLoc .. class:: WindowFuncRunCondition(wfunc_left=None, arg=None) Wrapper for the `homonymous `__ parser node. .. attribute:: wfunc_left :type: bool .. attribute:: arg :type: Expr* .. class:: WithCheckOption(kind=None, relname=None, polname=None, qual=None, cascaded=None) Wrapper for the `homonymous `__ parser node. .. attribute:: kind :type: WCOKind Kind of WCO .. attribute:: relname :type: str Name of relation that specified the WCO .. attribute:: polname :type: str Name of RLS policy being checked .. attribute:: qual :type: Node Constraint qual to check .. attribute:: cascaded :type: bool True for a cascaded WCO on a view .. class:: WithClause(ctes=None, recursive=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: ctes :type: tuple List of CommonTableExprs .. attribute:: recursive :type: bool True = WITH RECURSIVE .. attribute:: location :type: ParseLoc Token location, or -1 if unknown .. class:: XmlExpr(op=None, name=None, named_args=None, arg_names=None, args=None, xmloption=None, indent=None, typmod=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: op :type: XmlExprOp .. attribute:: name :type: str .. attribute:: named_args :type: tuple .. attribute:: arg_names :type: tuple .. attribute:: args :type: tuple .. attribute:: xmloption :type: XmlOptionType .. attribute:: indent :type: bool .. attribute:: typmod :type: int32 .. attribute:: location :type: ParseLoc .. class:: XmlSerialize(xmloption=None, expr=None, typeName=None, indent=None, location=None) Wrapper for the `homonymous `__ parser node. .. attribute:: xmloption :type: XmlOptionType DOCUMENT or CONTENT .. attribute:: expr :type: Node .. attribute:: typeName :type: TypeName* .. attribute:: indent :type: bool [NO] INDENT .. attribute:: location :type: ParseLoc Token location, or -1 if unknown pglast-7.7/docs/changes.rst000077700000000000000000000000001477366773500200142../CHANGES.rstustar00rootroot00000000000000pglast-7.7/docs/conf.py000066400000000000000000000120601477366773500151400ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # pglast documentation build configuration file, created by # sphinx-quickstart on Thu Aug 10 09:55:41 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. source_suffix = {'.rst': 'restructuredtext'} # The master toctree document. master_doc = 'index' # General information about the project. project = 'pglast' copyright = '2017-2025 Lele Gaifax' author = 'Lele Gaifax' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '7.0' # The full version, including alpha/beta/rc tags: this is injected automatically # at release time. release = 'v7.7' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars html_sidebars = { '**': [ 'about.html', 'navigation.html', 'relations.html', # needs 'show_related': True theme option to display 'searchbox.html', 'donate.html', ] } # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'pglastdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'pglast.tex', 'pg\\_query Documentation', 'Lele Gaifax', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'pglast', 'pglast Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'pglast', 'pglast Documentation', author, 'pglast', 'One line description of project.', 'Miscellaneous'), ] pglast-7.7/docs/ddl.rst000066400000000000000000001237031477366773500151450ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ====================================================== :mod:`pglast.printers.ddl` --- DDL printer functions ====================================================== .. module:: pglast.printers.ddl :synopsis: DDL printer functions .. index:: AccessPriv .. function:: access_priv(node, output) Pretty print a `node` of type `AccessPriv `__ to the `output` stream. .. index:: AlterCollationStmt .. function:: alter_collation_stmt(node, output) Pretty print a `node` of type `AlterCollationStmt `__ to the `output` stream. .. index:: AlterDatabaseStmt .. function:: alter_database_stmt(node, output) Pretty print a `node` of type `AlterDatabaseStmt `__ to the `output` stream. .. index:: AlterDatabaseSetStmt .. function:: alter_database_set_stmt(node, output) Pretty print a `node` of type `AlterDatabaseSetStmt `__ to the `output` stream. .. index:: AlterExtensionStmt .. function:: alter_extension_stmt(node, output) Pretty print a `node` of type `AlterExtensionStmt `__ to the `output` stream. .. index:: pair: AlterExtensionStmt;DefElem .. function:: alter_extension_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterExtensionStmt `__, to the `output` stream. .. index:: AlterExtensionContentsStmt .. function:: alter_extension_contents_stmt(node, output) Pretty print a `node` of type `AlterExtensionContentsStmt `__ to the `output` stream. .. index:: AlterEnumStmt .. function:: alter_enum_stmt(node, output) Pretty print a `node` of type `AlterEnumStmt `__ to the `output` stream. .. index:: AlterDefaultPrivilegesStmt .. function:: alter_default_privileges_stmt(node, output) Pretty print a `node` of type `AlterDefaultPrivilegesStmt `__ to the `output` stream. .. index:: AlterFunctionStmt .. function:: alter_function_stmt(node, output) Pretty print a `node` of type `AlterFunctionStmt `__ to the `output` stream. .. index:: AlterObjectSchemaStmt .. function:: alter_object_schema_stmt(node, output) Pretty print a `node` of type `AlterObjectSchemaStmt `__ to the `output` stream. .. index:: AlterOperatorStmt .. function:: alter_operator_stmt(node, output) Pretty print a `node` of type `AlterOperatorStmt `__ to the `output` stream. .. index:: pair: AlterOperatorStmt;DefElem .. function:: alter_operator_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterOperatorStmt `__, to the `output` stream. .. index:: AlterOpFamilyStmt .. function:: alter_op_family_stmt(node, output) Pretty print a `node` of type `AlterOpFamilyStmt `__ to the `output` stream. .. index:: AlterOwnerStmt .. function:: alter_owner_stmt(node, output) Pretty print a `node` of type `AlterOwnerStmt `__ to the `output` stream. .. index:: AlterPolicyStmt .. function:: alter_policy_stmt(node, output) Pretty print a `node` of type `AlterPolicyStmt `__ to the `output` stream. .. index:: AlterRoleStmt .. function:: alter_role_stmt(node, output) Pretty print a `node` of type `AlterRoleStmt `__ to the `output` stream. .. index:: AlterSeqStmt .. function:: alter_seq_stmt(node, output) Pretty print a `node` of type `AlterSeqStmt `__ to the `output` stream. .. index:: AlterTableSpaceOptionsStmt .. function:: alter_tablespace_options_stmt(node, output) Pretty print a `node` of type `AlterTableSpaceOptionsStmt `__ to the `output` stream. .. index:: AlterTableStmt .. function:: alter_table_stmt(node, output) Pretty print a `node` of type `AlterTableStmt `__ to the `output` stream. .. index:: pair: AlterTableStmt;RangeVar .. function:: range_var(node, output) Pretty print a `node` of type `RangeVar `__, when it is inside a `AlterTableStmt `__, to the `output` stream. .. index:: AlterTableCmd .. function:: alter_table_cmd(node, output) Pretty print a `node` of type `AlterTableCmd `__ to the `output` stream. .. index:: pair: AlterTableCmd;DefElem .. index:: pair: CreatePublicationStmt;DefElem .. index:: pair: CreateStmt;DefElem .. index:: pair: IndexStmt;DefElem .. index:: pair: IntoClause;DefElem .. function:: alter_table_cmd_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterTableCmd `__ or a `CreatePublicationStmt `__ or a `CreateStmt `__ or a `IndexStmt `__ or a `IntoClause `__, to the `output` stream. .. index:: AlterTableMoveAllStmt .. function:: alter_table_move_all_stmt(node, output) Pretty print a `node` of type `AlterTableMoveAllStmt `__ to the `output` stream. .. index:: AlterTSConfigurationStmt .. function:: alter_ts_configuration_stmt(node, output) Pretty print a `node` of type `AlterTSConfigurationStmt `__ to the `output` stream. .. index:: AlterTSDictionaryStmt .. function:: alter_ts_dictionary_stmt(node, output) Pretty print a `node` of type `AlterTSDictionaryStmt `__ to the `output` stream. .. index:: AlterStatsStmt .. function:: alter_stats_stmt(node, output) Pretty print a `node` of type `AlterStatsStmt `__ to the `output` stream. .. index:: AlterSubscriptionStmt .. function:: alter_subscription_stmt(node, output) Pretty print a `node` of type `AlterSubscriptionStmt `__ to the `output` stream. .. index:: AlterPublicationStmt .. function:: alter_publication_stmt(node, output) Pretty print a `node` of type `AlterPublicationStmt `__ to the `output` stream. .. index:: AlterFdwStmt .. function:: alter_fdw_stmt(node, output) Pretty print a `node` of type `AlterFdwStmt `__ to the `output` stream. .. index:: pair: AlterFdwStmt;DefElem .. function:: alter_fdw_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterFdwStmt `__, to the `output` stream. .. index:: AlterForeignServerStmt .. function:: alter_foreign_server_stmt(node, output) Pretty print a `node` of type `AlterForeignServerStmt `__ to the `output` stream. .. index:: AlterUserMappingStmt .. function:: alter_user_mapping_stmt(node, output) Pretty print a `node` of type `AlterUserMappingStmt `__ to the `output` stream. .. index:: AlterRoleSetStmt .. function:: alter_role_set_stmt(node, output) Pretty print a `node` of type `AlterRoleSetStmt `__ to the `output` stream. .. index:: AlterDomainStmt .. function:: alter_domain_stmt(node, output) Pretty print a `node` of type `AlterDomainStmt `__ to the `output` stream. .. index:: AlterEventTrigStmt .. function:: alter_event_trig_stmt(node, output) Pretty print a `node` of type `AlterEventTrigStmt `__ to the `output` stream. .. index:: AlterTypeStmt .. function:: alter_type_stmt(node, output) Pretty print a `node` of type `AlterTypeStmt `__ to the `output` stream. .. index:: CheckPointStmt .. function:: check_point_stmt(node, output) Pretty print a `node` of type `CheckPointStmt `__ to the `output` stream. .. index:: ClusterStmt .. function:: cluster_stmt(node, output) Pretty print a `node` of type `ClusterStmt `__ to the `output` stream. .. index:: ColumnDef .. function:: column_def(node, output) Pretty print a `node` of type `ColumnDef `__ to the `output` stream. .. index:: CommentStmt .. function:: comment_stmt(node, output) Pretty print a `node` of type `CommentStmt `__ to the `output` stream. .. index:: CompositeTypeStmt .. function:: composite_type_stmt(node, output) Pretty print a `node` of type `CompositeTypeStmt `__ to the `output` stream. .. index:: pair: CompositeTypeStmt;RangeVar .. function:: composite_type_stmt_range_var(node, output) Pretty print a `node` of type `RangeVar `__, when it is inside a `CompositeTypeStmt `__, to the `output` stream. .. index:: Constraint .. function:: constraint(node, output) Pretty print a `node` of type `Constraint `__ to the `output` stream. .. index:: CreateAmStmt .. function:: create_am_stmt(node, output) Pretty print a `node` of type `CreateAmStmt `__ to the `output` stream. .. index:: CreatedbStmt .. function:: create_db_stmt(node, output) Pretty print a `node` of type `CreatedbStmt `__ to the `output` stream. .. index:: pair: CreatedbStmt;DefElem .. function:: create_db_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `CreatedbStmt `__, to the `output` stream. .. index:: CreateCastStmt .. function:: create_cast_stmt(node, output) Pretty print a `node` of type `CreateCastStmt `__ to the `output` stream. .. index:: CreateConversionStmt .. function:: create_conversion_stmt(node, output) Pretty print a `node` of type `CreateConversionStmt `__ to the `output` stream. .. index:: CreateDomainStmt .. function:: create_domain_stmt(node, output) Pretty print a `node` of type `CreateDomainStmt `__ to the `output` stream. .. index:: CreateEnumStmt .. function:: create_enum_stmt(node, output) Pretty print a `node` of type `CreateEnumStmt `__ to the `output` stream. .. index:: CreateEventTrigStmt .. function:: create_event_trig_stmt(node, output) Pretty print a `node` of type `CreateEventTrigStmt `__ to the `output` stream. .. index:: pair: CreateEventTrigStmt;DefElem .. function:: create_event_trig_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `CreateEventTrigStmt `__, to the `output` stream. .. index:: CreateExtensionStmt .. function:: create_extension_stmt(node, output) Pretty print a `node` of type `CreateExtensionStmt `__ to the `output` stream. .. index:: pair: CreateExtensionStmt;DefElem .. function:: create_extension_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `CreateExtensionStmt `__, to the `output` stream. .. index:: CreateFdwStmt .. function:: create_fdw_stmt(node, output) Pretty print a `node` of type `CreateFdwStmt `__ to the `output` stream. .. index:: pair: ColumnDef;DefElem .. index:: pair: CreateUserMappingStmt;DefElem .. index:: pair: CreateFdwStmt;DefElem .. function:: create_fdw_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `ColumnDef `__ or a `CreateUserMappingStmt `__ or a `CreateFdwStmt `__, to the `output` stream. .. index:: CreateForeignServerStmt .. function:: create_foreign_server_stmt(node, output) Pretty print a `node` of type `CreateForeignServerStmt `__ to the `output` stream. .. index:: CreateForeignTableStmt .. function:: create_foreign_table_stmt(node, output) Pretty print a `node` of type `CreateForeignTableStmt `__ to the `output` stream. .. index:: pair: CreateForeignTableStmt;DefElem .. index:: pair: CreateForeignServerStmt;DefElem .. function:: create_foreign_table_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `CreateForeignTableStmt `__ or a `CreateForeignServerStmt `__, to the `output` stream. .. index:: CreateFunctionStmt .. function:: create_function_stmt(node, output) Pretty print a `node` of type `CreateFunctionStmt `__ to the `output` stream. .. index:: pair: AlterFunctionStmt;DefElem .. index:: pair: CreateFunctionStmt;DefElem .. index:: pair: DoStmt;DefElem .. function:: create_function_option(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterFunctionStmt `__ or a `CreateFunctionStmt `__ or a `DoStmt `__, to the `output` stream. .. index:: CreateOpClassStmt .. function:: create_opclass_stmt(node, output) Pretty print a `node` of type `CreateOpClassStmt `__ to the `output` stream. .. index:: CreateOpClassItem .. function:: create_opclass_item(node, output) Pretty print a `node` of type `CreateOpClassItem `__ to the `output` stream. .. index:: CreateOpFamilyStmt .. function:: create_op_family_stmt(node, output) Pretty print a `node` of type `CreateOpFamilyStmt `__ to the `output` stream. .. index:: CreatePLangStmt .. function:: create_plang_stmt(node, output) Pretty print a `node` of type `CreatePLangStmt `__ to the `output` stream. .. index:: CreatePolicyStmt .. function:: create_policy_stmt(node, output) Pretty print a `node` of type `CreatePolicyStmt `__ to the `output` stream. .. index:: CreatePublicationStmt .. function:: create_publication_stmt(node, output) Pretty print a `node` of type `CreatePublicationStmt `__ to the `output` stream. .. index:: CreateRangeStmt .. function:: create_range_stmt(node, output) Pretty print a `node` of type `CreateRangeStmt `__ to the `output` stream. .. index:: CreateRoleStmt .. function:: create_role_stmt(node, output) Pretty print a `node` of type `CreateRoleStmt `__ to the `output` stream. .. index:: pair: AlterRoleStmt;DefElem .. index:: pair: CreateRoleStmt;DefElem .. function:: create_or_alter_role_option(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterRoleStmt `__ or a `CreateRoleStmt `__, to the `output` stream. .. index:: CreateSchemaStmt .. function:: create_schema_stmt(node, output) Pretty print a `node` of type `CreateSchemaStmt `__ to the `output` stream. .. index:: CreateSeqStmt .. function:: create_seq_stmt(node, output) Pretty print a `node` of type `CreateSeqStmt `__ to the `output` stream. .. index:: pair: Constraint;DefElem .. index:: pair: CreateSeqStmt;DefElem .. index:: pair: AlterSeqStmt;DefElem .. function:: create_seq_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `Constraint `__ or a `CreateSeqStmt `__ or a `AlterSeqStmt `__, to the `output` stream. .. index:: CreateStatsStmt .. function:: create_stats_stmt(node, output) Pretty print a `node` of type `CreateStatsStmt `__ to the `output` stream. .. index:: CreateStmt .. function:: create_stmt(node, output) Pretty print a `node` of type `CreateStmt `__ to the `output` stream. .. index:: CreateTableAsStmt .. function:: create_table_as_stmt(node, output) Pretty print a `node` of type `CreateTableAsStmt `__ to the `output` stream. .. index:: CreateTableSpaceStmt .. function:: create_table_space_stmt(node, output) Pretty print a `node` of type `CreateTableSpaceStmt `__ to the `output` stream. .. index:: CreateTrigStmt .. function:: create_trig_stmt(node, output) Pretty print a `node` of type `CreateTrigStmt `__ to the `output` stream. .. index:: pair: AlterSubscriptionStmt;DefElem .. index:: pair: CreateSubscriptionStmt;DefElem .. function:: create_subscription_stmt_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `AlterSubscriptionStmt `__ or a `CreateSubscriptionStmt `__, to the `output` stream. .. index:: CreateSubscriptionStmt .. function:: create_subscription_stmt(node, output) Pretty print a `node` of type `CreateSubscriptionStmt `__ to the `output` stream. .. index:: CurrentOfExpr .. function:: current_of_expr(node, output) Pretty print a `node` of type `CurrentOfExpr `__ to the `output` stream. .. index:: CreateTransformStmt .. function:: create_transform_stmt(node, output) Pretty print a `node` of type `CreateTransformStmt `__ to the `output` stream. .. index:: ClosePortalStmt .. function:: close_portal_stmt(node, output) Pretty print a `node` of type `ClosePortalStmt `__ to the `output` stream. .. index:: CreateUserMappingStmt .. function:: create_user_mapping_stmt(node, output) Pretty print a `node` of type `CreateUserMappingStmt `__ to the `output` stream. .. index:: DeallocateStmt .. function:: deallocate_stmt(node, output) Pretty print a `node` of type `DeallocateStmt `__ to the `output` stream. .. index:: DefineStmt .. function:: define_stmt(node, output) Pretty print a `node` of type `DefineStmt `__ to the `output` stream. .. index:: DefElem .. function:: def_elem(node, output) Pretty print a `node` of type `DefElem `__ to the `output` stream. .. index:: pair: DefineStmt;DefElem .. function:: define_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `DefineStmt `__, to the `output` stream. .. index:: DiscardStmt .. function:: discard_stmt(node, output) Pretty print a `node` of type `DiscardStmt `__ to the `output` stream. .. index:: DoStmt .. function:: do_stmt(node, output) Pretty print a `node` of type `DoStmt `__ to the `output` stream. .. index:: DropdbStmt .. function:: drop_db_stmt(node, output) Pretty print a `node` of type `DropdbStmt `__ to the `output` stream. .. index:: DropOwnedStmt .. function:: drop_owned_stmt(node, output) Pretty print a `node` of type `DropOwnedStmt `__ to the `output` stream. .. index:: DropRoleStmt .. function:: drop_role_stmt(node, output) Pretty print a `node` of type `DropRoleStmt `__ to the `output` stream. .. index:: DropStmt .. function:: drop_stmt(node, output) Pretty print a `node` of type `DropStmt `__ to the `output` stream. .. index:: DropSubscriptionStmt .. function:: drop_subscription_stmt(node, output) Pretty print a `node` of type `DropSubscriptionStmt `__ to the `output` stream. .. index:: DropTableSpaceStmt .. function:: drop_table_space_stmt(node, output) Pretty print a `node` of type `DropTableSpaceStmt `__ to the `output` stream. .. index:: DropUserMappingStmt .. function:: drop_user_mapping_stmt(node, output) Pretty print a `node` of type `DropUserMappingStmt `__ to the `output` stream. .. index:: FunctionParameter .. function:: function_parameter(node, output) Pretty print a `node` of type `FunctionParameter `__ to the `output` stream. .. index:: GrantStmt .. function:: grant_stmt(node, output) Pretty print a `node` of type `GrantStmt `__ to the `output` stream. .. index:: GrantRoleStmt .. function:: grant_role_stmt(node, output) Pretty print a `node` of type `GrantRoleStmt `__ to the `output` stream. .. index:: pair: GrantRoleStmt;DefElem .. function:: grant_role_stmt_opt(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `GrantRoleStmt `__, to the `output` stream. .. index:: ImportForeignSchemaStmt .. function:: import_foreign_schema_stmt(node, output) Pretty print a `node` of type `ImportForeignSchemaStmt `__ to the `output` stream. .. index:: IndexStmt .. function:: index_stmt(node, output) Pretty print a `node` of type `IndexStmt `__ to the `output` stream. .. index:: LoadStmt .. function:: load_stmt(node, output) Pretty print a `node` of type `LoadStmt `__ to the `output` stream. .. index:: LockStmt .. function:: lock_stmt(node, output) Pretty print a `node` of type `LockStmt `__ to the `output` stream. .. index:: NotifyStmt .. function:: notify_stmt(node, output) Pretty print a `node` of type `NotifyStmt `__ to the `output` stream. .. index:: ObjectWithArgs .. function:: object_with_args(node, output) Pretty print a `node` of type `ObjectWithArgs `__ to the `output` stream. .. index:: pair: AlterObjectSchemaStmt;ObjectWithArgs .. function:: alter_object_schema_stmt_object_with_args(node, output) Pretty print a `node` of type `ObjectWithArgs `__, when it is inside a `AlterObjectSchemaStmt `__, to the `output` stream. .. index:: pair: AlterOperatorStmt;ObjectWithArgs .. function:: alter_operator_stmt_object_with_args(node, output) Pretty print a `node` of type `ObjectWithArgs `__, when it is inside a `AlterOperatorStmt `__, to the `output` stream. .. index:: pair: AlterOwnerStmt;ObjectWithArgs .. function:: alter_owner_stmt_object_with_args(node, output) Pretty print a `node` of type `ObjectWithArgs `__, when it is inside a `AlterOwnerStmt `__, to the `output` stream. .. index:: pair: CommentStmt;ObjectWithArgs .. function:: comment_stmt_object_with_args(node, output) Pretty print a `node` of type `ObjectWithArgs `__, when it is inside a `CommentStmt `__, to the `output` stream. .. index:: pair: DropStmt;ObjectWithArgs .. function:: drop_stmt_object_with_args(node, output) Pretty print a `node` of type `ObjectWithArgs `__, when it is inside a `DropStmt `__, to the `output` stream. .. index:: PartitionBoundSpec .. function:: partition_bound_spec(node, output) Pretty print a `node` of type `PartitionBoundSpec `__ to the `output` stream. .. index:: PartitionCmd .. function:: partition_cmd(node, output) Pretty print a `node` of type `PartitionCmd `__ to the `output` stream. .. index:: PartitionElem .. function:: partition_elem(node, output) Pretty print a `node` of type `PartitionElem `__ to the `output` stream. .. index:: PartitionRangeDatum .. function:: partition_range_datum(node, output) Pretty print a `node` of type `PartitionRangeDatum `__ to the `output` stream. .. index:: PartitionSpec .. function:: partition_spec(node, output) Pretty print a `node` of type `PartitionSpec `__ to the `output` stream. .. index:: PublicationObjSpec .. function:: publication_obj_spec(node, output) Pretty print a `node` of type `PublicationObjSpec `__ to the `output` stream. .. index:: PublicationTable .. function:: publication_table(node, output) Pretty print a `node` of type `PublicationTable `__ to the `output` stream. .. index:: ReindexStmt .. function:: reindex_stmt(node, output) Pretty print a `node` of type `ReindexStmt `__ to the `output` stream. .. index:: pair: ReindexStmt;DefElem .. function:: reindex_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `ReindexStmt `__, to the `output` stream. .. index:: RenameStmt .. function:: rename_stmt(node, output) Pretty print a `node` of type `RenameStmt `__ to the `output` stream. .. index:: pair: RenameStmt;RangeVar .. function:: rename_stmt_range_var(node, output) Pretty print a `node` of type `RangeVar `__, when it is inside a `RenameStmt `__, to the `output` stream. .. index:: ReplicaIdentityStmt .. function:: replica_identity_stmt(node, output) Pretty print a `node` of type `ReplicaIdentityStmt `__ to the `output` stream. .. index:: RoleSpec .. function:: role_spec(node, output) Pretty print a `node` of type `RoleSpec `__ to the `output` stream. .. index:: RuleStmt .. function:: rule_stmt_printer(node, output) Pretty print a `node` of type `RuleStmt `__ to the `output` stream. .. index:: RefreshMatViewStmt .. function:: refresh_mat_view_stmt(node, output) Pretty print a `node` of type `RefreshMatViewStmt `__ to the `output` stream. .. index:: ReassignOwnedStmt .. function:: reassign_owned_stmt(node, output) Pretty print a `node` of type `ReassignOwnedStmt `__ to the `output` stream. .. index:: ReturnStmt .. function:: return_stmt(node, output) Pretty print a `node` of type `ReturnStmt `__ to the `output` stream. .. index:: SecLabelStmt .. function:: sec_label_stmt(node, output) Pretty print a `node` of type `SecLabelStmt `__ to the `output` stream. .. index:: StatsElem .. function:: stats_elem(node, output) Pretty print a `node` of type `StatsElem `__ to the `output` stream. .. index:: TableLikeClause .. function:: table_like_clause(node, output) Pretty print a `node` of type `TableLikeClause `__ to the `output` stream. .. index:: TriggerTransition .. function:: trigger_transition(node, output) Pretty print a `node` of type `TriggerTransition `__ to the `output` stream. .. index:: VacuumStmt .. function:: vacuum_stmt(node, output) Pretty print a `node` of type `VacuumStmt `__ to the `output` stream. .. index:: pair: VacuumStmt;DefElem .. function:: vacuum_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `VacuumStmt `__, to the `output` stream. .. index:: VacuumRelation .. function:: vacuum_relation(node, output) Pretty print a `node` of type `VacuumRelation `__ to the `output` stream. .. index:: VariableSetStmt .. function:: variable_set_stmt(node, output) Pretty print a `node` of type `VariableSetStmt `__ to the `output` stream. .. index:: VariableShowStmt .. function:: variable_show_statement(node, output) Pretty print a `node` of type `VariableShowStmt `__ to the `output` stream. .. index:: ViewStmt .. function:: view_stmt(node, output) Pretty print a `node` of type `ViewStmt `__ to the `output` stream. .. index:: pair: ViewStmt;DefElem .. function:: view_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `ViewStmt `__, to the `output` stream. pglast-7.7/docs/development.rst000066400000000000000000000165661477366773500167340ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Development .. :Created: gio 10 ago 2017 10:04:43 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2022, 2023, 2024 Lele Gaifax .. ============= Development ============= There is a set of *makefiles* implementing the most common operations, a ``make help`` will show a brief table of contents. A comprehensive test suite, based on pytest__, covers__ nearly 99% of the source lines. __ https://docs.pytest.org/en/latest/ __ https://codecov.io/gh/lelit/pglast/branch/v3/ History ------- For a more detailed evolution steps see :ref:`changes`. Version 1 ######### I needed a better SQL reformatter than the one implemented by `sqlparse`__, and was annoyed by a few glitches (subselects__ in particular) that ruins the otherwise excellent job it does, considering that it is a generic library that tries to swallow many different SQL dialects. __ https://pypi.org/project/sqlparse/ __ https://github.com/andialbrecht/sqlparse/issues/334 When I found `psqlparse`__ I decided to try implementing a PostgreSQL `focused tool`__: at the beginning it's been easier than I feared, but I quickly hit some shortcomings in that implementation, so I opted for writing my own solution restarting from scratch, with the following goals: __ https://github.com/alculquicondor/psqlparse __ https://github.com/alculquicondor/psqlparse/pull/22 - target only Python 3.4+ - target PostgreSQL 10+ - use a more dynamic approach to represent the *parse tree*, with a twofold advantage: 1. it is much less boring to code, because there's no need to write one Python class for each PostgreSQL node tag 2. the representation is version agnostic, it can be adapted to newer/older Elephants in a snap - allow exploration of parse tree in both directions, because I realized that some kinds of nodes require that knowledge to determine their textual representation - avoid introducing arbitrary renames of tags and attributes, so what you read in PostgreSQL documentation/sources is available without the hassle of guessing how a symbol has been mapped - use a `zero copy`__ approach, keeping the original parse tree returned from the underlying libpg_query functions and have each node just borrow a reference to its own subtree __ https://en.wikipedia.org/wiki/Zero-copy Version 2 ######### In late 2019, Ronan__ opened `PR #62`__ against ``libpg_query``, that reimplemented the build machinery of the library to make it easier (read, semi-automatic) to support PostgreSQL 12, and `PR #36`__ to bring ``pglast`` in line. __ https://github.com/rdunklau __ https://github.com/pganalyze/libpg_query/pull/62 __ https://github.com/lelit/pglast/pull/36 Since that version of PostgreSQL inevitably introduced some backward incompatibilities, I bumped the major version of ``pglast`` to better reflect the fact. This version only had some `development releases`__, since ``PR #62`` has been superseded__. __ https://pypi.org/project/pglast/2.0.dev3/ __ https://github.com/pganalyze/libpg_query/pull/62#issuecomment-801659703 .. important:: This version requires Python 3.6 or greater, due to usage of `f-strings`. Version 3 ######### In early 2021, Lukas__ put a considerable effort into evolving his library to target PostgreSQL 13. He introduced a richer `protobuf`__\-based AST serialization protocol, rewriting the underlying machinery so that the same code is used to generate either a ``JSON`` or a ``protobuf`` stream. __ https://github.com/lfittl __ https://developers.google.com/protocol-buffers The approach has obvious advantages, but unfortunately both formats come with different shortcomings, and I was not able to adapt ``pglast``. The ``JSON`` serialization has changed in a way that it is not sufficient anymore to rebuild the original ``AST`` because some attributes now carry an *implicit* structure, that requires additional information to understand the content (see issue `#82`__). OTOH, the ``Protobuf`` format is clumsy, at least on the Python side: the Google's compiler creates a huge and unreadable module, while other implementations (see `pyrobuf`__, `cprotobuf`__ and `betterproto`__) suffer of different issues (see issue `#210`__). __ https://github.com/pganalyze/libpg_query/issues/82#issuecomment-782616284 __ https://github.com/appnexus/pyrobuf __ https://github.com/yihuang/cprotobuf __ https://github.com/danielgtaylor/python-betterproto __ https://github.com/danielgtaylor/python-betterproto/issues/210 After several attempts, I decided to follow a more rewarding way and implement a native Python wrapper layer on top of PG parser's nodes, :mod:`pglast.ast`. Ronan and Hong__ helped a lot respectively with `PR #72`__ and `PR #77`__. Last but not least, https://bit.io/ kindly sponsored the project. __ https://github.com/hcheng2002cn __ https://github.com/lelit/pglast/pull/72 __ https://github.com/lelit/pglast/pull/77 Version 4 ######### The ultimate goal of this version is targeting ``PostgreSQL 14``, exploiting the combined effort of `Tessa Lisanti`__ and `Wolfgang Walther`__ who upgraded ``libpg_query`` to the latest PG 14 parser that eventually has been finalized in the `14-latest`__ branch. __ https://github.com/tlisanti/libpg_query/tree/14-latest __ https://github.com/wolfgangwalther/libpg_query/tree/pg-14 __ https://github.com/pganalyze/libpg_query/tree/14-latest While I was waiting for that to happen, I simplified the code getting rid of the `wrapper classes`__. They were required in `version 1`_, when ``pglast`` consumed the ``JSON``-serialized parse tree emitted by ``libpg_query`` exposing those structures as generic ``Node``\ s distinguishable by their *tag*. `Version 3`_ retained them, although rewritten on top of the new concrete AST parser nodes, to make them aware of their ancestry, notion required by some printers to choose different representations. Now the lineage is injected directly into the AST nodes by the printer machinery (cheaper than updating/computing it when setting/accessing each *property*) and all the printer functions receive one concrete AST node. __ https://github.com/lelit/pglast/issues/80 Version 5 ######### This version tracks the `15-latest`__ branch of ``libpg_query`` and thus targets ``PostgreSQL 15``: other than handling new statements (`MERGE`__ to mention just one) and revised syntaxes, there are currently no other significant differences from `Version 4`_. __ https://github.com/pganalyze/libpg_query/tree/15-latest __ https://www.postgresql.org/docs/15/sql-merge.html Version 6 ######### This version tracks the `16-latest`__ branch of ``libpg_query`` and thus targets ``PostgreSQL 16``: other than handling new statements (most notably, ``SQL/JSON`` constructor functions like ``json_array()`` or aggregators such as ``json_objectagg()``) and revised syntaxes, there are currently no other significant differences from `Version 5`_. __ https://github.com/pganalyze/libpg_query/tree/16-latest Version 7 ######### This version tracks the `17-latest`__ branch of ``libpg_query`` and thus targets ``PostgreSQL 17``: other than handling new statements (most notably, more ``SQL/JSON`` functions like ``json_table()`` or ``json_query()``) and revised syntaxes, there are currently no other significant differences from `Version 6`_. __ https://github.com/pganalyze/libpg_query/tree/17-latest .. toctree:: :maxdepth: 2 changes pglast-7.7/docs/dml.rst000066400000000000000000000701051477366773500151530ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ====================================================== :mod:`pglast.printers.dml` --- DML printer functions ====================================================== .. module:: pglast.printers.dml :synopsis: DML printer functions .. index:: A_ArrayExpr .. function:: a_array_expr(node, output) Pretty print a `node` of type `A_ArrayExpr `__ to the `output` stream. .. index:: A_Const .. function:: a_const(node, output) Pretty print a `node` of type `A_Const `__ to the `output` stream. .. index:: A_Expr .. function:: a_expr(node, output) Pretty print a `node` of type `A_Expr `__ to the `output` stream. .. index:: A_Indices .. function:: a_indices(node, output) Pretty print a `node` of type `A_Indices `__ to the `output` stream. .. index:: A_Indirection .. function:: a_indirection(node, output) Pretty print a `node` of type `A_Indirection `__ to the `output` stream. .. index:: pair: A_Indirection;A_Star .. function:: a_indirection_a_star(node, output) Pretty print a `node` of type `A_Star `__, when it is inside a `A_Indirection `__, to the `output` stream. .. index:: pair: A_Indirection;ColumnRef .. function:: a_indirection_column_ref(node, output) Pretty print a `node` of type `ColumnRef `__, when it is inside a `A_Indirection `__, to the `output` stream. .. index:: pair: A_Indirection;FuncCall .. function:: a_indirection_func_call(node, output) Pretty print a `node` of type `FuncCall `__, when it is inside a `A_Indirection `__, to the `output` stream. .. index:: pair: A_Indirection;String .. function:: a_indirection_field(node, output) Pretty print a `node` of type `String `__, when it is inside a `A_Indirection `__, to the `output` stream. .. index:: A_Star .. function:: a_star(node, output) Pretty print a `node` of type `A_Star `__ to the `output` stream. .. index:: Alias .. function:: alias(node, output) Pretty print a `node` of type `Alias `__ to the `output` stream. .. index:: BitString .. function:: bitstring(node, output) Pretty print a `node` of type `BitString `__ to the `output` stream. .. index:: Boolean .. function:: boolean(node, output) Pretty print a `node` of type `Boolean `__ to the `output` stream. .. index:: BoolExpr .. function:: bool_expr(node, output) Pretty print a `node` of type `BoolExpr `__ to the `output` stream. .. index:: BooleanTest .. function:: boolean_test(node, output) Pretty print a `node` of type `BooleanTest `__ to the `output` stream. .. index:: CallStmt .. function:: call_stmt(node, output) Pretty print a `node` of type `CallStmt `__ to the `output` stream. .. index:: CaseExpr .. function:: case_expr(node, output) Pretty print a `node` of type `CaseExpr `__ to the `output` stream. .. index:: CaseWhen .. function:: case_when(node, output) Pretty print a `node` of type `CaseWhen `__ to the `output` stream. .. index:: CoalesceExpr .. function:: coalesce_expr(node, output) Pretty print a `node` of type `CoalesceExpr `__ to the `output` stream. .. index:: CollateClause .. function:: collate_clause(node, output) Pretty print a `node` of type `CollateClause `__ to the `output` stream. .. index:: ColumnRef .. function:: column_ref(node, output) Pretty print a `node` of type `ColumnRef `__ to the `output` stream. .. index:: CTECycleClause .. function:: cte_cycle_clause(node, output) Pretty print a `node` of type `CTECycleClause `__ to the `output` stream. .. index:: pair: CTECycleClause;TypeCast .. function:: cte_cycle_clause_type_cast(node, output) Pretty print a `node` of type `TypeCast `__, when it is inside a `CTECycleClause `__, to the `output` stream. .. index:: CTESearchClause .. function:: cte_search_clause(node, output) Pretty print a `node` of type `CTESearchClause `__ to the `output` stream. .. index:: CommonTableExpr .. function:: common_table_expr(node, output) Pretty print a `node` of type `CommonTableExpr `__ to the `output` stream. .. index:: ConstraintsSetStmt .. function:: constraints_set_stmt(node, output) Pretty print a `node` of type `ConstraintsSetStmt `__ to the `output` stream. .. index:: CopyStmt .. function:: copy_stmt(node, output) Pretty print a `node` of type `CopyStmt `__ to the `output` stream. .. index:: pair: CopyStmt;DefElem .. function:: copy_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `CopyStmt `__, to the `output` stream. .. index:: DeclareCursorStmt .. function:: declare_cursor_stmt(node, output) Pretty print a `node` of type `DeclareCursorStmt `__ to the `output` stream. .. index:: DeleteStmt .. function:: delete_stmt(node, output) Pretty print a `node` of type `DeleteStmt `__ to the `output` stream. .. index:: ExecuteStmt .. function:: execute_stmt(node, output) Pretty print a `node` of type `ExecuteStmt `__ to the `output` stream. .. index:: ExplainStmt .. function:: explain_stmt(node, output) Pretty print a `node` of type `ExplainStmt `__ to the `output` stream. .. index:: pair: ExplainStmt;DefElem .. function:: explain_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `ExplainStmt `__, to the `output` stream. .. index:: FetchStmt .. function:: fetch_stmt(node, output) Pretty print a `node` of type `FetchStmt `__ to the `output` stream. .. index:: Float .. function:: float(node, output) Pretty print a `node` of type `Float `__ to the `output` stream. .. index:: FuncCall .. function:: func_call(node, output) Pretty print a `node` of type `FuncCall `__ to the `output` stream. .. index:: pair: FuncCall;WindowDef .. function:: func_call_window_def(node, output) Pretty print a `node` of type `WindowDef `__, when it is inside a `FuncCall `__, to the `output` stream. .. index:: GroupingSet .. function:: grouping_set(node, output) Pretty print a `node` of type `GroupingSet `__ to the `output` stream. .. index:: GroupingFunc .. function:: grouping_func(node, output) Pretty print a `node` of type `GroupingFunc `__ to the `output` stream. .. index:: IndexElem .. function:: index_elem(node, output) Pretty print a `node` of type `IndexElem `__ to the `output` stream. .. index:: InferClause .. function:: infer_clause(node, output) Pretty print a `node` of type `InferClause `__ to the `output` stream. .. index:: Integer .. function:: integer(node, output) Pretty print a `node` of type `Integer `__ to the `output` stream. .. index:: InsertStmt .. function:: insert_stmt(node, output) Pretty print a `node` of type `InsertStmt `__ to the `output` stream. .. index:: IntoClause .. function:: into_clause(node, output) Pretty print a `node` of type `IntoClause `__ to the `output` stream. .. index:: JoinExpr .. function:: join_expr(node, output) Pretty print a `node` of type `JoinExpr `__ to the `output` stream. .. index:: JsonAggConstructor .. function:: json_agg_constructor(node, output) Pretty print a `node` of type `JsonAggConstructor `__ to the `output` stream. .. index:: JsonArgument .. function:: json_argument(node, output) Pretty print a `node` of type `JsonArgument `__ to the `output` stream. .. index:: JsonArrayAgg .. function:: json_array_agg(node, output) Pretty print a `node` of type `JsonArrayAgg `__ to the `output` stream. .. index:: JsonArrayConstructor .. function:: json_array_constructor(node, output) Pretty print a `node` of type `JsonArrayConstructor `__ to the `output` stream. .. index:: JsonArrayQueryConstructor .. function:: json_array_query_constructor(node, output) Pretty print a `node` of type `JsonArrayQueryConstructor `__ to the `output` stream. .. index:: JsonBehavior .. function:: json_behavior(node, output) Pretty print a `node` of type `JsonBehavior `__ to the `output` stream. .. index:: JsonFormat .. function:: json_format(node, output) Pretty print a `node` of type `JsonFormat `__ to the `output` stream. .. index:: JsonFuncExpr .. function:: json_func_expr(node, output) Pretty print a `node` of type `JsonFuncExpr `__ to the `output` stream. .. index:: JsonIsPredicate .. function:: json_is_predicate(node, output) Pretty print a `node` of type `JsonIsPredicate `__ to the `output` stream. .. index:: JsonKeyValue .. function:: json_key_value(node, output) Pretty print a `node` of type `JsonKeyValue `__ to the `output` stream. .. index:: JsonObjectAgg .. function:: json_object_agg(node, output) Pretty print a `node` of type `JsonObjectAgg `__ to the `output` stream. .. index:: JsonObjectConstructor .. function:: json_object_constructor(node, output) Pretty print a `node` of type `JsonObjectConstructor `__ to the `output` stream. .. index:: JsonOutput .. function:: json_output(node, output) Pretty print a `node` of type `JsonOutput `__ to the `output` stream. .. index:: JsonParseExpr .. function:: json_parse_expr(node, output) Pretty print a `node` of type `JsonParseExpr `__ to the `output` stream. .. index:: JsonReturning .. function:: json_returning(node, output) Pretty print a `node` of type `JsonReturning `__ to the `output` stream. .. index:: JsonScalarExpr .. function:: json_scalar_expr(node, output) Pretty print a `node` of type `JsonScalarExpr `__ to the `output` stream. .. index:: JsonSerializeExpr .. function:: json_serialize_expr(node, output) Pretty print a `node` of type `JsonSerializeExpr `__ to the `output` stream. .. index:: JsonTable .. function:: json_table(node, output) Pretty print a `node` of type `JsonTable `__ to the `output` stream. .. index:: JsonTableColumn .. function:: json_table_column(node, output) Pretty print a `node` of type `JsonTableColumn `__ to the `output` stream. .. index:: JsonTablePathSpec .. function:: json_table_path_spec(node, output) Pretty print a `node` of type `JsonTablePathSpec `__ to the `output` stream. .. index:: JsonValueExpr .. function:: json_value_expr(node, output) Pretty print a `node` of type `JsonValueExpr `__ to the `output` stream. .. index:: LockingClause .. function:: locking_clause(node, output) Pretty print a `node` of type `LockingClause `__ to the `output` stream. .. index:: ListenStmt .. function:: listen_stmt(node, output) Pretty print a `node` of type `ListenStmt `__ to the `output` stream. .. index:: MergeStmt .. function:: merge_stmt(node, output) Pretty print a `node` of type `MergeStmt `__ to the `output` stream. .. index:: MergeSupportFunc .. function:: merge_support_func(node, output) Pretty print a `node` of type `MergeSupportFunc `__ to the `output` stream. .. index:: MergeWhenClause .. function:: merge_when_clause(node, output) Pretty print a `node` of type `MergeWhenClause `__ to the `output` stream. .. index:: MinMaxExpr .. function:: min_max_expr(node, output) Pretty print a `node` of type `MinMaxExpr `__ to the `output` stream. .. index:: MultiAssignRef .. function:: multi_assign_ref(node, output) Pretty print a `node` of type `MultiAssignRef `__ to the `output` stream. .. index:: NamedArgExpr .. function:: named_arg_expr(node, output) Pretty print a `node` of type `NamedArgExpr `__ to the `output` stream. .. index:: NullTest .. function:: null_test(node, output) Pretty print a `node` of type `NullTest `__ to the `output` stream. .. index:: ParamRef .. function:: param_ref(node, output) Pretty print a `node` of type `ParamRef `__ to the `output` stream. .. index:: PrepareStmt .. function:: prepare_stmt(node, output) Pretty print a `node` of type `PrepareStmt `__ to the `output` stream. .. index:: OnConflictClause .. function:: on_conflict_clause(node, output) Pretty print a `node` of type `OnConflictClause `__ to the `output` stream. .. index:: RangeFunction .. function:: range_function(node, output) Pretty print a `node` of type `RangeFunction `__ to the `output` stream. .. index:: RangeSubselect .. function:: range_subselect(node, output) Pretty print a `node` of type `RangeSubselect `__ to the `output` stream. .. index:: RangeTableFunc .. function:: range_table_func(node, output) Pretty print a `node` of type `RangeTableFunc `__ to the `output` stream. .. index:: pair: RangeTableFunc;ResTarget .. function:: range_table_func_res_target(node, output) Pretty print a `node` of type `ResTarget `__, when it is inside a `RangeTableFunc `__, to the `output` stream. .. index:: RangeTableFuncCol .. function:: range_table_func_col(node, output) Pretty print a `node` of type `RangeTableFuncCol `__ to the `output` stream. .. index:: RangeVar .. function:: range_var(node, output) Pretty print a `node` of type `RangeVar `__ to the `output` stream. .. index:: RangeTableSample .. function:: range_table_sample(node, output) Pretty print a `node` of type `RangeTableSample `__ to the `output` stream. .. index:: RawStmt .. function:: raw_stmt(node, output) Pretty print a `node` of type `RawStmt `__ to the `output` stream. .. index:: ResTarget .. function:: res_target(node, output) Pretty print a `node` of type `ResTarget `__ to the `output` stream. .. index:: RowExpr .. function:: row_expr(node, output) Pretty print a `node` of type `RowExpr `__ to the `output` stream. .. index:: SelectStmt .. function:: select_stmt(node, output) Pretty print a `node` of type `SelectStmt `__ to the `output` stream. .. index:: SetToDefault .. function:: set_to_default(node, output) Pretty print a `node` of type `SetToDefault `__ to the `output` stream. .. index:: SortBy .. function:: sort_by(node, output) Pretty print a `node` of type `SortBy `__ to the `output` stream. .. index:: SQLValueFunction .. function:: sql_value_function(node, output) Pretty print a `node` of type `SQLValueFunction `__ to the `output` stream. .. index:: String .. function:: string(node, output) Pretty print a `node` of type `String `__ to the `output` stream. .. index:: SubLink .. function:: sub_link(node, output) Pretty print a `node` of type `SubLink `__ to the `output` stream. .. index:: TransactionStmt .. function:: transaction_stmt(node, output) Pretty print a `node` of type `TransactionStmt `__ to the `output` stream. .. index:: pair: TransactionStmt;DefElem .. function:: transaction_stmt_def_elem(node, output) Pretty print a `node` of type `DefElem `__, when it is inside a `TransactionStmt `__, to the `output` stream. .. index:: TruncateStmt .. function:: truncate_stmt(node, output) Pretty print a `node` of type `TruncateStmt `__ to the `output` stream. .. index:: TypeCast .. function:: type_cast(node, output) Pretty print a `node` of type `TypeCast `__ to the `output` stream. .. index:: TypeName .. function:: type_name(node, output) Pretty print a `node` of type `TypeName `__ to the `output` stream. .. index:: pair: VariableSetStmt;TypeCast .. function:: variable_set_stmt_type_cast(node, output) Pretty print a `node` of type `TypeCast `__, when it is inside a `VariableSetStmt `__, to the `output` stream. .. index:: UpdateStmt .. function:: update_stmt(node, output) Pretty print a `node` of type `UpdateStmt `__ to the `output` stream. .. index:: UnlistenStmt .. function:: unlisten_stmt(node, output) Pretty print a `node` of type `UnlistenStmt `__ to the `output` stream. .. index:: WithClause .. function:: with_clause(node, output) Pretty print a `node` of type `WithClause `__ to the `output` stream. .. index:: WindowDef .. function:: window_def(node, output) Pretty print a `node` of type `WindowDef `__ to the `output` stream. .. index:: pair: MergeWhenClause;ResTarget .. index:: pair: OnConflictClause;ResTarget .. index:: pair: UpdateStmt;ResTarget .. function:: update_stmt_res_target(node, output) Pretty print a `node` of type `ResTarget `__, when it is inside a `MergeWhenClause `__ or a `OnConflictClause `__ or a `UpdateStmt `__, to the `output` stream. .. index:: XmlExpr .. function:: xml_expr(node, output) Pretty print a `node` of type `XmlExpr `__ to the `output` stream. .. index:: XmlSerialize .. function:: xml_serialize(node, output) Pretty print a `node` of type `XmlSerialize `__ to the `output` stream. pglast-7.7/docs/enums.rst000066400000000000000000000020401477366773500155170ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Enums documentation .. :Created: gio 10 ago 2017 12:44:33 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2019, 2021, 2024 Lele Gaifax .. ================================================ :mod:`pglast.enums` --- Enumerated constants ================================================ .. module:: pglast.enums :synopsis: Enumerated constants This module contains all the constants that are used to give a meaning to some *scalar* values of the various kinds of nodes, extracted automatically from the PostgreSQL headers. From ``include/catalog`` ======================== .. toctree:: pg_am pg_attribute pg_class pg_trigger From ``include/nodes`` ====================== .. toctree:: lockoptions nodes parsenodes primnodes From ``include/storage`` ======================== .. toctree:: lockdefs From ``include/utils`` ====================== .. toctree:: xml pglast-7.7/docs/index.rst000066400000000000000000000023561477366773500155110ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Documentation .. :Created: gio 10 ago 2017 09:56:59 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2019, 2021, 2022, 2023, 2024 Lele Gaifax .. ======== pglast ======== PostgreSQL Languages AST and statements prettifier ================================================== :author: Lele Gaifax :contact: lele@metapensiero.it :license: `GNU General Public License version 3 or later`__ :version: `7`__ __ https://www.gnu.org/licenses/gpl.html __ https://pglast.readthedocs.io/en/v7/introduction.html This is a Python 3 module that exposes the *parse tree* of a PostgreSQL__ statement (extracted by the almost standard PG parser repackaged as a standalone static library by `libpg_query`__) as set of interconnected *nodes*, usually called an `abstract syntax tree`__. __ https://www.postgresql.org/ __ https://github.com/pganalyze/libpg_query __ https://en.wikipedia.org/wiki/Abstract_syntax_tree .. toctree:: :maxdepth: 2 :caption: Contents: introduction installation development usage api Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` pglast-7.7/docs/installation.rst000066400000000000000000000010431477366773500170730ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Installation .. :Created: gio 10 ago 2017 10:03:58 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2024 Lele Gaifax .. ============== Installation ============== As usual, the easiest way is with pip:: $ pip install pglast Alternatively you can clone the repository:: $ git clone https://github.com/lelit/pglast.git --recursive and install from there:: $ pip install ./pglast pglast-7.7/docs/introduction.rst000066400000000000000000000036151477366773500171220ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Introduction .. :Created: gio 10 ago 2017 10:03:30 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2024 Lele Gaifax .. ============== Introduction ============== At the lower level the module exposes several `libpg_query`__ functions: __ https://github.com/pganalyze/libpg_query 1. :func:`pglast.parser.parse_sql_json()` 2. :func:`pglast.parser.parse_sql_protobuf()` 3. :func:`pglast.parser.parse_plpgsql_json()` 4. :func:`pglast.parser.fingerprint()` 5. :func:`pglast.parser.scan()` 6. :func:`pglast.parser.split()` 7. :func:`pglast.parser.deparse_protobuf()` The first two take an ``SQL`` statement and return the correspondent *parse tree* respectively as a ``JSON`` encoded value and a ``Protobuf`` encoded value; the third function takes a ``PLpgSQL`` statement and returns the *parse tree* as ``JSON``, the fourth returns an *hash* of the given statement that can be used to compare different ``SQL``\ s, the fifth returns a sequence of *tokens* that compose a ``SQL`` statement, the sixth returns a sequence of the single statements and the last one accepts a ``Protobuf``\ -serialized statement and reproduce the original ``SQL`` statement. One more function, :func:`pglast.parser.parse_sql()`, is similar to ``parse_sql_json()`` but instead of ``JSON`` returns the syntax tree represented by a hierarchy of instances of the classes implemented in the :mod:`pglast.ast` module. On top of that, the module implements two serializations, one that transforms a ``Node`` into a :class:`raw ` textual representation and another that returns a :class:`prettified ` section of the :ref:`examples of usage `. pglast-7.7/docs/keywords.rst000066400000000000000000000013731477366773500162470ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — PG keywords .. :Created: gio 10 ago 2017 13:16:54 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2024 Lele Gaifax .. ================================================================= :mod:`pglast.keywords` --- Various kinds of PostgreSQL keywords ================================================================= .. module:: pglast.keywords :synopsis: Various kinds of PostgreSQL keywords This module contains the set of PostgreSQL keywords grouped by their characteristic. .. data:: COL_NAME_KEYWORDS .. data:: RESERVED_KEYWORDS .. data:: TYPE_FUNC_NAME_KEYWORDS .. data:: UNRESERVED_KEYWORDS pglast-7.7/docs/lockdefs.rst000066400000000000000000000042511477366773500161700ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ========================================================================== :mod:`pglast.enums.lockdefs` --- Constants extracted from `lockdefs.h`__ ========================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/storage/lockdefs.h .. module:: pglast.enums.lockdefs :synopsis: Constants extracted from lockdefs.h .. data:: NoLock See `here for details `__. .. data:: AccessShareLock See `here for details `__. .. data:: RowShareLock See `here for details `__. .. data:: RowExclusiveLock See `here for details `__. .. data:: ShareUpdateExclusiveLock See `here for details `__. .. data:: ShareLock See `here for details `__. .. data:: ShareRowExclusiveLock See `here for details `__. .. data:: ExclusiveLock See `here for details `__. .. data:: AccessExclusiveLock See `here for details `__. .. data:: MaxLockMode See `here for details `__. pglast-7.7/docs/lockoptions.rst000066400000000000000000000031531477366773500167420ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ================================================================================ :mod:`pglast.enums.lockoptions` --- Constants extracted from `lockoptions.h`__ ================================================================================ __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/nodes/lockoptions.h .. module:: pglast.enums.lockoptions :synopsis: Constants extracted from lockoptions.h .. class:: pglast.enums.lockoptions.LockClauseStrength Corresponds to the `LockClauseStrength enum `__. .. data:: LCS_NONE .. data:: LCS_FORKEYSHARE .. data:: LCS_FORSHARE .. data:: LCS_FORNOKEYUPDATE .. data:: LCS_FORUPDATE .. class:: pglast.enums.lockoptions.LockTupleMode Corresponds to the `LockTupleMode enum `__. .. data:: LockTupleKeyShare .. data:: LockTupleShare .. data:: LockTupleNoKeyExclusive .. data:: LockTupleExclusive .. class:: pglast.enums.lockoptions.LockWaitPolicy Corresponds to the `LockWaitPolicy enum `__. .. data:: LockWaitBlock .. data:: LockWaitSkip .. data:: LockWaitError pglast-7.7/docs/nodes.rst000066400000000000000000000435421477366773500155140ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ==================================================================== :mod:`pglast.enums.nodes` --- Constants extracted from `nodes.h`__ ==================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/nodes/nodes.h .. module:: pglast.enums.nodes :synopsis: Constants extracted from nodes.h .. class:: pglast.enums.nodes.AggSplit Corresponds to the `AggSplit enum `__. .. data:: AGGSPLIT_SIMPLE .. data:: AGGSPLIT_INITIAL_SERIAL .. data:: AGGSPLIT_FINAL_DESERIAL .. class:: pglast.enums.nodes.AggStrategy Corresponds to the `AggStrategy enum `__. .. data:: AGG_PLAIN .. data:: AGG_SORTED .. data:: AGG_HASHED .. data:: AGG_MIXED .. class:: pglast.enums.nodes.CmdType Corresponds to the `CmdType enum `__. .. data:: CMD_UNKNOWN .. data:: CMD_SELECT .. data:: CMD_UPDATE .. data:: CMD_INSERT .. data:: CMD_DELETE .. data:: CMD_MERGE .. data:: CMD_UTILITY .. data:: CMD_NOTHING .. class:: pglast.enums.nodes.JoinType Corresponds to the `JoinType enum `__. .. data:: JOIN_INNER .. data:: JOIN_LEFT .. data:: JOIN_FULL .. data:: JOIN_RIGHT .. data:: JOIN_SEMI .. data:: JOIN_ANTI .. data:: JOIN_RIGHT_ANTI .. data:: JOIN_UNIQUE_OUTER .. data:: JOIN_UNIQUE_INNER .. class:: pglast.enums.nodes.LimitOption Corresponds to the `LimitOption enum `__. .. data:: LIMIT_OPTION_DEFAULT .. data:: LIMIT_OPTION_COUNT .. data:: LIMIT_OPTION_WITH_TIES .. class:: pglast.enums.nodes.NodeTag Corresponds to the `NodeTag enum `__. .. data:: T_Invalid .. data:: T_List .. data:: T_Alias .. data:: T_RangeVar .. data:: T_TableFunc .. data:: T_IntoClause .. data:: T_Var .. data:: T_Const .. data:: T_Param .. data:: T_Aggref .. data:: T_GroupingFunc .. data:: T_WindowFunc .. data:: T_WindowFuncRunCondition .. data:: T_MergeSupportFunc .. data:: T_SubscriptingRef .. data:: T_FuncExpr .. data:: T_NamedArgExpr .. data:: T_OpExpr .. data:: T_DistinctExpr .. data:: T_NullIfExpr .. data:: T_ScalarArrayOpExpr .. data:: T_BoolExpr .. data:: T_SubLink .. data:: T_SubPlan .. data:: T_AlternativeSubPlan .. data:: T_FieldSelect .. data:: T_FieldStore .. data:: T_RelabelType .. data:: T_CoerceViaIO .. data:: T_ArrayCoerceExpr .. data:: T_ConvertRowtypeExpr .. data:: T_CollateExpr .. data:: T_CaseExpr .. data:: T_CaseWhen .. data:: T_CaseTestExpr .. data:: T_ArrayExpr .. data:: T_RowExpr .. data:: T_RowCompareExpr .. data:: T_CoalesceExpr .. data:: T_MinMaxExpr .. data:: T_SQLValueFunction .. data:: T_XmlExpr .. data:: T_JsonFormat .. data:: T_JsonReturning .. data:: T_JsonValueExpr .. data:: T_JsonConstructorExpr .. data:: T_JsonIsPredicate .. data:: T_JsonBehavior .. data:: T_JsonExpr .. data:: T_JsonTablePath .. data:: T_JsonTablePathScan .. data:: T_JsonTableSiblingJoin .. data:: T_NullTest .. data:: T_BooleanTest .. data:: T_MergeAction .. data:: T_CoerceToDomain .. data:: T_CoerceToDomainValue .. data:: T_SetToDefault .. data:: T_CurrentOfExpr .. data:: T_NextValueExpr .. data:: T_InferenceElem .. data:: T_TargetEntry .. data:: T_RangeTblRef .. data:: T_JoinExpr .. data:: T_FromExpr .. data:: T_OnConflictExpr .. data:: T_Query .. data:: T_TypeName .. data:: T_ColumnRef .. data:: T_ParamRef .. data:: T_A_Expr .. data:: T_A_Const .. data:: T_TypeCast .. data:: T_CollateClause .. data:: T_RoleSpec .. data:: T_FuncCall .. data:: T_A_Star .. data:: T_A_Indices .. data:: T_A_Indirection .. data:: T_A_ArrayExpr .. data:: T_ResTarget .. data:: T_MultiAssignRef .. data:: T_SortBy .. data:: T_WindowDef .. data:: T_RangeSubselect .. data:: T_RangeFunction .. data:: T_RangeTableFunc .. data:: T_RangeTableFuncCol .. data:: T_RangeTableSample .. data:: T_ColumnDef .. data:: T_TableLikeClause .. data:: T_IndexElem .. data:: T_DefElem .. data:: T_LockingClause .. data:: T_XmlSerialize .. data:: T_PartitionElem .. data:: T_PartitionSpec .. data:: T_PartitionBoundSpec .. data:: T_PartitionRangeDatum .. data:: T_SinglePartitionSpec .. data:: T_PartitionCmd .. data:: T_RangeTblEntry .. data:: T_RTEPermissionInfo .. data:: T_RangeTblFunction .. data:: T_TableSampleClause .. data:: T_WithCheckOption .. data:: T_SortGroupClause .. data:: T_GroupingSet .. data:: T_WindowClause .. data:: T_RowMarkClause .. data:: T_WithClause .. data:: T_InferClause .. data:: T_OnConflictClause .. data:: T_CTESearchClause .. data:: T_CTECycleClause .. data:: T_CommonTableExpr .. data:: T_MergeWhenClause .. data:: T_TriggerTransition .. data:: T_JsonOutput .. data:: T_JsonArgument .. data:: T_JsonFuncExpr .. data:: T_JsonTablePathSpec .. data:: T_JsonTable .. data:: T_JsonTableColumn .. data:: T_JsonKeyValue .. data:: T_JsonParseExpr .. data:: T_JsonScalarExpr .. data:: T_JsonSerializeExpr .. data:: T_JsonObjectConstructor .. data:: T_JsonArrayConstructor .. data:: T_JsonArrayQueryConstructor .. data:: T_JsonAggConstructor .. data:: T_JsonObjectAgg .. data:: T_JsonArrayAgg .. data:: T_RawStmt .. data:: T_InsertStmt .. data:: T_DeleteStmt .. data:: T_UpdateStmt .. data:: T_MergeStmt .. data:: T_SelectStmt .. data:: T_SetOperationStmt .. data:: T_ReturnStmt .. data:: T_PLAssignStmt .. data:: T_CreateSchemaStmt .. data:: T_AlterTableStmt .. data:: T_ReplicaIdentityStmt .. data:: T_AlterTableCmd .. data:: T_AlterCollationStmt .. data:: T_AlterDomainStmt .. data:: T_GrantStmt .. data:: T_ObjectWithArgs .. data:: T_AccessPriv .. data:: T_GrantRoleStmt .. data:: T_AlterDefaultPrivilegesStmt .. data:: T_CopyStmt .. data:: T_VariableSetStmt .. data:: T_VariableShowStmt .. data:: T_CreateStmt .. data:: T_Constraint .. data:: T_CreateTableSpaceStmt .. data:: T_DropTableSpaceStmt .. data:: T_AlterTableSpaceOptionsStmt .. data:: T_AlterTableMoveAllStmt .. data:: T_CreateExtensionStmt .. data:: T_AlterExtensionStmt .. data:: T_AlterExtensionContentsStmt .. data:: T_CreateFdwStmt .. data:: T_AlterFdwStmt .. data:: T_CreateForeignServerStmt .. data:: T_AlterForeignServerStmt .. data:: T_CreateForeignTableStmt .. data:: T_CreateUserMappingStmt .. data:: T_AlterUserMappingStmt .. data:: T_DropUserMappingStmt .. data:: T_ImportForeignSchemaStmt .. data:: T_CreatePolicyStmt .. data:: T_AlterPolicyStmt .. data:: T_CreateAmStmt .. data:: T_CreateTrigStmt .. data:: T_CreateEventTrigStmt .. data:: T_AlterEventTrigStmt .. data:: T_CreatePLangStmt .. data:: T_CreateRoleStmt .. data:: T_AlterRoleStmt .. data:: T_AlterRoleSetStmt .. data:: T_DropRoleStmt .. data:: T_CreateSeqStmt .. data:: T_AlterSeqStmt .. data:: T_DefineStmt .. data:: T_CreateDomainStmt .. data:: T_CreateOpClassStmt .. data:: T_CreateOpClassItem .. data:: T_CreateOpFamilyStmt .. data:: T_AlterOpFamilyStmt .. data:: T_DropStmt .. data:: T_TruncateStmt .. data:: T_CommentStmt .. data:: T_SecLabelStmt .. data:: T_DeclareCursorStmt .. data:: T_ClosePortalStmt .. data:: T_FetchStmt .. data:: T_IndexStmt .. data:: T_CreateStatsStmt .. data:: T_StatsElem .. data:: T_AlterStatsStmt .. data:: T_CreateFunctionStmt .. data:: T_FunctionParameter .. data:: T_AlterFunctionStmt .. data:: T_DoStmt .. data:: T_InlineCodeBlock .. data:: T_CallStmt .. data:: T_CallContext .. data:: T_RenameStmt .. data:: T_AlterObjectDependsStmt .. data:: T_AlterObjectSchemaStmt .. data:: T_AlterOwnerStmt .. data:: T_AlterOperatorStmt .. data:: T_AlterTypeStmt .. data:: T_RuleStmt .. data:: T_NotifyStmt .. data:: T_ListenStmt .. data:: T_UnlistenStmt .. data:: T_TransactionStmt .. data:: T_CompositeTypeStmt .. data:: T_CreateEnumStmt .. data:: T_CreateRangeStmt .. data:: T_AlterEnumStmt .. data:: T_ViewStmt .. data:: T_LoadStmt .. data:: T_CreatedbStmt .. data:: T_AlterDatabaseStmt .. data:: T_AlterDatabaseRefreshCollStmt .. data:: T_AlterDatabaseSetStmt .. data:: T_DropdbStmt .. data:: T_AlterSystemStmt .. data:: T_ClusterStmt .. data:: T_VacuumStmt .. data:: T_VacuumRelation .. data:: T_ExplainStmt .. data:: T_CreateTableAsStmt .. data:: T_RefreshMatViewStmt .. data:: T_CheckPointStmt .. data:: T_DiscardStmt .. data:: T_LockStmt .. data:: T_ConstraintsSetStmt .. data:: T_ReindexStmt .. data:: T_CreateConversionStmt .. data:: T_CreateCastStmt .. data:: T_CreateTransformStmt .. data:: T_PrepareStmt .. data:: T_ExecuteStmt .. data:: T_DeallocateStmt .. data:: T_DropOwnedStmt .. data:: T_ReassignOwnedStmt .. data:: T_AlterTSDictionaryStmt .. data:: T_AlterTSConfigurationStmt .. data:: T_PublicationTable .. data:: T_PublicationObjSpec .. data:: T_CreatePublicationStmt .. data:: T_AlterPublicationStmt .. data:: T_CreateSubscriptionStmt .. data:: T_AlterSubscriptionStmt .. data:: T_DropSubscriptionStmt .. data:: T_PlannerGlobal .. data:: T_PlannerInfo .. data:: T_RelOptInfo .. data:: T_IndexOptInfo .. data:: T_ForeignKeyOptInfo .. data:: T_StatisticExtInfo .. data:: T_JoinDomain .. data:: T_EquivalenceClass .. data:: T_EquivalenceMember .. data:: T_PathKey .. data:: T_GroupByOrdering .. data:: T_PathTarget .. data:: T_ParamPathInfo .. data:: T_Path .. data:: T_IndexPath .. data:: T_IndexClause .. data:: T_BitmapHeapPath .. data:: T_BitmapAndPath .. data:: T_BitmapOrPath .. data:: T_TidPath .. data:: T_TidRangePath .. data:: T_SubqueryScanPath .. data:: T_ForeignPath .. data:: T_CustomPath .. data:: T_AppendPath .. data:: T_MergeAppendPath .. data:: T_GroupResultPath .. data:: T_MaterialPath .. data:: T_MemoizePath .. data:: T_UniquePath .. data:: T_GatherPath .. data:: T_GatherMergePath .. data:: T_NestPath .. data:: T_MergePath .. data:: T_HashPath .. data:: T_ProjectionPath .. data:: T_ProjectSetPath .. data:: T_SortPath .. data:: T_IncrementalSortPath .. data:: T_GroupPath .. data:: T_UpperUniquePath .. data:: T_AggPath .. data:: T_GroupingSetData .. data:: T_RollupData .. data:: T_GroupingSetsPath .. data:: T_MinMaxAggPath .. data:: T_WindowAggPath .. data:: T_SetOpPath .. data:: T_RecursiveUnionPath .. data:: T_LockRowsPath .. data:: T_ModifyTablePath .. data:: T_LimitPath .. data:: T_RestrictInfo .. data:: T_PlaceHolderVar .. data:: T_SpecialJoinInfo .. data:: T_OuterJoinClauseInfo .. data:: T_AppendRelInfo .. data:: T_RowIdentityVarInfo .. data:: T_PlaceHolderInfo .. data:: T_MinMaxAggInfo .. data:: T_PlannerParamItem .. data:: T_AggInfo .. data:: T_AggTransInfo .. data:: T_PlannedStmt .. data:: T_Result .. data:: T_ProjectSet .. data:: T_ModifyTable .. data:: T_Append .. data:: T_MergeAppend .. data:: T_RecursiveUnion .. data:: T_BitmapAnd .. data:: T_BitmapOr .. data:: T_SeqScan .. data:: T_SampleScan .. data:: T_IndexScan .. data:: T_IndexOnlyScan .. data:: T_BitmapIndexScan .. data:: T_BitmapHeapScan .. data:: T_TidScan .. data:: T_TidRangeScan .. data:: T_SubqueryScan .. data:: T_FunctionScan .. data:: T_ValuesScan .. data:: T_TableFuncScan .. data:: T_CteScan .. data:: T_NamedTuplestoreScan .. data:: T_WorkTableScan .. data:: T_ForeignScan .. data:: T_CustomScan .. data:: T_NestLoop .. data:: T_NestLoopParam .. data:: T_MergeJoin .. data:: T_HashJoin .. data:: T_Material .. data:: T_Memoize .. data:: T_Sort .. data:: T_IncrementalSort .. data:: T_Group .. data:: T_Agg .. data:: T_WindowAgg .. data:: T_Unique .. data:: T_Gather .. data:: T_GatherMerge .. data:: T_Hash .. data:: T_SetOp .. data:: T_LockRows .. data:: T_Limit .. data:: T_PlanRowMark .. data:: T_PartitionPruneInfo .. data:: T_PartitionedRelPruneInfo .. data:: T_PartitionPruneStepOp .. data:: T_PartitionPruneStepCombine .. data:: T_PlanInvalItem .. data:: T_ExprState .. data:: T_IndexInfo .. data:: T_ExprContext .. data:: T_ReturnSetInfo .. data:: T_ProjectionInfo .. data:: T_JunkFilter .. data:: T_OnConflictSetState .. data:: T_MergeActionState .. data:: T_ResultRelInfo .. data:: T_EState .. data:: T_WindowFuncExprState .. data:: T_SetExprState .. data:: T_SubPlanState .. data:: T_DomainConstraintState .. data:: T_ResultState .. data:: T_ProjectSetState .. data:: T_ModifyTableState .. data:: T_AppendState .. data:: T_MergeAppendState .. data:: T_RecursiveUnionState .. data:: T_BitmapAndState .. data:: T_BitmapOrState .. data:: T_ScanState .. data:: T_SeqScanState .. data:: T_SampleScanState .. data:: T_IndexScanState .. data:: T_IndexOnlyScanState .. data:: T_BitmapIndexScanState .. data:: T_BitmapHeapScanState .. data:: T_TidScanState .. data:: T_TidRangeScanState .. data:: T_SubqueryScanState .. data:: T_FunctionScanState .. data:: T_ValuesScanState .. data:: T_TableFuncScanState .. data:: T_CteScanState .. data:: T_NamedTuplestoreScanState .. data:: T_WorkTableScanState .. data:: T_ForeignScanState .. data:: T_CustomScanState .. data:: T_JoinState .. data:: T_NestLoopState .. data:: T_MergeJoinState .. data:: T_HashJoinState .. data:: T_MaterialState .. data:: T_MemoizeState .. data:: T_SortState .. data:: T_IncrementalSortState .. data:: T_GroupState .. data:: T_AggState .. data:: T_WindowAggState .. data:: T_UniqueState .. data:: T_GatherState .. data:: T_GatherMergeState .. data:: T_HashState .. data:: T_SetOpState .. data:: T_LockRowsState .. data:: T_LimitState .. data:: T_IndexAmRoutine .. data:: T_TableAmRoutine .. data:: T_TsmRoutine .. data:: T_EventTriggerData .. data:: T_TriggerData .. data:: T_TupleTableSlot .. data:: T_FdwRoutine .. data:: T_Bitmapset .. data:: T_ExtensibleNode .. data:: T_ErrorSaveContext .. data:: T_IdentifySystemCmd .. data:: T_BaseBackupCmd .. data:: T_CreateReplicationSlotCmd .. data:: T_DropReplicationSlotCmd .. data:: T_AlterReplicationSlotCmd .. data:: T_StartReplicationCmd .. data:: T_ReadReplicationSlotCmd .. data:: T_TimeLineHistoryCmd .. data:: T_UploadManifestCmd .. data:: T_SupportRequestSimplify .. data:: T_SupportRequestSelectivity .. data:: T_SupportRequestCost .. data:: T_SupportRequestRows .. data:: T_SupportRequestIndexCondition .. data:: T_SupportRequestWFuncMonotonic .. data:: T_SupportRequestOptimizeWindowClause .. data:: T_Integer .. data:: T_Float .. data:: T_Boolean .. data:: T_String .. data:: T_BitString .. data:: T_ForeignKeyCacheInfo .. data:: T_IntList .. data:: T_OidList .. data:: T_XidList .. data:: T_AllocSetContext .. data:: T_GenerationContext .. data:: T_SlabContext .. data:: T_BumpContext .. data:: T_TIDBitmap .. data:: T_WindowObjectData .. class:: pglast.enums.nodes.OnConflictAction Corresponds to the `OnConflictAction enum `__. .. data:: ONCONFLICT_NONE .. data:: ONCONFLICT_NOTHING .. data:: ONCONFLICT_UPDATE .. class:: pglast.enums.nodes.SetOpCmd Corresponds to the `SetOpCmd enum `__. .. data:: SETOPCMD_INTERSECT .. data:: SETOPCMD_INTERSECT_ALL .. data:: SETOPCMD_EXCEPT .. data:: SETOPCMD_EXCEPT_ALL .. class:: pglast.enums.nodes.SetOpStrategy Corresponds to the `SetOpStrategy enum `__. .. data:: SETOP_SORTED .. data:: SETOP_HASHED .. data:: AGGSPLITOP_COMBINE See `here for details `__. .. data:: AGGSPLITOP_SKIPFINAL See `here for details `__. .. data:: AGGSPLITOP_SERIALIZE See `here for details `__. .. data:: AGGSPLITOP_DESERIALIZE See `here for details `__. pglast-7.7/docs/parsenodes.rst000066400000000000000000000633471477366773500165540ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ============================================================================== :mod:`pglast.enums.parsenodes` --- Constants extracted from `parsenodes.h`__ ============================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/nodes/parsenodes.h .. module:: pglast.enums.parsenodes :synopsis: Constants extracted from parsenodes.h .. class:: pglast.enums.parsenodes.A_Expr_Kind Corresponds to the `A_Expr_Kind enum `__. .. data:: AEXPR_OP .. data:: AEXPR_OP_ANY .. data:: AEXPR_OP_ALL .. data:: AEXPR_DISTINCT .. data:: AEXPR_NOT_DISTINCT .. data:: AEXPR_NULLIF .. data:: AEXPR_IN .. data:: AEXPR_LIKE .. data:: AEXPR_ILIKE .. data:: AEXPR_SIMILAR .. data:: AEXPR_BETWEEN .. data:: AEXPR_NOT_BETWEEN .. data:: AEXPR_BETWEEN_SYM .. data:: AEXPR_NOT_BETWEEN_SYM .. class:: pglast.enums.parsenodes.AlterPublicationAction Corresponds to the `AlterPublicationAction enum `__. .. data:: AP_AddObjects .. data:: AP_DropObjects .. data:: AP_SetObjects .. class:: pglast.enums.parsenodes.AlterSubscriptionType Corresponds to the `AlterSubscriptionType enum `__. .. data:: ALTER_SUBSCRIPTION_OPTIONS .. data:: ALTER_SUBSCRIPTION_CONNECTION .. data:: ALTER_SUBSCRIPTION_SET_PUBLICATION .. data:: ALTER_SUBSCRIPTION_ADD_PUBLICATION .. data:: ALTER_SUBSCRIPTION_DROP_PUBLICATION .. data:: ALTER_SUBSCRIPTION_REFRESH .. data:: ALTER_SUBSCRIPTION_ENABLED .. data:: ALTER_SUBSCRIPTION_SKIP .. class:: pglast.enums.parsenodes.AlterTSConfigType Corresponds to the `AlterTSConfigType enum `__. .. data:: ALTER_TSCONFIG_ADD_MAPPING .. data:: ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN .. data:: ALTER_TSCONFIG_REPLACE_DICT .. data:: ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN .. data:: ALTER_TSCONFIG_DROP_MAPPING .. class:: pglast.enums.parsenodes.AlterTableType Corresponds to the `AlterTableType enum `__. .. data:: AT_AddColumn .. data:: AT_AddColumnToView .. data:: AT_ColumnDefault .. data:: AT_CookedColumnDefault .. data:: AT_DropNotNull .. data:: AT_SetNotNull .. data:: AT_SetExpression .. data:: AT_DropExpression .. data:: AT_CheckNotNull .. data:: AT_SetStatistics .. data:: AT_SetOptions .. data:: AT_ResetOptions .. data:: AT_SetStorage .. data:: AT_SetCompression .. data:: AT_DropColumn .. data:: AT_AddIndex .. data:: AT_ReAddIndex .. data:: AT_AddConstraint .. data:: AT_ReAddConstraint .. data:: AT_ReAddDomainConstraint .. data:: AT_AlterConstraint .. data:: AT_ValidateConstraint .. data:: AT_AddIndexConstraint .. data:: AT_DropConstraint .. data:: AT_ReAddComment .. data:: AT_AlterColumnType .. data:: AT_AlterColumnGenericOptions .. data:: AT_ChangeOwner .. data:: AT_ClusterOn .. data:: AT_DropCluster .. data:: AT_SetLogged .. data:: AT_SetUnLogged .. data:: AT_DropOids .. data:: AT_SetAccessMethod .. data:: AT_SetTableSpace .. data:: AT_SetRelOptions .. data:: AT_ResetRelOptions .. data:: AT_ReplaceRelOptions .. data:: AT_EnableTrig .. data:: AT_EnableAlwaysTrig .. data:: AT_EnableReplicaTrig .. data:: AT_DisableTrig .. data:: AT_EnableTrigAll .. data:: AT_DisableTrigAll .. data:: AT_EnableTrigUser .. data:: AT_DisableTrigUser .. data:: AT_EnableRule .. data:: AT_EnableAlwaysRule .. data:: AT_EnableReplicaRule .. data:: AT_DisableRule .. data:: AT_AddInherit .. data:: AT_DropInherit .. data:: AT_AddOf .. data:: AT_DropOf .. data:: AT_ReplicaIdentity .. data:: AT_EnableRowSecurity .. data:: AT_DisableRowSecurity .. data:: AT_ForceRowSecurity .. data:: AT_NoForceRowSecurity .. data:: AT_GenericOptions .. data:: AT_AttachPartition .. data:: AT_DetachPartition .. data:: AT_DetachPartitionFinalize .. data:: AT_AddIdentity .. data:: AT_SetIdentity .. data:: AT_DropIdentity .. data:: AT_ReAddStatistics .. class:: pglast.enums.parsenodes.CTEMaterialize Corresponds to the `CTEMaterialize enum `__. .. data:: CTEMaterializeDefault .. data:: CTEMaterializeAlways .. data:: CTEMaterializeNever .. class:: pglast.enums.parsenodes.ConstrType Corresponds to the `ConstrType enum `__. .. data:: CONSTR_NULL .. data:: CONSTR_NOTNULL .. data:: CONSTR_DEFAULT .. data:: CONSTR_IDENTITY .. data:: CONSTR_GENERATED .. data:: CONSTR_CHECK .. data:: CONSTR_PRIMARY .. data:: CONSTR_UNIQUE .. data:: CONSTR_EXCLUSION .. data:: CONSTR_FOREIGN .. data:: CONSTR_ATTR_DEFERRABLE .. data:: CONSTR_ATTR_NOT_DEFERRABLE .. data:: CONSTR_ATTR_DEFERRED .. data:: CONSTR_ATTR_IMMEDIATE .. class:: pglast.enums.parsenodes.DefElemAction Corresponds to the `DefElemAction enum `__. .. data:: DEFELEM_UNSPEC .. data:: DEFELEM_SET .. data:: DEFELEM_ADD .. data:: DEFELEM_DROP .. class:: pglast.enums.parsenodes.DiscardMode Corresponds to the `DiscardMode enum `__. .. data:: DISCARD_ALL .. data:: DISCARD_PLANS .. data:: DISCARD_SEQUENCES .. data:: DISCARD_TEMP .. class:: pglast.enums.parsenodes.DropBehavior Corresponds to the `DropBehavior enum `__. .. data:: DROP_RESTRICT .. data:: DROP_CASCADE .. class:: pglast.enums.parsenodes.FetchDirection Corresponds to the `FetchDirection enum `__. .. data:: FETCH_FORWARD .. data:: FETCH_BACKWARD .. data:: FETCH_ABSOLUTE .. data:: FETCH_RELATIVE .. class:: pglast.enums.parsenodes.FunctionParameterMode Corresponds to the `FunctionParameterMode enum `__. .. data:: FUNC_PARAM_IN .. data:: FUNC_PARAM_OUT .. data:: FUNC_PARAM_INOUT .. data:: FUNC_PARAM_VARIADIC .. data:: FUNC_PARAM_TABLE .. data:: FUNC_PARAM_DEFAULT .. class:: pglast.enums.parsenodes.GrantTargetType Corresponds to the `GrantTargetType enum `__. .. data:: ACL_TARGET_OBJECT .. data:: ACL_TARGET_ALL_IN_SCHEMA .. data:: ACL_TARGET_DEFAULTS .. class:: pglast.enums.parsenodes.GroupingSetKind Corresponds to the `GroupingSetKind enum `__. .. data:: GROUPING_SET_EMPTY .. data:: GROUPING_SET_SIMPLE .. data:: GROUPING_SET_ROLLUP .. data:: GROUPING_SET_CUBE .. data:: GROUPING_SET_SETS .. class:: pglast.enums.parsenodes.ImportForeignSchemaType Corresponds to the `ImportForeignSchemaType enum `__. .. data:: FDW_IMPORT_SCHEMA_ALL .. data:: FDW_IMPORT_SCHEMA_LIMIT_TO .. data:: FDW_IMPORT_SCHEMA_EXCEPT .. class:: pglast.enums.parsenodes.JsonQuotes Corresponds to the `JsonQuotes enum `__. .. data:: JS_QUOTES_UNSPEC .. data:: JS_QUOTES_KEEP .. data:: JS_QUOTES_OMIT .. class:: pglast.enums.parsenodes.JsonTableColumnType Corresponds to the `JsonTableColumnType enum `__. .. data:: JTC_FOR_ORDINALITY .. data:: JTC_REGULAR .. data:: JTC_EXISTS .. data:: JTC_FORMATTED .. data:: JTC_NESTED .. class:: pglast.enums.parsenodes.ObjectType Corresponds to the `ObjectType enum `__. .. data:: OBJECT_ACCESS_METHOD .. data:: OBJECT_AGGREGATE .. data:: OBJECT_AMOP .. data:: OBJECT_AMPROC .. data:: OBJECT_ATTRIBUTE .. data:: OBJECT_CAST .. data:: OBJECT_COLUMN .. data:: OBJECT_COLLATION .. data:: OBJECT_CONVERSION .. data:: OBJECT_DATABASE .. data:: OBJECT_DEFAULT .. data:: OBJECT_DEFACL .. data:: OBJECT_DOMAIN .. data:: OBJECT_DOMCONSTRAINT .. data:: OBJECT_EVENT_TRIGGER .. data:: OBJECT_EXTENSION .. data:: OBJECT_FDW .. data:: OBJECT_FOREIGN_SERVER .. data:: OBJECT_FOREIGN_TABLE .. data:: OBJECT_FUNCTION .. data:: OBJECT_INDEX .. data:: OBJECT_LANGUAGE .. data:: OBJECT_LARGEOBJECT .. data:: OBJECT_MATVIEW .. data:: OBJECT_OPCLASS .. data:: OBJECT_OPERATOR .. data:: OBJECT_OPFAMILY .. data:: OBJECT_PARAMETER_ACL .. data:: OBJECT_POLICY .. data:: OBJECT_PROCEDURE .. data:: OBJECT_PUBLICATION .. data:: OBJECT_PUBLICATION_NAMESPACE .. data:: OBJECT_PUBLICATION_REL .. data:: OBJECT_ROLE .. data:: OBJECT_ROUTINE .. data:: OBJECT_RULE .. data:: OBJECT_SCHEMA .. data:: OBJECT_SEQUENCE .. data:: OBJECT_SUBSCRIPTION .. data:: OBJECT_STATISTIC_EXT .. data:: OBJECT_TABCONSTRAINT .. data:: OBJECT_TABLE .. data:: OBJECT_TABLESPACE .. data:: OBJECT_TRANSFORM .. data:: OBJECT_TRIGGER .. data:: OBJECT_TSCONFIGURATION .. data:: OBJECT_TSDICTIONARY .. data:: OBJECT_TSPARSER .. data:: OBJECT_TSTEMPLATE .. data:: OBJECT_TYPE .. data:: OBJECT_USER_MAPPING .. data:: OBJECT_VIEW .. class:: pglast.enums.parsenodes.PartitionRangeDatumKind Corresponds to the `PartitionRangeDatumKind enum `__. .. data:: PARTITION_RANGE_DATUM_MINVALUE .. data:: PARTITION_RANGE_DATUM_VALUE .. data:: PARTITION_RANGE_DATUM_MAXVALUE .. class:: pglast.enums.parsenodes.PartitionStrategy Corresponds to the `PartitionStrategy enum `__. .. data:: PARTITION_STRATEGY_LIST .. data:: PARTITION_STRATEGY_RANGE .. data:: PARTITION_STRATEGY_HASH .. class:: pglast.enums.parsenodes.PublicationObjSpecType Corresponds to the `PublicationObjSpecType enum `__. .. data:: PUBLICATIONOBJ_TABLE .. data:: PUBLICATIONOBJ_TABLES_IN_SCHEMA .. data:: PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA .. data:: PUBLICATIONOBJ_CONTINUATION .. class:: pglast.enums.parsenodes.QuerySource Corresponds to the `QuerySource enum `__. .. data:: QSRC_ORIGINAL .. data:: QSRC_PARSER .. data:: QSRC_INSTEAD_RULE .. data:: QSRC_QUAL_INSTEAD_RULE .. data:: QSRC_NON_INSTEAD_RULE .. class:: pglast.enums.parsenodes.RTEKind Corresponds to the `RTEKind enum `__. .. data:: RTE_RELATION .. data:: RTE_SUBQUERY .. data:: RTE_JOIN .. data:: RTE_FUNCTION .. data:: RTE_TABLEFUNC .. data:: RTE_VALUES .. data:: RTE_CTE .. data:: RTE_NAMEDTUPLESTORE .. data:: RTE_RESULT .. class:: pglast.enums.parsenodes.ReindexObjectType Corresponds to the `ReindexObjectType enum `__. .. data:: REINDEX_OBJECT_INDEX .. data:: REINDEX_OBJECT_TABLE .. data:: REINDEX_OBJECT_SCHEMA .. data:: REINDEX_OBJECT_SYSTEM .. data:: REINDEX_OBJECT_DATABASE .. class:: pglast.enums.parsenodes.RoleSpecType Corresponds to the `RoleSpecType enum `__. .. data:: ROLESPEC_CSTRING .. data:: ROLESPEC_CURRENT_ROLE .. data:: ROLESPEC_CURRENT_USER .. data:: ROLESPEC_SESSION_USER .. data:: ROLESPEC_PUBLIC .. class:: pglast.enums.parsenodes.RoleStmtType Corresponds to the `RoleStmtType enum `__. .. data:: ROLESTMT_ROLE .. data:: ROLESTMT_USER .. data:: ROLESTMT_GROUP .. class:: pglast.enums.parsenodes.SetOperation Corresponds to the `SetOperation enum `__. .. data:: SETOP_NONE .. data:: SETOP_UNION .. data:: SETOP_INTERSECT .. data:: SETOP_EXCEPT .. class:: pglast.enums.parsenodes.SetQuantifier Corresponds to the `SetQuantifier enum `__. .. data:: SET_QUANTIFIER_DEFAULT .. data:: SET_QUANTIFIER_ALL .. data:: SET_QUANTIFIER_DISTINCT .. class:: pglast.enums.parsenodes.SortByDir Corresponds to the `SortByDir enum `__. .. data:: SORTBY_DEFAULT .. data:: SORTBY_ASC .. data:: SORTBY_DESC .. data:: SORTBY_USING .. class:: pglast.enums.parsenodes.SortByNulls Corresponds to the `SortByNulls enum `__. .. data:: SORTBY_NULLS_DEFAULT .. data:: SORTBY_NULLS_FIRST .. data:: SORTBY_NULLS_LAST .. class:: pglast.enums.parsenodes.TableLikeOption Corresponds to the `TableLikeOption enum `__. .. data:: CREATE_TABLE_LIKE_COMMENTS .. data:: CREATE_TABLE_LIKE_COMPRESSION .. data:: CREATE_TABLE_LIKE_CONSTRAINTS .. data:: CREATE_TABLE_LIKE_DEFAULTS .. data:: CREATE_TABLE_LIKE_GENERATED .. data:: CREATE_TABLE_LIKE_IDENTITY .. data:: CREATE_TABLE_LIKE_INDEXES .. data:: CREATE_TABLE_LIKE_STATISTICS .. data:: CREATE_TABLE_LIKE_STORAGE .. data:: CREATE_TABLE_LIKE_ALL .. class:: pglast.enums.parsenodes.TransactionStmtKind Corresponds to the `TransactionStmtKind enum `__. .. data:: TRANS_STMT_BEGIN .. data:: TRANS_STMT_START .. data:: TRANS_STMT_COMMIT .. data:: TRANS_STMT_ROLLBACK .. data:: TRANS_STMT_SAVEPOINT .. data:: TRANS_STMT_RELEASE .. data:: TRANS_STMT_ROLLBACK_TO .. data:: TRANS_STMT_PREPARE .. data:: TRANS_STMT_COMMIT_PREPARED .. data:: TRANS_STMT_ROLLBACK_PREPARED .. class:: pglast.enums.parsenodes.VariableSetKind Corresponds to the `VariableSetKind enum `__. .. data:: VAR_SET_VALUE .. data:: VAR_SET_DEFAULT .. data:: VAR_SET_CURRENT .. data:: VAR_SET_MULTI .. data:: VAR_RESET .. data:: VAR_RESET_ALL .. class:: pglast.enums.parsenodes.ViewCheckOption Corresponds to the `ViewCheckOption enum `__. .. data:: NO_CHECK_OPTION .. data:: LOCAL_CHECK_OPTION .. data:: CASCADED_CHECK_OPTION .. class:: pglast.enums.parsenodes.WCOKind Corresponds to the `WCOKind enum `__. .. data:: WCO_VIEW_CHECK .. data:: WCO_RLS_INSERT_CHECK .. data:: WCO_RLS_UPDATE_CHECK .. data:: WCO_RLS_CONFLICT_CHECK .. data:: WCO_RLS_MERGE_UPDATE_CHECK .. data:: WCO_RLS_MERGE_DELETE_CHECK .. data:: ACL_INSERT See `here for details `__. .. data:: ACL_SELECT See `here for details `__. .. data:: ACL_UPDATE See `here for details `__. .. data:: ACL_DELETE See `here for details `__. .. data:: ACL_TRUNCATE See `here for details `__. .. data:: ACL_REFERENCES See `here for details `__. .. data:: ACL_TRIGGER See `here for details `__. .. data:: ACL_EXECUTE See `here for details `__. .. data:: ACL_USAGE See `here for details `__. .. data:: ACL_CREATE See `here for details `__. .. data:: ACL_CREATE_TEMP See `here for details `__. .. data:: ACL_CONNECT See `here for details `__. .. data:: ACL_SET See `here for details `__. .. data:: ACL_ALTER_SYSTEM See `here for details `__. .. data:: ACL_MAINTAIN See `here for details `__. .. data:: N_ACL_RIGHTS See `here for details `__. .. data:: ACL_NO_RIGHTS See `here for details `__. .. data:: FRAMEOPTION_NONDEFAULT See `here for details `__. .. data:: FRAMEOPTION_RANGE See `here for details `__. .. data:: FRAMEOPTION_ROWS See `here for details `__. .. data:: FRAMEOPTION_GROUPS See `here for details `__. .. data:: FRAMEOPTION_BETWEEN See `here for details `__. .. data:: FRAMEOPTION_START_UNBOUNDED_PRECEDING See `here for details `__. .. data:: FRAMEOPTION_END_UNBOUNDED_PRECEDING See `here for details `__. .. data:: FRAMEOPTION_START_UNBOUNDED_FOLLOWING See `here for details `__. .. data:: FRAMEOPTION_END_UNBOUNDED_FOLLOWING See `here for details `__. .. data:: FRAMEOPTION_START_CURRENT_ROW See `here for details `__. .. data:: FRAMEOPTION_END_CURRENT_ROW See `here for details `__. .. data:: FRAMEOPTION_START_OFFSET_PRECEDING See `here for details `__. .. data:: FRAMEOPTION_END_OFFSET_PRECEDING See `here for details `__. .. data:: FRAMEOPTION_START_OFFSET_FOLLOWING See `here for details `__. .. data:: FRAMEOPTION_END_OFFSET_FOLLOWING See `here for details `__. .. data:: FRAMEOPTION_EXCLUDE_CURRENT_ROW See `here for details `__. .. data:: FRAMEOPTION_EXCLUDE_GROUP See `here for details `__. .. data:: FRAMEOPTION_EXCLUDE_TIES See `here for details `__. .. data:: FKCONSTR_ACTION_NOACTION See `here for details `__. .. data:: FKCONSTR_ACTION_RESTRICT See `here for details `__. .. data:: FKCONSTR_ACTION_CASCADE See `here for details `__. .. data:: FKCONSTR_ACTION_SETNULL See `here for details `__. .. data:: FKCONSTR_ACTION_SETDEFAULT See `here for details `__. .. data:: FKCONSTR_MATCH_FULL See `here for details `__. .. data:: FKCONSTR_MATCH_PARTIAL See `here for details `__. .. data:: FKCONSTR_MATCH_SIMPLE See `here for details `__. .. data:: OPCLASS_ITEM_OPERATOR See `here for details `__. .. data:: OPCLASS_ITEM_FUNCTION See `here for details `__. .. data:: OPCLASS_ITEM_STORAGETYPE See `here for details `__. .. data:: CURSOR_OPT_BINARY See `here for details `__. .. data:: CURSOR_OPT_SCROLL See `here for details `__. .. data:: CURSOR_OPT_NO_SCROLL See `here for details `__. .. data:: CURSOR_OPT_INSENSITIVE See `here for details `__. .. data:: CURSOR_OPT_ASENSITIVE See `here for details `__. .. data:: CURSOR_OPT_HOLD See `here for details `__. .. data:: CURSOR_OPT_FAST_PLAN See `here for details `__. .. data:: CURSOR_OPT_GENERIC_PLAN See `here for details `__. .. data:: CURSOR_OPT_CUSTOM_PLAN See `here for details `__. .. data:: CURSOR_OPT_PARALLEL_OK See `here for details `__. pglast-7.7/docs/parser.rst000066400000000000000000000142261477366773500156750ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Parser module .. :Created: gio 10 ago 2017 10:19:26 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2023, 2024 Lele Gaifax .. ========================================================== :mod:`pglast.parser` --- The interface with libpg_query ========================================================== .. module:: pglast.parser :synopsis: The interface with libpg_query This module is a C extension written in Cython__ that exposes a few functions from the underlying ``libpg_query`` library it links against. .. data:: LONG_MAX The highest integer that can be stored in a C ``long`` variable: it is used as a marker, for example in PG's ``FetchStmt.howMany``, that uses the constant ``FETCH_ALL``. .. exception:: ParseError Exception representing the error state returned by the parser. .. exception:: DeparseError Exception representing the error state returned by the deparser. .. class:: Displacements(string) Helper class used to find the index of Unicode character from its offset in the corresponding UTF-8 encoded array. Example: .. doctest:: >>> from pglast.parser import Displacements >>> unicode = '€ 0.01' >>> utf8 = unicode.encode('utf-8') >>> d = Displacements(unicode) >>> for offset in range(len(utf8)): ... idx = d(offset) ... print(f'{offset} [{utf8[offset]:2x}] -> {idx} [{unicode[idx]}]') ... 0 [e2] -> 0 [€] 1 [82] -> 0 [€] 2 [ac] -> 0 [€] 3 [20] -> 1 [ ] 4 [30] -> 2 [0] 5 [2e] -> 3 [.] 6 [30] -> 4 [0] 7 [31] -> 5 [1] The underlying ``libpg_parse`` library operates on ``UTF-8`` strings: its parser functions emit tokens with a ``location``, that is actually the offset within the ``UTF-8`` representation of the statement. With this class you can fixup those offsets, like in the following example: .. doctest:: >>> import json >>> from pglast.parser import parse_sql_json >>> stmt = 'select alias.bar as alìbàbà from foo as alias' >>> parsed = json.loads(parse_sql_json(stmt)) >>> select = parsed['stmts'][0]['stmt']['SelectStmt'] >>> rangevar = select['fromClause'][0]['RangeVar'] >>> loc = rangevar['location'] >>> print(stmt[loc:loc+3]) as >>> d = Displacements(stmt) >>> adjloc = d(loc) >>> print(stmt[adjloc:adjloc+3]) foo .. function:: deparse_protobuf(buffer) :param bytes buffer: a ``Protobuf`` buffer :returns: str Return the ``SQL`` statement from the given `buffer` argument, something generated by :func:`parse_sql_protobuf()`. .. function:: fingerprint(query) :param str query: The SQL statement :returns: str Fingerprint the given `query`, a string with the ``SQL`` statement(s), and return a hash digest that can identify similar queries. For similar queries that are different only because of the queried object or formatting, the returned digest will be the same. .. function:: get_postgresql_version() :returns: a tuple Return the PostgreSQL version as a tuple (`major`, `minor`, `patch`). .. function:: parse_sql(query) :param str query: The SQL statement :returns: tuple Parse the given `query`, a string with the ``SQL`` statement(s), and return the corresponding *parse tree* as a tuple of :class:`pglast.ast.RawStmt` instances. .. function:: parse_sql_json(query) :param str query: The SQL statement :returns: str Parse the given `query`, a string with the ``SQL`` statement(s), and return the ``libpg_query``\ 's ``JSON``\ -serialized parse tree. .. function:: parse_sql_protobuf(query) :param str query: The SQL statement :returns: bytes Parse the given `query`, a string with the ``SQL`` statement(s), and return the ``libpg_query``\ 's ``Protobuf``\ -serialized parse tree. .. function:: parse_plpgsql_json(query) :param str query: The PLpgSQL statement :returns: str Parse the given `query`, a string with the ``plpgsql`` statement(s), and return the ``libpg_query``\ 's ``JSON``\ -serialized parse tree. .. function:: scan(query) :param str query: The SQL statement :returns: sequence of tuples Split the given `query` into its *tokens*. Each token is a `namedtuple` with the following slots: start : int the index of the start of the token end : int the index of the end of the token name : str the name of the token kind : str the kind of the token Example: .. doctest:: >>> from pglast.parser import scan >>> stmt = 'select bar as alìbàbà from foo' >>> tokens = scan(stmt) >>> print(tokens[0]) Token(start=0, end=5, name='SELECT', kind='RESERVED_KEYWORD') >>> print([stmt[t.start:t.end+1] for t in tokens]) ['select', 'bar', 'as', 'alìbàbà', 'from', 'foo'] .. function:: split(query, with_parser=True, only_slices=False) :param str query: The SQL statement :param bool with_parser: Whether to use the parser or the scanner :param bool only_slices: Return slices instead of statement's text :returns: tuple Split the given `stmts` string into a sequence of the single ``SQL`` statements. By default this uses the *parser* to perform the job; when `with_parser` is ``False`` the *scanner* variant is used, indicated when the statements may contain parse errors. When `only_slices` is ``True``, return a sequence of :class:`slice` instances, one for each statement, instead of statements text. .. note:: Leading and trailing whitespace are removed from the statements. Example: .. doctest:: >>> from pglast.parser import split >>> split('select 1 for; select 2') Traceback (most recent call last): ... pglast.parser.ParseError: syntax error at or near ";", at index 12 >>> split('select 1 for; select 2', with_parser=False) ('select 1 for', 'select 2') >>> stmts = "select 'fòò'; select 'bàr'" >>> print([stmts[r] for r in split(stmts, only_slices=True)]) ["select 'fòò'", "select 'bàr'"] __ http://cython.org/ pglast-7.7/docs/pg_am.rst000066400000000000000000000016361477366773500154650ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ==================================================================== :mod:`pglast.enums.pg_am` --- Constants extracted from `pg_am.h`__ ==================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/catalog/pg_am.h .. module:: pglast.enums.pg_am :synopsis: Constants extracted from pg_am.h .. data:: AMTYPE_INDEX See `here for details `__. .. data:: AMTYPE_TABLE See `here for details `__. pglast-7.7/docs/pg_attribute.rst000066400000000000000000000022701477366773500170660ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ================================================================================== :mod:`pglast.enums.pg_attribute` --- Constants extracted from `pg_attribute.h`__ ================================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/catalog/pg_attribute.h .. module:: pglast.enums.pg_attribute :synopsis: Constants extracted from pg_attribute.h .. data:: ATTRIBUTE_IDENTITY_ALWAYS See `here for details `__. .. data:: ATTRIBUTE_IDENTITY_BY_DEFAULT See `here for details `__. .. data:: ATTRIBUTE_GENERATED_STORED See `here for details `__. pglast-7.7/docs/pg_class.rst000066400000000000000000000065361477366773500162010ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ========================================================================== :mod:`pglast.enums.pg_class` --- Constants extracted from `pg_class.h`__ ========================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/catalog/pg_class.h .. module:: pglast.enums.pg_class :synopsis: Constants extracted from pg_class.h .. data:: RELKIND_RELATION See `here for details `__. .. data:: RELKIND_INDEX See `here for details `__. .. data:: RELKIND_SEQUENCE See `here for details `__. .. data:: RELKIND_TOASTVALUE See `here for details `__. .. data:: RELKIND_VIEW See `here for details `__. .. data:: RELKIND_MATVIEW See `here for details `__. .. data:: RELKIND_COMPOSITE_TYPE See `here for details `__. .. data:: RELKIND_FOREIGN_TABLE See `here for details `__. .. data:: RELKIND_PARTITIONED_TABLE See `here for details `__. .. data:: RELKIND_PARTITIONED_INDEX See `here for details `__. .. data:: RELPERSISTENCE_PERMANENT See `here for details `__. .. data:: RELPERSISTENCE_UNLOGGED See `here for details `__. .. data:: RELPERSISTENCE_TEMP See `here for details `__. .. data:: REPLICA_IDENTITY_DEFAULT See `here for details `__. .. data:: REPLICA_IDENTITY_NOTHING See `here for details `__. .. data:: REPLICA_IDENTITY_FULL See `here for details `__. .. data:: REPLICA_IDENTITY_INDEX See `here for details `__. pglast-7.7/docs/pg_trigger.rst000066400000000000000000000041341477366773500165270ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ============================================================================== :mod:`pglast.enums.pg_trigger` --- Constants extracted from `pg_trigger.h`__ ============================================================================== __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/catalog/pg_trigger.h .. module:: pglast.enums.pg_trigger :synopsis: Constants extracted from pg_trigger.h .. data:: TRIGGER_TYPE_ROW See `here for details `__. .. data:: TRIGGER_TYPE_BEFORE See `here for details `__. .. data:: TRIGGER_TYPE_INSERT See `here for details `__. .. data:: TRIGGER_TYPE_DELETE See `here for details `__. .. data:: TRIGGER_TYPE_UPDATE See `here for details `__. .. data:: TRIGGER_TYPE_TRUNCATE See `here for details `__. .. data:: TRIGGER_TYPE_INSTEAD See `here for details `__. .. data:: TRIGGER_TYPE_STATEMENT See `here for details `__. .. data:: TRIGGER_TYPE_AFTER See `here for details `__. pglast-7.7/docs/primnodes.rst000066400000000000000000000206001477366773500163720ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ============================================================================ :mod:`pglast.enums.primnodes` --- Constants extracted from `primnodes.h`__ ============================================================================ __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/nodes/primnodes.h .. module:: pglast.enums.primnodes :synopsis: Constants extracted from primnodes.h .. class:: pglast.enums.primnodes.BoolExprType Corresponds to the `BoolExprType enum `__. .. data:: AND_EXPR .. data:: OR_EXPR .. data:: NOT_EXPR .. class:: pglast.enums.primnodes.BoolTestType Corresponds to the `BoolTestType enum `__. .. data:: IS_TRUE .. data:: IS_NOT_TRUE .. data:: IS_FALSE .. data:: IS_NOT_FALSE .. data:: IS_UNKNOWN .. data:: IS_NOT_UNKNOWN .. class:: pglast.enums.primnodes.CoercionContext Corresponds to the `CoercionContext enum `__. .. data:: COERCION_IMPLICIT .. data:: COERCION_ASSIGNMENT .. data:: COERCION_PLPGSQL .. data:: COERCION_EXPLICIT .. class:: pglast.enums.primnodes.CoercionForm Corresponds to the `CoercionForm enum `__. .. data:: COERCE_EXPLICIT_CALL .. data:: COERCE_EXPLICIT_CAST .. data:: COERCE_IMPLICIT_CAST .. data:: COERCE_SQL_SYNTAX .. class:: pglast.enums.primnodes.JsonBehaviorType Corresponds to the `JsonBehaviorType enum `__. .. data:: JSON_BEHAVIOR_NULL .. data:: JSON_BEHAVIOR_ERROR .. data:: JSON_BEHAVIOR_EMPTY .. data:: JSON_BEHAVIOR_TRUE .. data:: JSON_BEHAVIOR_FALSE .. data:: JSON_BEHAVIOR_UNKNOWN .. data:: JSON_BEHAVIOR_EMPTY_ARRAY .. data:: JSON_BEHAVIOR_EMPTY_OBJECT .. data:: JSON_BEHAVIOR_DEFAULT .. class:: pglast.enums.primnodes.JsonConstructorType Corresponds to the `JsonConstructorType enum `__. .. data:: JSCTOR_JSON_OBJECT .. data:: JSCTOR_JSON_ARRAY .. data:: JSCTOR_JSON_OBJECTAGG .. data:: JSCTOR_JSON_ARRAYAGG .. data:: JSCTOR_JSON_PARSE .. data:: JSCTOR_JSON_SCALAR .. data:: JSCTOR_JSON_SERIALIZE .. class:: pglast.enums.primnodes.JsonEncoding Corresponds to the `JsonEncoding enum `__. .. data:: JS_ENC_DEFAULT .. data:: JS_ENC_UTF8 .. data:: JS_ENC_UTF16 .. data:: JS_ENC_UTF32 .. class:: pglast.enums.primnodes.JsonExprOp Corresponds to the `JsonExprOp enum `__. .. data:: JSON_EXISTS_OP .. data:: JSON_QUERY_OP .. data:: JSON_VALUE_OP .. data:: JSON_TABLE_OP .. class:: pglast.enums.primnodes.JsonFormatType Corresponds to the `JsonFormatType enum `__. .. data:: JS_FORMAT_DEFAULT .. data:: JS_FORMAT_JSON .. data:: JS_FORMAT_JSONB .. class:: pglast.enums.primnodes.JsonValueType Corresponds to the `JsonValueType enum `__. .. data:: JS_TYPE_ANY .. data:: JS_TYPE_OBJECT .. data:: JS_TYPE_ARRAY .. data:: JS_TYPE_SCALAR .. class:: pglast.enums.primnodes.JsonWrapper Corresponds to the `JsonWrapper enum `__. .. data:: JSW_UNSPEC .. data:: JSW_NONE .. data:: JSW_CONDITIONAL .. data:: JSW_UNCONDITIONAL .. class:: pglast.enums.primnodes.MergeMatchKind Corresponds to the `MergeMatchKind enum `__. .. data:: MERGE_WHEN_MATCHED .. data:: MERGE_WHEN_NOT_MATCHED_BY_SOURCE .. data:: MERGE_WHEN_NOT_MATCHED_BY_TARGET .. class:: pglast.enums.primnodes.MinMaxOp Corresponds to the `MinMaxOp enum `__. .. data:: IS_GREATEST .. data:: IS_LEAST .. class:: pglast.enums.primnodes.NullTestType Corresponds to the `NullTestType enum `__. .. data:: IS_NULL .. data:: IS_NOT_NULL .. class:: pglast.enums.primnodes.OnCommitAction Corresponds to the `OnCommitAction enum `__. .. data:: ONCOMMIT_NOOP .. data:: ONCOMMIT_PRESERVE_ROWS .. data:: ONCOMMIT_DELETE_ROWS .. data:: ONCOMMIT_DROP .. class:: pglast.enums.primnodes.OverridingKind Corresponds to the `OverridingKind enum `__. .. data:: OVERRIDING_NOT_SET .. data:: OVERRIDING_USER_VALUE .. data:: OVERRIDING_SYSTEM_VALUE .. class:: pglast.enums.primnodes.ParamKind Corresponds to the `ParamKind enum `__. .. data:: PARAM_EXTERN .. data:: PARAM_EXEC .. data:: PARAM_SUBLINK .. data:: PARAM_MULTIEXPR .. class:: pglast.enums.primnodes.RowCompareType Corresponds to the `RowCompareType enum `__. .. data:: ROWCOMPARE_LT .. data:: ROWCOMPARE_LE .. data:: ROWCOMPARE_EQ .. data:: ROWCOMPARE_GE .. data:: ROWCOMPARE_GT .. data:: ROWCOMPARE_NE .. class:: pglast.enums.primnodes.SQLValueFunctionOp Corresponds to the `SQLValueFunctionOp enum `__. .. data:: SVFOP_CURRENT_DATE .. data:: SVFOP_CURRENT_TIME .. data:: SVFOP_CURRENT_TIME_N .. data:: SVFOP_CURRENT_TIMESTAMP .. data:: SVFOP_CURRENT_TIMESTAMP_N .. data:: SVFOP_LOCALTIME .. data:: SVFOP_LOCALTIME_N .. data:: SVFOP_LOCALTIMESTAMP .. data:: SVFOP_LOCALTIMESTAMP_N .. data:: SVFOP_CURRENT_ROLE .. data:: SVFOP_CURRENT_USER .. data:: SVFOP_USER .. data:: SVFOP_SESSION_USER .. data:: SVFOP_CURRENT_CATALOG .. data:: SVFOP_CURRENT_SCHEMA .. class:: pglast.enums.primnodes.SubLinkType Corresponds to the `SubLinkType enum `__. .. data:: EXISTS_SUBLINK .. data:: ALL_SUBLINK .. data:: ANY_SUBLINK .. data:: ROWCOMPARE_SUBLINK .. data:: EXPR_SUBLINK .. data:: MULTIEXPR_SUBLINK .. data:: ARRAY_SUBLINK .. data:: CTE_SUBLINK .. class:: pglast.enums.primnodes.TableFuncType Corresponds to the `TableFuncType enum `__. .. data:: TFT_XMLTABLE .. data:: TFT_JSON_TABLE .. class:: pglast.enums.primnodes.XmlExprOp Corresponds to the `XmlExprOp enum `__. .. data:: IS_XMLCONCAT .. data:: IS_XMLELEMENT .. data:: IS_XMLFOREST .. data:: IS_XMLPARSE .. data:: IS_XMLPI .. data:: IS_XMLROOT .. data:: IS_XMLSERIALIZE .. data:: IS_DOCUMENT .. class:: pglast.enums.primnodes.XmlOptionType Corresponds to the `XmlOptionType enum `__. .. data:: XMLOPTION_DOCUMENT .. data:: XMLOPTION_CONTENT pglast-7.7/docs/printers.rst000066400000000000000000000017121477366773500162430ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Per-node specialized printer functions .. :Created: gio 10 ago 2017 13:23:18 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2022, 2024 Lele Gaifax .. ========================================================== :mod:`pglast.printers` --- Specialized printer functions ========================================================== .. module:: pglast.printers :synopsis: Specialized printer functions This module implements the specialized functions that define how a particular :class:`~.ast.Node` will be serialized. .. autodata:: NODE_PRINTERS .. autodata:: SPECIAL_FUNCTIONS .. autoexception:: PrinterAlreadyPresentError .. autofunction:: get_printer_for_node .. autofunction:: node_printer .. autofunction:: special_function .. toctree:: :maxdepth: 2 :caption: Printer functions ddl dml pglast-7.7/docs/sfuncs.rst000066400000000000000000000017451477366773500157040ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Special functions documentation .. :Created: mer 22 nov 2017 09:04:18 CET .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2024 Lele Gaifax .. =============================================================== :mod:`pglast.printers.sfuncs` --- Special function printers =============================================================== The PostgreSQL parser *translates* some ``SQL`` constructs into function calls, for example the expression ``EXTRACT(YEAR FROM date_column)`` is represented the same as ``pg_catalog.date_part('year', date_column)``. This module declares some of those equivalences, implementing alternative printers that will be used when the option `special_functions` of the :class:`output stream <.printer.RawStream>` is set to ``True``. .. automodule:: pglast.printers.sfuncs :synopsis: Special function printers :members: pglast-7.7/docs/stream.rst000066400000000000000000000012411477366773500156650ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Stream documentation .. :Created: gio 10 ago 2017 10:58:06 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2021, 2024 Lele Gaifax .. ====================================================== :mod:`pglast.stream` --- The serialization machinery ====================================================== .. module:: pglast.stream :synopsis: The serialization machinery .. autoclass:: OutputStream :members: .. autoclass:: RawStream :members: :special-members: __call__ .. autoclass:: IndentedStream :members: pglast-7.7/docs/usage.rst000066400000000000000000000367511477366773500155140ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — Usage .. :Created: gio 10 ago 2017 10:06:38 CEST .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017, 2018, 2019, 2021, 2022, 2024 Lele Gaifax .. .. _usage: =================== Examples of usage =================== Here are some example of how the module can be used. --------- AST level --------- The lowest level is a Python wrapper around each *parse node* returned by the ``PostgreSQL`` parser. Each node is represented by a corresponding Python class in the module :ref:`pglast.ast`. Parse an ``SQL`` statement and get its *AST* root node ====================================================== The function :func:`~pglast.parser.parse_sql` returns a tuple containing one or more :class:`~pglast.ast.RawStmt` instances: .. doctest:: >>> from pglast import parse_sql >>> root = parse_sql('select 1') >>> print(root) (>>,) ...,) The textual ``repr``\ esentation of a parse node carries all its *not* ``None`` attributes, recursively. You can obtain the accepted attributes of any node by iterating it: .. doctest:: >>> rawstmt = root[0] >>> print(tuple(rawstmt)) ('stmt', 'stmt_location', 'stmt_len') .. doctest:: >>> from pglast import ast >>> stmt = rawstmt.stmt >>> assert isinstance(stmt, ast.SelectStmt) Each node is also a *callable*, to serialize it into a hierarchy of elementary Python values such as dictionaries and tuples: .. doctest:: >>> from pprint import pprint >>> pprint(stmt(depth=2, skip_none=True)) {'@': 'SelectStmt', 'all': False, 'groupDistinct': False, 'limitOption': {'#': 'LimitOption', 'name': 'LIMIT_OPTION_DEFAULT', 'value': 0}, 'op': {'#': 'SetOperation', 'name': 'SETOP_NONE', 'value': 0}, 'targetList': ({'@': 'ResTarget', 'location': 7, 'val': …},)} As you can see, each node is serialized to a dictionary containing at least one *special* key, ``@``, with the *tag name* of the node; lists of nodes are converted to tuples, and ``Enum`` instances to a dictionary with a special ``#`` key carrying the name of data type, and two other keys ``name`` and ``value`` respectively with the name and value of the enum value. Nodes can be compared to each other, and are considered equal when all their attributes match, ignoring those semantically irrelevant: .. doctest:: >>> other_stmt = parse_sql('select /* something here */ 1')[0].stmt >>> print(other_stmt(depth=2, skip_none=True)) {'@': 'SelectStmt', 'targetList': ({'@': 'ResTarget', 'val': …, 'location': 28},), ...} >>> stmt == other_stmt True Altering a node =============== Any attribute of a node is alterable, and some check is done on the assigned value: .. doctest:: >>> print(stmt.all) False >>> stmt.all = True >>> print(stmt.all) True .. doctest:: >>> stmt.all = "foo" Traceback (most recent call last): ... ValueError: Bad value for attribute SelectStmt.all, expected (, ), got : 'foo' Enum attributes can be set to either a plain string, which is looked up in the related class, or to a dictionary: .. doctest:: >>> stmt.limitOption = 'LIMIT_OPTION_COUNT' >>> pprint(stmt(depth=1, skip_none=True)) {'@': 'SelectStmt', 'all': True, 'groupDistinct': False, 'limitOption': {'#': 'LimitOption', 'name': 'LIMIT_OPTION_COUNT', 'value': 1}, 'op': {'#': 'SetOperation', 'name': 'SETOP_NONE', 'value': 0}, 'targetList': (…,)} .. doctest:: >>> stmt.limitOption = {'#': 'LimitOption', 'name': 'LIMIT_OPTION_WITH_TIES'} >>> pprint(stmt(depth=1, skip_none=True)) {'@': 'SelectStmt', 'all': True, 'groupDistinct': False, 'limitOption': {'#': 'LimitOption', 'name': 'LIMIT_OPTION_WITH_TIES', 'value': 2}, 'op': {'#': 'SetOperation', 'name': 'SETOP_NONE', 'value': 0}, 'targetList': (…,)} Either way, assigning the wrong value raises an exception: .. doctest:: >>> stmt.limitOption = 'foo' Traceback (most recent call last): ... ValueError: Bad value for attribute SelectStmt.limitOption, (, , , ), got 'foo' >>> stmt.limitOption = {'#': 'JoinType', 'name': 'JOIN_INNER'} Traceback (most recent call last): ... ValueError: Bad value for attribute SelectStmt.limitOption, expected a (, , , ), got {'#': 'JoinType', 'name': 'JOIN_INNER'} Creating a node =============== You can easily create a new node in the usual way, possibly passing any recognized attribute as a parameter to the constructor: .. doctest:: >>> print(ast.SelectStmt()) >>> print(ast.SelectStmt(all=1)) >>> ast.SelectStmt(non_existing_attribute=None) Traceback (most recent call last): ... TypeError: __init__() got an unexpected keyword argument 'non_existing_attribute' >>> ast.SelectStmt(all="foo") Traceback (most recent call last): ... ValueError: Bad value for attribute SelectStmt.all, expected (, ), got : 'foo' Alternatively, you can pass a single dictionary as argument, with the special ``@`` key valued with the correct node name: >>> print(ast.SelectStmt({'@': 'SelectStmt', 'all': True})) >>> print(ast.SelectStmt({'@': 'RawStmt', 'all': True})) Traceback (most recent call last): ... ValueError: Bad argument, wrong "@" value, expected 'SelectStmt', got 'RawStmt' This basically means that you can reconstruct a syntax tree from the result of calling a node: >>> clone = ast.SelectStmt(stmt()) >>> clone is stmt False >>> clone == stmt True Programmatically :func:`reformat ` a ``SQL`` statement ======================================================================= The easy way ------------ The :func:`~pglast.prettify()` takes a textual ``SQL`` statement and returns its equivalent once *reprinted* with a focus on readability. .. doctest:: >>> from pglast import prettify >>> print(prettify('delete from sometable where value is null')) DELETE FROM sometable WHERE value IS NULL .. doctest:: >>> print(prettify('select a,b,c from sometable where value is null')) SELECT a , b , c FROM sometable WHERE value IS NULL .. doctest:: >>> print(prettify('select a,b,c from sometable' ... ' where value is null or value = 1', ... comma_at_eoln=True)) SELECT a, b, c FROM sometable WHERE value IS NULL OR value = 1 Under the cover --------------- The function above is a simple wrapper to the :class:`~pglast.stream.IndentedStream` class, that extends :class:`pglast.stream.RawStream` adding a bit a aesthetic sense. .. doctest:: >>> from pglast.stream import IndentedStream, RawStream >>> print(IndentedStream(comma_at_eoln=True)('select a,b,c from sometable')) SELECT a, b, c FROM sometable .. doctest:: >>> print(IndentedStream()('select foo from bar')) SELECT foo FROM bar .. doctest:: >>> sql = 'select a.x, b.y from a join b on a.bid = b.id' >>> astnode = parse_sql(sql)[0].stmt >>> astnode , )>>... >>> print(RawStream()(astnode.fromClause)) a INNER JOIN b ON a.bid = b.id :class:`Visit ` or modify the AST tree =============================================================== .. doctest:: >>> from collections import Counter >>> from pglast.visitors import Visitor >>> >>> class Stats(Visitor): ... def __call__(self, node): ... self.counters = Counter() ... super().__call__(node) ... return self.counters ... ... def visit(self, ancestors, node): ... self.counters.update((node.__class__.__name__,)) ... >>> stats = Stats() >>> print(stats(parse_sql('select 1'))) Counter({'RawStmt': 1, 'SelectStmt': 1, 'ResTarget': 1, 'A_Const': 1, 'Integer': 1}) .. doctest:: >>> class NoisyVisitor(Visitor): ... def visit(self, ancestors, node): ... print(ancestors, ':', node(depth=0, skip_none=True)) ... >>> visitor = NoisyVisitor() >>> visitor(parse_sql('select a, b from c')) ROOT → 0 : {'@': 'RawStmt', 'stmt': …, 'stmt_location': 0, 'stmt_len': 0} ROOT → 0 → stmt : {'@': 'SelectStmt', 'targetList': …, 'fromClause': …, ... ROOT → 0 → stmt → targetList → 0 : {'@': 'ResTarget', 'val': …, 'location': 7} ROOT → 0 → stmt → targetList → 1 : {'@': 'ResTarget', 'val': …, 'location': 10} ROOT → 0 → stmt → fromClause → 0 : {'@': 'RangeVar', 'relname': 'c', 'inh': True, ... ROOT → 0 → stmt → targetList → 0 → val : {'@': 'ColumnRef', 'fields': …, 'location': 7} ROOT → 0 → stmt → targetList → 1 → val : {'@': 'ColumnRef', 'fields': …, 'location': 10} ROOT → 0 → stmt → targetList → 0 → val → fields → 0 : {'@': 'String', 'sval': 'a'} ROOT → 0 → stmt → targetList → 1 → val → fields → 0 : {'@': 'String', 'sval': 'b'} (>> from pglast import enums >>> from pglast.visitors import Delete >>> >>> class DropNullConstraint(Visitor): ... def visit_Constraint(self, ancestors, node): ... if node.contype == enums.ConstrType.CONSTR_NULL: ... return Delete ... >>> raw = parse_sql('create table foo (a integer null, b integer not null)') >>> DropNullConstraint()(raw) (>> print(RawStream()(raw)) CREATE TABLE foo (a integer, b integer NOT NULL) Customize a :func:`node printer ` =============================================================== .. doctest:: >>> sql = 'update translations set italian=$2 where word=$1' >>> print(prettify(sql)) UPDATE translations SET italian = $2 WHERE word = $1 >>> from pglast.printers import node_printer >>> @node_printer(ast.ParamRef, override=True) ... def replace_param_ref(node, output): ... output.write(repr(args[node.number - 1])) ... >>> args = ['Hello', 'Ciao'] >>> print(prettify(sql, safety_belt=False)) UPDATE translations SET italian = 'Ciao' WHERE word = 'Hello' :func:`Iterate ` over each statement ================================================== By default, the :func:`split` function uses the parser to do its job: .. doctest:: >>> from pglast import split >>> for statement in split('select 1; select 2'): ... print(statement) ... select 1 select 2 and thus it raises an error if the statement contains errors: .. doctest:: >>> split('select 1 from; select 2') Traceback (most recent call last): ... pglast.parser.ParseError: syntax error at or near ";", at location 14 In this case, you can use a variant that uses the lexical *scanner* instead: .. doctest:: >>> for statement in split('select 1 from; select 2', with_parser=False): ... print(statement) ... select 1 from select 2 .. _cli: ------------ Command line ------------ Reformat a ``SQL`` statement ============================ .. code-block:: shell $ echo "select a,b,c from sometable" | pgpp SELECT a , b , c FROM sometable $ echo "select a,b,c from sometable" | pgpp --comma-at-eoln SELECT a, b, c FROM sometable $ pgpp -S "select a, case when a=1 then 'singular' else 'plural' end from test" SELECT a , CASE WHEN (a = 1) THEN 'singular' ELSE 'plural' END FROM test $ echo 'update "table" set value=123 where value is null' | pgpp UPDATE "table" SET value = 123 WHERE value IS NULL $ echo " insert into t (id, description) values (1, 'this is short enough'), (2, 'this is too long, and will be splitted')" | pgpp -s 20 INSERT INTO t (id, description) VALUES (1, 'this is short enough') , (2, 'this is too long, an' 'd will be splitted') Get a more compact representation ================================= .. code-block:: shell $ pgpp --compact 30 -S "select a,b,c from st where a='longvalue1' and b='longvalue2'" SELECT a, b, c FROM st WHERE (a = 'longvalue1') AND (b = 'longvalue2') $ pgpp --compact 60 -S "select a,b,c from st where a='longvalue1' and b='longvalue2'" SELECT a, b, c FROM st WHERE (a = 'longvalue1') AND (b = 'longvalue2') Get an even more compact, normalized representation =================================================== .. code-block:: shell $ pgpp --normalize -S "select a,b,c from st where a='foo'" SELECT a, b, c FROM st WHERE a = 'foo' Obtain the *parse tree* of a ``SQL`` statement ============================================== .. code-block:: shell $ pgpp --parse-tree --statement "select 1" [{'@': 'RawStmt', 'stmt': {'@': 'SelectStmt', 'all': False, 'limitOption': , 'op': , 'targetList': ({'@': 'ResTarget', 'location': 7, 'val': {'@': 'A_Const', 'location': 7, 'val': {'@': 'Integer', 'val': 1}}},)}, 'stmt_len': 0, 'stmt_location': 0}] Preserve comments ================= .. code-block:: shell $ pgpp --preserve-comments -S "/* Header */ select 1" /* Header */ SELECT 1 $ echo -e "--what?\nselect foo\n--where?\nfrom bar" | pgpp -C --what? SELECT foo FROM --where? bar $ echo -e "--what?\nselect foo\n/*where?*/from bar\n--end" | pgpp -C --what? SELECT foo FROM /*where?*/ bar --end .. note:: Preserving comments is always hard and far from a perfect science: not all AST nodes carry their exact location, so it is not possible to differentiate between ``SELECT * /*comment*/ FROM foo`` and ``SELECT * FROM /*comment*/ foo``. Functions vs SQL syntax ======================= .. code-block:: shell $ pgpp -S "select extract(hour from t1.modtime) from t1" SELECT pg_catalog.date_part('hour', t1.modtime) FROM t1 $ pgpp --special-functions -S "select extract(hour from t1.modtime) from t1" SELECT EXTRACT(HOUR FROM t1.modtime) FROM t1 $ echo " select substring('123',2,3), regexp_split_to_array('x,x,x', ','), btrim('xxx'), trim('xxx'), POSITION('hour' in trim(substring('xyz hour ',1,6))) " | pgpp SELECT pg_catalog.substring('123', 2, 3) , regexp_split_to_array('x,x,x', ',') , btrim('xxx') , pg_catalog.btrim('xxx') , pg_catalog.position(pg_catalog.btrim(pg_catalog.substring('xyz hour ', 1, 6)) , 'hour') $ echo " select substring('123',2,3), regexp_split_to_array('x,x,x', ','), btrim('xxx'), trim('xxx'), POSITION('hour' in trim(substring('xyz hour ',1,6))) " | pgpp -f --remove-pg_catalog-from-functions SELECT substring('123', 2, 3) , regexp_split_to_array('x,x,x', ',') , btrim('xxx') , btrim('xxx') , pg_catalog.position(btrim(substring('xyz hour ', 1, 6)) , 'hour') pglast-7.7/docs/visitors.rst000066400000000000000000000011131477366773500162520ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — AST visitors .. :Created: mar 11 mag 2021, 07:55:02 .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2021, 2024 Lele Gaifax .. ========================================================================= :mod:`pglast.visitors` --- Other ways to inspect and manipulate the AST ========================================================================= .. automodule:: pglast.visitors :synopsis: Other ways to inspect and manipulate the AST :members: pglast-7.7/docs/xml.rst000066400000000000000000000027141477366773500152000ustar00rootroot00000000000000.. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © 2017-2025 Lele Gaifax .. ================================================================ :mod:`pglast.enums.xml` --- Constants extracted from `xml.h`__ ================================================================ __ https://github.com/pganalyze/libpg_query/blob/1c1a32e/src/postgres/include/utils/xml.h .. module:: pglast.enums.xml :synopsis: Constants extracted from xml.h .. class:: pglast.enums.xml.PgXmlStrictness Corresponds to the `PgXmlStrictness enum `__. .. data:: PG_XML_STRICTNESS_LEGACY .. data:: PG_XML_STRICTNESS_WELLFORMED .. data:: PG_XML_STRICTNESS_ALL .. class:: pglast.enums.xml.XmlBinaryType Corresponds to the `XmlBinaryType enum `__. .. data:: XMLBINARY_BASE64 .. data:: XMLBINARY_HEX .. class:: pglast.enums.xml.XmlStandaloneType Corresponds to the `XmlStandaloneType enum `__. .. data:: XML_STANDALONE_YES .. data:: XML_STANDALONE_NO .. data:: XML_STANDALONE_NO_VALUE .. data:: XML_STANDALONE_OMITTED pglast-7.7/libpg_query/000077500000000000000000000000001477366773500152345ustar00rootroot00000000000000pglast-7.7/pglast/000077500000000000000000000000001477366773500142045ustar00rootroot00000000000000pglast-7.7/pglast/__init__.py000066400000000000000000000236671477366773500163330ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — PostgreSQL Languages AST # :Created: mer 02 ago 2017 15:11:02 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2024, 2025 Lele Gaifax # from collections import namedtuple from . import enums from .error import Error try: from .parser import fingerprint, get_postgresql_version, parse_sql, scan, split except ModuleNotFoundError: # pragma: no cover # bootstrap pass # This is injected automatically at release time __version__ = 'v7.7' "Package's version." __author__ = 'Lele Gaifax ' "Package's author." def parse_plpgsql(statement): """Parse the given ``PLPGSQL`` `statement` and return its tokens stream. .. note:: This is currently somewhat of limited usefulness, because neither ``libpg_query`` [#]_ nor ``pglast`` expose proper ``AST`` nodes for the PostgreSQL's procedural extension language, and thus it returns the raw tree, represented by plain Python structures such as lists, dictionaries and scalar values. Consider the following examples, two different ways to parse the same ``SQL`` statement. The first uses :func:`parse_plpgsql`: .. testcode:: from pprint import pprint from pglast import parse_plpgsql STMT = '''\\ CREATE FUNCTION add (a integer, b integer) RETURNS integer AS $$ BEGIN RETURN a + b; END; $$ LANGUAGE plpgsql ''' as_plpgsql = parse_plpgsql(STMT) pprint(as_plpgsql, depth=6) and emits this structure: .. testoutput:: :options: -ELLIPSIS [{'PLpgSQL_function': {'action': {'PLpgSQL_stmt_block': {'body': [{...}], 'lineno': 2}}, 'datums': [{'PLpgSQL_var': {'datatype': {...}, 'refname': 'a'}}, {'PLpgSQL_var': {'datatype': {...}, 'refname': 'b'}}, {'PLpgSQL_var': {'datatype': {...}, 'refname': 'found'}}]}}] As you can see, is just a list of plain Python dictionaries, more or less representing *syntax tokens*. If you use :func:`~.parser.parse_sql` instead: .. testcode:: from pglast import parse_sql as_sql = parse_sql(STMT) pprint([stmt(skip_none=True) for stmt in as_sql]) you obtain a richer representation\\ [#]_ of the statement: .. testoutput:: :options: +ELLIPSIS [{'@': 'RawStmt', 'stmt': {'@': 'CreateFunctionStmt', 'funcname': ({'@': 'String', 'sval': 'add'},), 'is_procedure': False, 'options': ({'@': 'DefElem', 'arg': ({'@': 'String', 'sval': '\\nBEGIN\\n RETURN a + b;\\nEND;\\n'},), 'defaction': {'#': 'DefElemAction', 'name': 'DEFELEM_UNSPEC', 'value': 0}, 'defname': 'as', 'location': ...}, {'@': 'DefElem', 'arg': {'@': 'String', 'sval': 'plpgsql'}, 'defaction': {'#': 'DefElemAction', 'name': 'DEFELEM_UNSPEC', 'value': 0}, 'defname': 'language', 'location': ...}), 'parameters': ({'@': 'FunctionParameter', 'argType': {'@': 'TypeName', 'location': ..., 'names': ({'@': 'String', 'sval': 'pg_catalog'}, {'@': 'String', 'sval': 'int4'}), 'pct_type': False, 'setof': False, 'typemod': -1}, 'mode': {'#': 'FunctionParameterMode', 'name': 'FUNC_PARAM_DEFAULT', 'value': 'd'}, 'name': 'a'}, {'@': 'FunctionParameter', 'argType': {'@': 'TypeName', 'location': ..., 'names': ({'@': 'String', 'sval': 'pg_catalog'}, {'@': 'String', 'sval': 'int4'}), 'pct_type': False, 'setof': False, 'typemod': -1}, 'mode': {'#': 'FunctionParameterMode', 'name': 'FUNC_PARAM_DEFAULT', 'value': 'd'}, 'name': 'b'}), 'replace': False, 'returnType': {'@': 'TypeName', 'location': ..., 'names': ({'@': 'String', 'sval': 'pg_catalog'}, {'@': 'String', 'sval': 'int4'}), 'pct_type': False, 'setof': False, 'typemod': -1}}, 'stmt_len': 0, 'stmt_location': 0}] .. [#] See also https://github.com/pganalyze/libpg_query/issues/110. .. [#] ``location`` values has been masqueraded for test purposes. """ from json import loads from .parser import parse_plpgsql_json return loads(parse_plpgsql_json(statement)) Comment = namedtuple('Comment', ('location', 'text', 'at_start_of_line', 'continue_previous')) "A structure to carry information about a single SQL comment." def _extract_comments(statement): lines = [] lofs = 0 for line in statement.splitlines(True): llen = len(line) lines.append((lofs, lofs+llen, line)) lofs += llen comments = [] continue_previous = False for token in scan(statement): if token.name in ('C_COMMENT', 'SQL_COMMENT'): for bol_ofs, eol_ofs, line in lines: if bol_ofs <= token.start < eol_ofs: break else: # pragma: no cover raise RuntimeError('Uhm, logic error!') at_start_of_line = not line[:token.start - bol_ofs].strip() text = statement[token.start:token.end+1] comments.append(Comment(token.start, text, at_start_of_line, continue_previous)) continue_previous = True else: continue_previous = False return comments def prettify(statement, safety_belt=False, preserve_comments=False, **options): r"""Render given `statement` into a prettified format. :param str statement: the SQL statement(s) :param bool safety_belt: whether to perform a safe check against bugs in pglast's serialization :param bool preserve_comments: whether comments shall be preserved, defaults to not :param \*\*options: any keyword option accepted by :class:`~.stream.IndentedStream` constructor :returns: a string with the equivalent prettified statement(s) When `safety_belt` is ``True``, the resulting statement is parsed again and its *AST* compared with the original statement: if they don't match, a warning is emitted and the original statement is returned. By default it is ``False``, so no double check is done. """ # Intentional lazy imports, so the modules are loaded on demand from .stream import IndentedStream from . import printers # noqa if preserve_comments: options['comments'] = _extract_comments(statement) orig_pt = parse_sql(statement) prettified = IndentedStream(**options)(orig_pt) if safety_belt: from logging import getLogger import warnings try: pretty_pt = parse_sql(prettified) except Error as e: logger = getLogger(__file__) logger.warning("Detected a bug in pglast serialization, original statement:\n\n" "%s\n\nhas been serialized to the following invalid one:\n\n%s", statement, prettified) warnings.warn(f"Detected a bug in pglast serialization, please report: {e}", RuntimeWarning) return statement if pretty_pt != orig_pt: logger = getLogger(__file__) logger.warning("Detected a non-cosmetic difference between this original" " statement:\n\n%s\n\nand the prettified one:\n\n%s", statement, prettified) warnings.warn("Detected a non-cosmetic difference between original and" " prettified statements, please report", RuntimeWarning) return statement return prettified __all__ = ('Error', 'enums', 'fingerprint', 'get_postgresql_version', 'parse_plpgsql', 'parse_sql', 'prettify', 'split') pglast-7.7/pglast/__main__.py000066400000000000000000000121441477366773500163000ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Simple frontend to the pretty reformatter # :Created: dom 06 ago 2017 23:09:23 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2024 Lele Gaifax # import argparse import json import pprint import sys from pglast import Error, parse_plpgsql, parse_sql, prettify from pglast.stream import RawStream def workhorse(args): if args.statement: statement = args.statement else: input = args.infile or sys.stdin with input: statement = input.read() if args.parse_tree or args.plpgsql: tree = parse_plpgsql(statement) if args.plpgsql else parse_sql(statement) output = args.outfile or sys.stdout with output: if args.plpgsql: json.dump(tree, output, sort_keys=True, indent=2) else: pprint.pprint([stmt(skip_none=True) for stmt in tree], output) output.write('\n') elif args.normalize: output = args.outfile or sys.stdout reprinter = RawStream( special_functions=args.special_functions, remove_pg_catalog_from_functions=args.remove_pg_catalog_from_functions, semicolon_after_last_statement=args.semicolon_after_last_statement) with output: output.write(reprinter(statement)) output.write('\n') else: try: prettified = prettify( statement, preserve_comments=args.preserve_comments, compact_lists_margin=args.compact_lists_margin, split_string_literals_threshold=args.split_string_literals, special_functions=args.special_functions, comma_at_eoln=args.comma_at_eoln, remove_pg_catalog_from_functions=args.remove_pg_catalog_from_functions, semicolon_after_last_statement=args.semicolon_after_last_statement) except Error as e: print() raise SystemExit(e) output = args.outfile or sys.stdout with output: output.write(prettified) output.write('\n') def main(options=None): from argparse import ArgumentParser from importlib.metadata import metadata from .parser import get_postgresql_version version = '%s, with PostgreSQL %s parser' % ( metadata('pglast')['Version'], '.'.join(str(p) for p in get_postgresql_version())) parser = ArgumentParser(description="PostgreSQL language prettifier") parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + version,) parser.add_argument('-p', '--plpgsql', action='store_true', default=False, help='use the plpgsql parser (implies --parse-tree)') parser.add_argument('-t', '--parse-tree', action='store_true', default=False, help='show the resulting parse tree instead') parser.add_argument('-n', '--normalize', action='store_true', default=False, help='show the normalized statement, without prettification' ' (some options below may have no effect)') parser.add_argument('-m', '--compact-lists-margin', type=int, default=0, help='use compact form for lists not exceeding the given margin') parser.add_argument('-s', '--split-string-literals', type=int, default=0, help='split string literals longer than given value') parser.add_argument('-f', '--special-functions', action='store_true', default=False, help='activate special functions handling') parser.add_argument('-F', '--remove-pg_catalog-from-functions', action='store_true', default=False, help='omit explicit "pg_catalog" schema from function names,' ' when possible') parser.add_argument('-c', '--comma-at-eoln', action='store_true', default=False, help='use alternative style to print lists, putting the comma right' ' after each item') parser.add_argument('-e', '--semicolon-after-last-statement', action='store_true', default=False, help='end the last statement with a semicolon') parser.add_argument('-C', '--preserve-comments', action='store_true', default=False, help="preserve comments in the statement") parser.add_argument('-S', '--statement', help='the SQL statement') parser.add_argument('infile', nargs='?', type=argparse.FileType(), help='a file containing the SQL statement to be pretty-printed,' ' by default stdin, when not specified with --statement option') parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'), help='where the result will be written, by default stdout') args = parser.parse_args(options if options is not None else sys.argv[1:]) workhorse(args) if __name__ == '__main__': # pragma: no cover main() pglast-7.7/pglast/ast.py000066400000000000000000006252421477366773500153600ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from struct_defs.json @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021-2025 Lele Gaifax # from collections import namedtuple from decimal import Decimal from enum import Enum SlotTypeInfo = namedtuple('SlotTypeInfo', ['c_type', 'py_type', 'adaptor']) def _deserialize_value(value): if isinstance(value, dict) and '@' in value: G = globals() if len(value) > 1: result = G[value['@']](value) else: result = G[value['@']]() elif isinstance(value, (tuple, list)): result = tuple(_deserialize_value(item) for item in value) else: result = value return result def _serialize_node(n, depth, ellipsis, skip_none): d = {'@': n.__class__.__name__} for a in n: v = _serialize_value(getattr(n, a), depth, ellipsis, skip_none) if not skip_none or v is not None: d[a] = v return d def _serialize_value(v, depth, ellipsis, skip_none): if isinstance(v, Node): if depth is None or depth > 0: v = _serialize_node(v, None if depth is None else depth - 1, ellipsis, skip_none) else: v = ellipsis elif isinstance(v, tuple): if depth is None or depth > 0: v = tuple(_serialize_value(i, None if depth is None else depth - 1, ellipsis, skip_none) for i in v) else: v = ellipsis elif isinstance(v, Enum): v = {'#': v.__class__.__name__, 'name': v.name, 'value': v.value} return v class Omissis: def __eq__(self, other): if other is ... or other is self: return True return False def __repr__(self): return '…' Omissis = Omissis() "Marker value used as default for the ellipsis argument" class Node: "Base class for all AST nodes." __slots__ = ('ancestors',) def __init__(self, data): if not isinstance(data, dict): # pragma: no cover raise ValueError(f'Bad argument, expected a dictionary, got {type(data)!r}') if '@' not in data: # pragma: no cover raise ValueError('Bad argument, expected a dictionary with a "@" key') if data['@'] != self.__class__.__name__: raise ValueError(f'Bad argument, wrong "@" value, expected' f' {self.__class__.__name__!r}, got {data["@"]!r}') for a in self: v = data.get(a) if v is not None: v = _deserialize_value(v) setattr(self, a, v) def __iter__(self): "Iterate over all attribute names of this node." return iter(self.__slots__) def __repr__(self): "Build a representation of the whole node and its subtree, for debug." attrs = [] for a in self: if a != 'location': v = getattr(self, a) if v is not None: attrs.append(f'{a}={v!r}') if attrs: attrs = ' ' + ' '.join(attrs) else: attrs = '' return '<' + self.__class__.__name__ + attrs + '>' # Set of attributes that are semantically meaningless, mostly statement offset and length _ATTRS_TO_IGNORE_IN_COMPARISON = {'stmt_len'} def __eq__(self, other): ''' Compare two nodes, returning ``True`` if they are considered equivalent. This is mainly an helper method used by tests: for this reason, two nodes are considered equal when all their attributes match, ignoring *positional* ones such as ``location``, ``stmt_len`` and ``stmt_location``. ''' if not isinstance(other, type(self)): return False for a in self: if a not in self._ATTRS_TO_IGNORE_IN_COMPARISON and getattr(self, a) != getattr(other, a): return False return True def __call__(self, depth=None, ellipsis=Omissis, skip_none=False): '''Serialize the node as a structure made of simple Python data-types. :type depth: ``None`` or ``int`` :param depth: if not ``None``, the maximum depth to reach :param ellipsis: the marker value that will be used to replace cut-off branch :param bool skip_none: whether ``None``-valued attributes should be elided :param bool enum_name: whether Enums will be rendered as their name only :return: a :class:`dict` instance This performs a top-down recursive visit to the whole AST tree: each :class:`Node` instance becomes a dictionary with a special ``@`` key carrying the node type, lists becomes tuples and ``Enum`` instances become dictionaries with a special ``#`` key carrying the enum name.''' return _serialize_node(self, depth, ellipsis, skip_none) def __setattr__(self, name, value): '''Validate the given `value` and if acceptable assign it to the `name` attribute. This tries to coerce the given `value` accordingly with the *ctype* of the attribute, raising opportune exception when that is not possible. ''' if value is not None and name in self.__slots__: ctype, ptype, adaptor = self.__slots__[name] if not isinstance(ptype, tuple): ptype = (ptype,) if not isinstance(value, ptype): raise ValueError(f'Bad value for attribute {self.__class__.__name__}' f'.{name}, expected {ptype}, got {type(value)}:' f' {value!r}') if adaptor is not None: value = adaptor(value) elif ctype != 'char*': from pglast import enums if hasattr(enums, ctype): enum = getattr(enums, ctype) if not isinstance(value, enum): if isinstance(value, dict) and '#' in value: if value['#'] != ctype: raise ValueError(f'Bad value for attribute' f' {self.__class__.__name__}.{name},' f' expected a {ptype}, got' f' {value!r}') from None if 'name' in value: value = value['name'] elif 'value' in value: value = value['value'] else: raise ValueError(f'Bad value for attribute' f' {self.__class__.__name__}.{name},' f' expected a {ptype}, got' f' {value!r}') from None try: if isinstance(value, str) and len(value) > 1: value = enum[value] else: value = enum(value) except (KeyError, ValueError): raise ValueError(f'Bad value for attribute' f' {self.__class__.__name__}.{name},' f' expected a {ptype}, got' f' {value!r}') from None else: if ctype.endswith('*'): cls = globals().get(ctype[:-1]) if cls is None: raise NotImplementedError(f'Unhandled {ctype!r} for attribute' f' {self.__class__.__name__}.{name}') if isinstance(value, dict) and '@' in value: value = cls(value) super().__setattr__(name, value) class Expr(Node): '''Abstract super class of several *expression* classes.''' __slots__ = () class A_ArrayExpr(Node): __slots__ = {'elements': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, elements=None, location=None): # pragma: no cover # noqa: E501 if ((elements is not None and location is None # noqa: E501 and isinstance(elements, dict) and '@' in elements)): super().__init__(elements) else: self.elements = elements self.location = location class ValUnion(Node): '''Represent `ValUnion`__ value. __ https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob; f=src/include/nodes/parsenodes.h;hb=c5dc80c1bc216f0e21a2f79f5e0415c2d4cfb35d#l309 ''' __slots__ = {'val': SlotTypeInfo('ValUnion', Node, None)} def __init__(self, value=None): # pragma: no cover # noqa: E501 if ((value is not None and isinstance(value, dict) and '@' in value)): super().__init__(value) else: self.val = value class A_Const(Node): __slots__ = {'isnull': 'bool', 'val': 'ValUnion'} # noqa: E501 def __init__(self, isnull=None, val=None): # pragma: no cover # noqa: E501 if ((isnull is not None and val is None # noqa: E501 and isinstance(isnull, dict) and '@' in isnull)): super().__init__(isnull) else: self.isnull = isnull self.val = val class A_Expr(Node): __slots__ = {'kind': 'A_Expr_Kind', 'name': 'List*', 'lexpr': 'Node*', 'rexpr': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, kind=None, name=None, lexpr=None, rexpr=None, location=None): # pragma: no cover # noqa: E501 if ((kind is not None and name is lexpr is rexpr is location is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.name = name self.lexpr = lexpr self.rexpr = rexpr self.location = location class A_Indices(Node): __slots__ = {'is_slice': 'bool', 'lidx': 'Node*', 'uidx': 'Node*'} # noqa: E501 def __init__(self, is_slice=None, lidx=None, uidx=None): # pragma: no cover # noqa: E501 if ((is_slice is not None and lidx is uidx is None # noqa: E501 and isinstance(is_slice, dict) and '@' in is_slice)): super().__init__(is_slice) else: self.is_slice = is_slice self.lidx = lidx self.uidx = uidx class A_Indirection(Node): __slots__ = {'arg': 'Node*', 'indirection': 'List*'} # noqa: E501 def __init__(self, arg=None, indirection=None): # pragma: no cover # noqa: E501 if ((arg is not None and indirection is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.indirection = indirection class A_Star(Node): __slots__ = {} # noqa: E501 def __init__(self): # pragma: no cover pass class AccessPriv(Node): __slots__ = {'priv_name': 'char*', 'cols': 'List*'} # noqa: E501 def __init__(self, priv_name=None, cols=None): # pragma: no cover # noqa: E501 if ((priv_name is not None and cols is None # noqa: E501 and isinstance(priv_name, dict) and '@' in priv_name)): super().__init__(priv_name) else: self.priv_name = priv_name self.cols = cols class Aggref(Expr): __slots__ = {'aggargtypes': 'List*', 'aggdirectargs': 'List*', 'args': 'List*', 'aggorder': 'List*', 'aggdistinct': 'List*', 'aggfilter': 'Expr*', 'aggstar': 'bool', 'aggvariadic': 'bool', 'aggkind': 'char', 'agglevelsup': 'Index', 'aggsplit': 'AggSplit', 'aggno': 'int', 'aggtransno': 'int', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, aggargtypes=None, aggdirectargs=None, args=None, aggorder=None, aggdistinct=None, aggfilter=None, aggstar=None, aggvariadic=None, aggkind=None, agglevelsup=None, aggsplit=None, aggno=None, aggtransno=None, location=None): # pragma: no cover # noqa: E501 if ((aggargtypes is not None and aggdirectargs is args is aggorder is aggdistinct is aggfilter is aggstar is aggvariadic is aggkind is agglevelsup is aggsplit is aggno is aggtransno is location is None # noqa: E501 and isinstance(aggargtypes, dict) and '@' in aggargtypes)): super().__init__(aggargtypes) else: self.aggargtypes = aggargtypes self.aggdirectargs = aggdirectargs self.args = args self.aggorder = aggorder self.aggdistinct = aggdistinct self.aggfilter = aggfilter self.aggstar = aggstar self.aggvariadic = aggvariadic self.aggkind = aggkind self.agglevelsup = agglevelsup self.aggsplit = aggsplit self.aggno = aggno self.aggtransno = aggtransno self.location = location class Alias(Node): __slots__ = {'aliasname': 'char*', 'colnames': 'List*'} # noqa: E501 def __init__(self, aliasname=None, colnames=None): # pragma: no cover # noqa: E501 if ((aliasname is not None and colnames is None # noqa: E501 and isinstance(aliasname, dict) and '@' in aliasname)): super().__init__(aliasname) else: self.aliasname = aliasname self.colnames = colnames class AlterCollationStmt(Node): __slots__ = {'collname': 'List*'} # noqa: E501 def __init__(self, collname=None): # pragma: no cover # noqa: E501 if ((collname is not None and isinstance(collname, dict) and '@' in collname)): super().__init__(collname) else: self.collname = collname class AlterDatabaseRefreshCollStmt(Node): __slots__ = {'dbname': 'char*'} # noqa: E501 def __init__(self, dbname=None): # pragma: no cover # noqa: E501 if ((dbname is not None and isinstance(dbname, dict) and '@' in dbname)): super().__init__(dbname) else: self.dbname = dbname class AlterDatabaseSetStmt(Node): __slots__ = {'dbname': 'char*', 'setstmt': 'VariableSetStmt*'} # noqa: E501 def __init__(self, dbname=None, setstmt=None): # pragma: no cover # noqa: E501 if ((dbname is not None and setstmt is None # noqa: E501 and isinstance(dbname, dict) and '@' in dbname)): super().__init__(dbname) else: self.dbname = dbname self.setstmt = setstmt class AlterDatabaseStmt(Node): __slots__ = {'dbname': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, dbname=None, options=None): # pragma: no cover # noqa: E501 if ((dbname is not None and options is None # noqa: E501 and isinstance(dbname, dict) and '@' in dbname)): super().__init__(dbname) else: self.dbname = dbname self.options = options class AlterDefaultPrivilegesStmt(Node): __slots__ = {'options': 'List*', 'action': 'GrantStmt*'} # noqa: E501 def __init__(self, options=None, action=None): # pragma: no cover # noqa: E501 if ((options is not None and action is None # noqa: E501 and isinstance(options, dict) and '@' in options)): super().__init__(options) else: self.options = options self.action = action class AlterDomainStmt(Node): __slots__ = {'subtype': 'char', 'typeName': 'List*', 'name': 'char*', 'def_': 'Node*', 'behavior': 'DropBehavior', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, subtype=None, typeName=None, name=None, def_=None, behavior=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((subtype is not None and typeName is name is def_ is behavior is missing_ok is None # noqa: E501 and isinstance(subtype, dict) and '@' in subtype)): super().__init__(subtype) else: self.subtype = subtype self.typeName = typeName self.name = name self.def_ = def_ self.behavior = behavior self.missing_ok = missing_ok class AlterEnumStmt(Node): __slots__ = {'typeName': 'List*', 'oldVal': 'char*', 'newVal': 'char*', 'newValNeighbor': 'char*', 'newValIsAfter': 'bool', 'skipIfNewValExists': 'bool'} # noqa: E501 def __init__(self, typeName=None, oldVal=None, newVal=None, newValNeighbor=None, newValIsAfter=None, skipIfNewValExists=None): # pragma: no cover # noqa: E501 if ((typeName is not None and oldVal is newVal is newValNeighbor is newValIsAfter is skipIfNewValExists is None # noqa: E501 and isinstance(typeName, dict) and '@' in typeName)): super().__init__(typeName) else: self.typeName = typeName self.oldVal = oldVal self.newVal = newVal self.newValNeighbor = newValNeighbor self.newValIsAfter = newValIsAfter self.skipIfNewValExists = skipIfNewValExists class AlterEventTrigStmt(Node): __slots__ = {'trigname': 'char*', 'tgenabled': 'char'} # noqa: E501 def __init__(self, trigname=None, tgenabled=None): # pragma: no cover # noqa: E501 if ((trigname is not None and tgenabled is None # noqa: E501 and isinstance(trigname, dict) and '@' in trigname)): super().__init__(trigname) else: self.trigname = trigname self.tgenabled = tgenabled class AlterExtensionContentsStmt(Node): __slots__ = {'extname': 'char*', 'action': 'int', 'objtype': 'ObjectType', 'object': 'Node*'} # noqa: E501 def __init__(self, extname=None, action=None, objtype=None, object=None): # pragma: no cover # noqa: E501 if ((extname is not None and action is objtype is object is None # noqa: E501 and isinstance(extname, dict) and '@' in extname)): super().__init__(extname) else: self.extname = extname self.action = action self.objtype = objtype self.object = object class AlterExtensionStmt(Node): __slots__ = {'extname': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, extname=None, options=None): # pragma: no cover # noqa: E501 if ((extname is not None and options is None # noqa: E501 and isinstance(extname, dict) and '@' in extname)): super().__init__(extname) else: self.extname = extname self.options = options class AlterFdwStmt(Node): __slots__ = {'fdwname': 'char*', 'func_options': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, fdwname=None, func_options=None, options=None): # pragma: no cover # noqa: E501 if ((fdwname is not None and func_options is options is None # noqa: E501 and isinstance(fdwname, dict) and '@' in fdwname)): super().__init__(fdwname) else: self.fdwname = fdwname self.func_options = func_options self.options = options class AlterForeignServerStmt(Node): __slots__ = {'servername': 'char*', 'version': 'char*', 'options': 'List*', 'has_version': 'bool'} # noqa: E501 def __init__(self, servername=None, version=None, options=None, has_version=None): # pragma: no cover # noqa: E501 if ((servername is not None and version is options is has_version is None # noqa: E501 and isinstance(servername, dict) and '@' in servername)): super().__init__(servername) else: self.servername = servername self.version = version self.options = options self.has_version = has_version class AlterFunctionStmt(Node): __slots__ = {'objtype': 'ObjectType', 'func': 'ObjectWithArgs*', 'actions': 'List*'} # noqa: E501 def __init__(self, objtype=None, func=None, actions=None): # pragma: no cover # noqa: E501 if ((objtype is not None and func is actions is None # noqa: E501 and isinstance(objtype, dict) and '@' in objtype)): super().__init__(objtype) else: self.objtype = objtype self.func = func self.actions = actions class AlterObjectDependsStmt(Node): __slots__ = {'objectType': 'ObjectType', 'relation': 'RangeVar*', 'object': 'Node*', 'extname': 'String*', 'remove': 'bool'} # noqa: E501 def __init__(self, objectType=None, relation=None, object=None, extname=None, remove=None): # pragma: no cover # noqa: E501 if ((objectType is not None and relation is object is extname is remove is None # noqa: E501 and isinstance(objectType, dict) and '@' in objectType)): super().__init__(objectType) else: self.objectType = objectType self.relation = relation self.object = object self.extname = extname self.remove = remove class AlterObjectSchemaStmt(Node): __slots__ = {'objectType': 'ObjectType', 'relation': 'RangeVar*', 'object': 'Node*', 'newschema': 'char*', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, objectType=None, relation=None, object=None, newschema=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((objectType is not None and relation is object is newschema is missing_ok is None # noqa: E501 and isinstance(objectType, dict) and '@' in objectType)): super().__init__(objectType) else: self.objectType = objectType self.relation = relation self.object = object self.newschema = newschema self.missing_ok = missing_ok class AlterOpFamilyStmt(Node): __slots__ = {'opfamilyname': 'List*', 'amname': 'char*', 'isDrop': 'bool', 'items': 'List*'} # noqa: E501 def __init__(self, opfamilyname=None, amname=None, isDrop=None, items=None): # pragma: no cover # noqa: E501 if ((opfamilyname is not None and amname is isDrop is items is None # noqa: E501 and isinstance(opfamilyname, dict) and '@' in opfamilyname)): super().__init__(opfamilyname) else: self.opfamilyname = opfamilyname self.amname = amname self.isDrop = isDrop self.items = items class AlterOperatorStmt(Node): __slots__ = {'opername': 'ObjectWithArgs*', 'options': 'List*'} # noqa: E501 def __init__(self, opername=None, options=None): # pragma: no cover # noqa: E501 if ((opername is not None and options is None # noqa: E501 and isinstance(opername, dict) and '@' in opername)): super().__init__(opername) else: self.opername = opername self.options = options class AlterOwnerStmt(Node): __slots__ = {'objectType': 'ObjectType', 'relation': 'RangeVar*', 'object': 'Node*', 'newowner': 'RoleSpec*'} # noqa: E501 def __init__(self, objectType=None, relation=None, object=None, newowner=None): # pragma: no cover # noqa: E501 if ((objectType is not None and relation is object is newowner is None # noqa: E501 and isinstance(objectType, dict) and '@' in objectType)): super().__init__(objectType) else: self.objectType = objectType self.relation = relation self.object = object self.newowner = newowner class AlterPolicyStmt(Node): __slots__ = {'policy_name': 'char*', 'table': 'RangeVar*', 'roles': 'List*', 'qual': 'Node*', 'with_check': 'Node*'} # noqa: E501 def __init__(self, policy_name=None, table=None, roles=None, qual=None, with_check=None): # pragma: no cover # noqa: E501 if ((policy_name is not None and table is roles is qual is with_check is None # noqa: E501 and isinstance(policy_name, dict) and '@' in policy_name)): super().__init__(policy_name) else: self.policy_name = policy_name self.table = table self.roles = roles self.qual = qual self.with_check = with_check class AlterPublicationStmt(Node): __slots__ = {'pubname': 'char*', 'options': 'List*', 'pubobjects': 'List*', 'for_all_tables': 'bool', 'action': 'AlterPublicationAction'} # noqa: E501 def __init__(self, pubname=None, options=None, pubobjects=None, for_all_tables=None, action=None): # pragma: no cover # noqa: E501 if ((pubname is not None and options is pubobjects is for_all_tables is action is None # noqa: E501 and isinstance(pubname, dict) and '@' in pubname)): super().__init__(pubname) else: self.pubname = pubname self.options = options self.pubobjects = pubobjects self.for_all_tables = for_all_tables self.action = action class AlterRoleSetStmt(Node): __slots__ = {'role': 'RoleSpec*', 'database': 'char*', 'setstmt': 'VariableSetStmt*'} # noqa: E501 def __init__(self, role=None, database=None, setstmt=None): # pragma: no cover # noqa: E501 if ((role is not None and database is setstmt is None # noqa: E501 and isinstance(role, dict) and '@' in role)): super().__init__(role) else: self.role = role self.database = database self.setstmt = setstmt class AlterRoleStmt(Node): __slots__ = {'role': 'RoleSpec*', 'options': 'List*', 'action': 'int'} # noqa: E501 def __init__(self, role=None, options=None, action=None): # pragma: no cover # noqa: E501 if ((role is not None and options is action is None # noqa: E501 and isinstance(role, dict) and '@' in role)): super().__init__(role) else: self.role = role self.options = options self.action = action class AlterSeqStmt(Node): __slots__ = {'sequence': 'RangeVar*', 'options': 'List*', 'for_identity': 'bool', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, sequence=None, options=None, for_identity=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((sequence is not None and options is for_identity is missing_ok is None # noqa: E501 and isinstance(sequence, dict) and '@' in sequence)): super().__init__(sequence) else: self.sequence = sequence self.options = options self.for_identity = for_identity self.missing_ok = missing_ok class AlterStatsStmt(Node): __slots__ = {'defnames': 'List*', 'stxstattarget': 'Node*', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, defnames=None, stxstattarget=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((defnames is not None and stxstattarget is missing_ok is None # noqa: E501 and isinstance(defnames, dict) and '@' in defnames)): super().__init__(defnames) else: self.defnames = defnames self.stxstattarget = stxstattarget self.missing_ok = missing_ok class AlterSubscriptionStmt(Node): __slots__ = {'kind': 'AlterSubscriptionType', 'subname': 'char*', 'conninfo': 'char*', 'publication': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, kind=None, subname=None, conninfo=None, publication=None, options=None): # pragma: no cover # noqa: E501 if ((kind is not None and subname is conninfo is publication is options is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.subname = subname self.conninfo = conninfo self.publication = publication self.options = options class AlterSystemStmt(Node): __slots__ = {'setstmt': 'VariableSetStmt*'} # noqa: E501 def __init__(self, setstmt=None): # pragma: no cover # noqa: E501 if ((setstmt is not None and isinstance(setstmt, dict) and '@' in setstmt)): super().__init__(setstmt) else: self.setstmt = setstmt class AlterTSConfigurationStmt(Node): __slots__ = {'kind': 'AlterTSConfigType', 'cfgname': 'List*', 'tokentype': 'List*', 'dicts': 'List*', 'override': 'bool', 'replace': 'bool', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, kind=None, cfgname=None, tokentype=None, dicts=None, override=None, replace=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((kind is not None and cfgname is tokentype is dicts is override is replace is missing_ok is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.cfgname = cfgname self.tokentype = tokentype self.dicts = dicts self.override = override self.replace = replace self.missing_ok = missing_ok class AlterTSDictionaryStmt(Node): __slots__ = {'dictname': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, dictname=None, options=None): # pragma: no cover # noqa: E501 if ((dictname is not None and options is None # noqa: E501 and isinstance(dictname, dict) and '@' in dictname)): super().__init__(dictname) else: self.dictname = dictname self.options = options class AlterTableCmd(Node): __slots__ = {'subtype': 'AlterTableType', 'name': 'char*', 'num': 'int16', 'newowner': 'RoleSpec*', 'def_': 'Node*', 'behavior': 'DropBehavior', 'missing_ok': 'bool', 'recurse': 'bool'} # noqa: E501 def __init__(self, subtype=None, name=None, num=None, newowner=None, def_=None, behavior=None, missing_ok=None, recurse=None): # pragma: no cover # noqa: E501 if ((subtype is not None and name is num is newowner is def_ is behavior is missing_ok is recurse is None # noqa: E501 and isinstance(subtype, dict) and '@' in subtype)): super().__init__(subtype) else: self.subtype = subtype self.name = name self.num = num self.newowner = newowner self.def_ = def_ self.behavior = behavior self.missing_ok = missing_ok self.recurse = recurse class AlterTableMoveAllStmt(Node): __slots__ = {'orig_tablespacename': 'char*', 'objtype': 'ObjectType', 'roles': 'List*', 'new_tablespacename': 'char*', 'nowait': 'bool'} # noqa: E501 def __init__(self, orig_tablespacename=None, objtype=None, roles=None, new_tablespacename=None, nowait=None): # pragma: no cover # noqa: E501 if ((orig_tablespacename is not None and objtype is roles is new_tablespacename is nowait is None # noqa: E501 and isinstance(orig_tablespacename, dict) and '@' in orig_tablespacename)): super().__init__(orig_tablespacename) else: self.orig_tablespacename = orig_tablespacename self.objtype = objtype self.roles = roles self.new_tablespacename = new_tablespacename self.nowait = nowait class AlterTableSpaceOptionsStmt(Node): __slots__ = {'tablespacename': 'char*', 'options': 'List*', 'isReset': 'bool'} # noqa: E501 def __init__(self, tablespacename=None, options=None, isReset=None): # pragma: no cover # noqa: E501 if ((tablespacename is not None and options is isReset is None # noqa: E501 and isinstance(tablespacename, dict) and '@' in tablespacename)): super().__init__(tablespacename) else: self.tablespacename = tablespacename self.options = options self.isReset = isReset class AlterTableStmt(Node): __slots__ = {'relation': 'RangeVar*', 'cmds': 'List*', 'objtype': 'ObjectType', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, relation=None, cmds=None, objtype=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((relation is not None and cmds is objtype is missing_ok is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.cmds = cmds self.objtype = objtype self.missing_ok = missing_ok class AlterTypeStmt(Node): __slots__ = {'typeName': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, typeName=None, options=None): # pragma: no cover # noqa: E501 if ((typeName is not None and options is None # noqa: E501 and isinstance(typeName, dict) and '@' in typeName)): super().__init__(typeName) else: self.typeName = typeName self.options = options class AlterUserMappingStmt(Node): __slots__ = {'user': 'RoleSpec*', 'servername': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, user=None, servername=None, options=None): # pragma: no cover # noqa: E501 if ((user is not None and servername is options is None # noqa: E501 and isinstance(user, dict) and '@' in user)): super().__init__(user) else: self.user = user self.servername = servername self.options = options class AlternativeSubPlan(Expr): __slots__ = {'subplans': 'List*'} # noqa: E501 def __init__(self, subplans=None): # pragma: no cover # noqa: E501 if ((subplans is not None and isinstance(subplans, dict) and '@' in subplans)): super().__init__(subplans) else: self.subplans = subplans class ArrayCoerceExpr(Expr): __slots__ = {'arg': 'Expr*', 'elemexpr': 'Expr*', 'resulttypmod': 'int32', 'coerceformat': 'CoercionForm', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'coerceformat', 'location'} def __init__(self, arg=None, elemexpr=None, resulttypmod=None, coerceformat=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and elemexpr is resulttypmod is coerceformat is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.elemexpr = elemexpr self.resulttypmod = resulttypmod self.coerceformat = coerceformat self.location = location class ArrayExpr(Expr): __slots__ = {'elements': 'List*', 'multidims': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, elements=None, multidims=None, location=None): # pragma: no cover # noqa: E501 if ((elements is not None and multidims is location is None # noqa: E501 and isinstance(elements, dict) and '@' in elements)): super().__init__(elements) else: self.elements = elements self.multidims = multidims self.location = location class BitString(Node): __slots__ = {'bsval': 'char*'} # noqa: E501 def __init__(self, bsval=None): # pragma: no cover # noqa: E501 if ((bsval is not None and isinstance(bsval, dict) and '@' in bsval)): super().__init__(bsval) else: self.bsval = bsval class BoolExpr(Expr): __slots__ = {'boolop': 'BoolExprType', 'args': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, boolop=None, args=None, location=None): # pragma: no cover # noqa: E501 if ((boolop is not None and args is location is None # noqa: E501 and isinstance(boolop, dict) and '@' in boolop)): super().__init__(boolop) else: self.boolop = boolop self.args = args self.location = location class Boolean(Node): __slots__ = {'boolval': 'bool'} # noqa: E501 def __init__(self, boolval=None): # pragma: no cover # noqa: E501 if ((boolval is not None and isinstance(boolval, dict) and '@' in boolval)): super().__init__(boolval) else: self.boolval = boolval class BooleanTest(Expr): __slots__ = {'arg': 'Expr*', 'booltesttype': 'BoolTestType', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, booltesttype=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and booltesttype is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.booltesttype = booltesttype self.location = location class CTECycleClause(Node): __slots__ = {'cycle_col_list': 'List*', 'cycle_mark_column': 'char*', 'cycle_mark_value': 'Node*', 'cycle_mark_default': 'Node*', 'cycle_path_column': 'char*', 'location': 'ParseLoc', 'cycle_mark_typmod': 'int'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, cycle_col_list=None, cycle_mark_column=None, cycle_mark_value=None, cycle_mark_default=None, cycle_path_column=None, location=None, cycle_mark_typmod=None): # pragma: no cover # noqa: E501 if ((cycle_col_list is not None and cycle_mark_column is cycle_mark_value is cycle_mark_default is cycle_path_column is location is cycle_mark_typmod is None # noqa: E501 and isinstance(cycle_col_list, dict) and '@' in cycle_col_list)): super().__init__(cycle_col_list) else: self.cycle_col_list = cycle_col_list self.cycle_mark_column = cycle_mark_column self.cycle_mark_value = cycle_mark_value self.cycle_mark_default = cycle_mark_default self.cycle_path_column = cycle_path_column self.location = location self.cycle_mark_typmod = cycle_mark_typmod class CTESearchClause(Node): __slots__ = {'search_col_list': 'List*', 'search_breadth_first': 'bool', 'search_seq_column': 'char*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, search_col_list=None, search_breadth_first=None, search_seq_column=None, location=None): # pragma: no cover # noqa: E501 if ((search_col_list is not None and search_breadth_first is search_seq_column is location is None # noqa: E501 and isinstance(search_col_list, dict) and '@' in search_col_list)): super().__init__(search_col_list) else: self.search_col_list = search_col_list self.search_breadth_first = search_breadth_first self.search_seq_column = search_seq_column self.location = location class CallContext(Node): __slots__ = {'atomic': 'bool'} # noqa: E501 def __init__(self, atomic=None): # pragma: no cover # noqa: E501 if ((atomic is not None and isinstance(atomic, dict) and '@' in atomic)): super().__init__(atomic) else: self.atomic = atomic class CallStmt(Node): __slots__ = {'funccall': 'FuncCall*', 'funcexpr': 'FuncExpr*', 'outargs': 'List*'} # noqa: E501 def __init__(self, funccall=None, funcexpr=None, outargs=None): # pragma: no cover # noqa: E501 if ((funccall is not None and funcexpr is outargs is None # noqa: E501 and isinstance(funccall, dict) and '@' in funccall)): super().__init__(funccall) else: self.funccall = funccall self.funcexpr = funcexpr self.outargs = outargs class CaseExpr(Expr): __slots__ = {'arg': 'Expr*', 'args': 'List*', 'defresult': 'Expr*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, args=None, defresult=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and args is defresult is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.args = args self.defresult = defresult self.location = location class CaseTestExpr(Expr): __slots__ = {'typeMod': 'int32'} # noqa: E501 def __init__(self, typeMod=None): # pragma: no cover # noqa: E501 if ((typeMod is not None and isinstance(typeMod, dict) and '@' in typeMod)): super().__init__(typeMod) else: self.typeMod = typeMod class CaseWhen(Expr): __slots__ = {'expr': 'Expr*', 'result': 'Expr*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, expr=None, result=None, location=None): # pragma: no cover # noqa: E501 if ((expr is not None and result is location is None # noqa: E501 and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr self.result = result self.location = location class CheckPointStmt(Node): __slots__ = {} # noqa: E501 def __init__(self): # pragma: no cover pass class ClosePortalStmt(Node): __slots__ = {'portalname': 'char*'} # noqa: E501 def __init__(self, portalname=None): # pragma: no cover # noqa: E501 if ((portalname is not None and isinstance(portalname, dict) and '@' in portalname)): super().__init__(portalname) else: self.portalname = portalname class ClusterStmt(Node): __slots__ = {'relation': 'RangeVar*', 'indexname': 'char*', 'params': 'List*'} # noqa: E501 def __init__(self, relation=None, indexname=None, params=None): # pragma: no cover # noqa: E501 if ((relation is not None and indexname is params is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.indexname = indexname self.params = params class CoalesceExpr(Expr): __slots__ = {'args': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, args=None, location=None): # pragma: no cover # noqa: E501 if ((args is not None and location is None # noqa: E501 and isinstance(args, dict) and '@' in args)): super().__init__(args) else: self.args = args self.location = location class CoerceToDomain(Expr): __slots__ = {'arg': 'Expr*', 'resulttypmod': 'int32', 'coercionformat': 'CoercionForm', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'coercionformat', 'location'} def __init__(self, arg=None, resulttypmod=None, coercionformat=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and resulttypmod is coercionformat is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.resulttypmod = resulttypmod self.coercionformat = coercionformat self.location = location class CoerceToDomainValue(Expr): __slots__ = {'typeMod': 'int32', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, typeMod=None, location=None): # pragma: no cover # noqa: E501 if ((typeMod is not None and location is None # noqa: E501 and isinstance(typeMod, dict) and '@' in typeMod)): super().__init__(typeMod) else: self.typeMod = typeMod self.location = location class CoerceViaIO(Expr): __slots__ = {'arg': 'Expr*', 'coerceformat': 'CoercionForm', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'coerceformat', 'location'} def __init__(self, arg=None, coerceformat=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and coerceformat is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.coerceformat = coerceformat self.location = location class CollateClause(Node): __slots__ = {'arg': 'Node*', 'collname': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, collname=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and collname is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.collname = collname self.location = location class CollateExpr(Expr): __slots__ = {'arg': 'Expr*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.location = location class ColumnDef(Node): __slots__ = {'colname': 'char*', 'typeName': 'TypeName*', 'compression': 'char*', 'inhcount': 'int', 'is_local': 'bool', 'is_not_null': 'bool', 'is_from_type': 'bool', 'storage': 'char', 'storage_name': 'char*', 'raw_default': 'Node*', 'cooked_default': 'Node*', 'identity': 'char', 'identitySequence': 'RangeVar*', 'generated': 'char', 'collClause': 'CollateClause*', 'constraints': 'List*', 'fdwoptions': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, colname=None, typeName=None, compression=None, inhcount=None, is_local=None, is_not_null=None, is_from_type=None, storage=None, storage_name=None, raw_default=None, cooked_default=None, identity=None, identitySequence=None, generated=None, collClause=None, constraints=None, fdwoptions=None, location=None): # pragma: no cover # noqa: E501 if ((colname is not None and typeName is compression is inhcount is is_local is is_not_null is is_from_type is storage is storage_name is raw_default is cooked_default is identity is identitySequence is generated is collClause is constraints is fdwoptions is location is None # noqa: E501 and isinstance(colname, dict) and '@' in colname)): super().__init__(colname) else: self.colname = colname self.typeName = typeName self.compression = compression self.inhcount = inhcount self.is_local = is_local self.is_not_null = is_not_null self.is_from_type = is_from_type self.storage = storage self.storage_name = storage_name self.raw_default = raw_default self.cooked_default = cooked_default self.identity = identity self.identitySequence = identitySequence self.generated = generated self.collClause = collClause self.constraints = constraints self.fdwoptions = fdwoptions self.location = location class ColumnRef(Node): __slots__ = {'fields': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, fields=None, location=None): # pragma: no cover # noqa: E501 if ((fields is not None and location is None # noqa: E501 and isinstance(fields, dict) and '@' in fields)): super().__init__(fields) else: self.fields = fields self.location = location class CommentStmt(Node): __slots__ = {'objtype': 'ObjectType', 'object': 'Node*', 'comment': 'char*'} # noqa: E501 def __init__(self, objtype=None, object=None, comment=None): # pragma: no cover # noqa: E501 if ((objtype is not None and object is comment is None # noqa: E501 and isinstance(objtype, dict) and '@' in objtype)): super().__init__(objtype) else: self.objtype = objtype self.object = object self.comment = comment class CommonTableExpr(Node): __slots__ = {'ctename': 'char*', 'aliascolnames': 'List*', 'ctematerialized': 'CTEMaterialize', 'ctequery': 'Node*', 'search_clause': 'CTESearchClause*', 'cycle_clause': 'CTECycleClause*', 'location': 'ParseLoc', 'cterecursive': 'bool', 'cterefcount': 'int', 'ctecolnames': 'List*', 'ctecoltypes': 'List*', 'ctecoltypmods': 'List*', 'ctecolcollations': 'List*'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, ctename=None, aliascolnames=None, ctematerialized=None, ctequery=None, search_clause=None, cycle_clause=None, location=None, cterecursive=None, cterefcount=None, ctecolnames=None, ctecoltypes=None, ctecoltypmods=None, ctecolcollations=None): # pragma: no cover # noqa: E501 if ((ctename is not None and aliascolnames is ctematerialized is ctequery is search_clause is cycle_clause is location is cterecursive is cterefcount is ctecolnames is ctecoltypes is ctecoltypmods is ctecolcollations is None # noqa: E501 and isinstance(ctename, dict) and '@' in ctename)): super().__init__(ctename) else: self.ctename = ctename self.aliascolnames = aliascolnames self.ctematerialized = ctematerialized self.ctequery = ctequery self.search_clause = search_clause self.cycle_clause = cycle_clause self.location = location self.cterecursive = cterecursive self.cterefcount = cterefcount self.ctecolnames = ctecolnames self.ctecoltypes = ctecoltypes self.ctecoltypmods = ctecoltypmods self.ctecolcollations = ctecolcollations class CompositeTypeStmt(Node): __slots__ = {'typevar': 'RangeVar*', 'coldeflist': 'List*'} # noqa: E501 def __init__(self, typevar=None, coldeflist=None): # pragma: no cover # noqa: E501 if ((typevar is not None and coldeflist is None # noqa: E501 and isinstance(typevar, dict) and '@' in typevar)): super().__init__(typevar) else: self.typevar = typevar self.coldeflist = coldeflist class Constraint(Node): __slots__ = {'contype': 'ConstrType', 'conname': 'char*', 'deferrable': 'bool', 'initdeferred': 'bool', 'skip_validation': 'bool', 'initially_valid': 'bool', 'is_no_inherit': 'bool', 'raw_expr': 'Node*', 'cooked_expr': 'char*', 'generated_when': 'char', 'inhcount': 'int', 'nulls_not_distinct': 'bool', 'keys': 'List*', 'including': 'List*', 'exclusions': 'List*', 'options': 'List*', 'indexname': 'char*', 'indexspace': 'char*', 'reset_default_tblspc': 'bool', 'access_method': 'char*', 'where_clause': 'Node*', 'pktable': 'RangeVar*', 'fk_attrs': 'List*', 'pk_attrs': 'List*', 'fk_matchtype': 'char', 'fk_upd_action': 'char', 'fk_del_action': 'char', 'fk_del_set_cols': 'List*', 'old_conpfeqop': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, contype=None, conname=None, deferrable=None, initdeferred=None, skip_validation=None, initially_valid=None, is_no_inherit=None, raw_expr=None, cooked_expr=None, generated_when=None, inhcount=None, nulls_not_distinct=None, keys=None, including=None, exclusions=None, options=None, indexname=None, indexspace=None, reset_default_tblspc=None, access_method=None, where_clause=None, pktable=None, fk_attrs=None, pk_attrs=None, fk_matchtype=None, fk_upd_action=None, fk_del_action=None, fk_del_set_cols=None, old_conpfeqop=None, location=None): # pragma: no cover # noqa: E501 if ((contype is not None and conname is deferrable is initdeferred is skip_validation is initially_valid is is_no_inherit is raw_expr is cooked_expr is generated_when is inhcount is nulls_not_distinct is keys is including is exclusions is options is indexname is indexspace is reset_default_tblspc is access_method is where_clause is pktable is fk_attrs is pk_attrs is fk_matchtype is fk_upd_action is fk_del_action is fk_del_set_cols is old_conpfeqop is location is None # noqa: E501 and isinstance(contype, dict) and '@' in contype)): super().__init__(contype) else: self.contype = contype self.conname = conname self.deferrable = deferrable self.initdeferred = initdeferred self.skip_validation = skip_validation self.initially_valid = initially_valid self.is_no_inherit = is_no_inherit self.raw_expr = raw_expr self.cooked_expr = cooked_expr self.generated_when = generated_when self.inhcount = inhcount self.nulls_not_distinct = nulls_not_distinct self.keys = keys self.including = including self.exclusions = exclusions self.options = options self.indexname = indexname self.indexspace = indexspace self.reset_default_tblspc = reset_default_tblspc self.access_method = access_method self.where_clause = where_clause self.pktable = pktable self.fk_attrs = fk_attrs self.pk_attrs = pk_attrs self.fk_matchtype = fk_matchtype self.fk_upd_action = fk_upd_action self.fk_del_action = fk_del_action self.fk_del_set_cols = fk_del_set_cols self.old_conpfeqop = old_conpfeqop self.location = location class ConstraintsSetStmt(Node): __slots__ = {'constraints': 'List*', 'deferred': 'bool'} # noqa: E501 def __init__(self, constraints=None, deferred=None): # pragma: no cover # noqa: E501 if ((constraints is not None and deferred is None # noqa: E501 and isinstance(constraints, dict) and '@' in constraints)): super().__init__(constraints) else: self.constraints = constraints self.deferred = deferred class ConvertRowtypeExpr(Expr): __slots__ = {'arg': 'Expr*', 'convertformat': 'CoercionForm', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'convertformat', 'location'} def __init__(self, arg=None, convertformat=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and convertformat is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.convertformat = convertformat self.location = location class CopyStmt(Node): __slots__ = {'relation': 'RangeVar*', 'query': 'Node*', 'attlist': 'List*', 'is_from': 'bool', 'is_program': 'bool', 'filename': 'char*', 'options': 'List*', 'whereClause': 'Node*'} # noqa: E501 def __init__(self, relation=None, query=None, attlist=None, is_from=None, is_program=None, filename=None, options=None, whereClause=None): # pragma: no cover # noqa: E501 if ((relation is not None and query is attlist is is_from is is_program is filename is options is whereClause is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.query = query self.attlist = attlist self.is_from = is_from self.is_program = is_program self.filename = filename self.options = options self.whereClause = whereClause class CreateAmStmt(Node): __slots__ = {'amname': 'char*', 'handler_name': 'List*', 'amtype': 'char'} # noqa: E501 def __init__(self, amname=None, handler_name=None, amtype=None): # pragma: no cover # noqa: E501 if ((amname is not None and handler_name is amtype is None # noqa: E501 and isinstance(amname, dict) and '@' in amname)): super().__init__(amname) else: self.amname = amname self.handler_name = handler_name self.amtype = amtype class CreateCastStmt(Node): __slots__ = {'sourcetype': 'TypeName*', 'targettype': 'TypeName*', 'func': 'ObjectWithArgs*', 'context': 'CoercionContext', 'inout': 'bool'} # noqa: E501 def __init__(self, sourcetype=None, targettype=None, func=None, context=None, inout=None): # pragma: no cover # noqa: E501 if ((sourcetype is not None and targettype is func is context is inout is None # noqa: E501 and isinstance(sourcetype, dict) and '@' in sourcetype)): super().__init__(sourcetype) else: self.sourcetype = sourcetype self.targettype = targettype self.func = func self.context = context self.inout = inout class CreateConversionStmt(Node): __slots__ = {'conversion_name': 'List*', 'for_encoding_name': 'char*', 'to_encoding_name': 'char*', 'func_name': 'List*', 'def_': 'bool'} # noqa: E501 def __init__(self, conversion_name=None, for_encoding_name=None, to_encoding_name=None, func_name=None, def_=None): # pragma: no cover # noqa: E501 if ((conversion_name is not None and for_encoding_name is to_encoding_name is func_name is def_ is None # noqa: E501 and isinstance(conversion_name, dict) and '@' in conversion_name)): super().__init__(conversion_name) else: self.conversion_name = conversion_name self.for_encoding_name = for_encoding_name self.to_encoding_name = to_encoding_name self.func_name = func_name self.def_ = def_ class CreateDomainStmt(Node): __slots__ = {'domainname': 'List*', 'typeName': 'TypeName*', 'collClause': 'CollateClause*', 'constraints': 'List*'} # noqa: E501 def __init__(self, domainname=None, typeName=None, collClause=None, constraints=None): # pragma: no cover # noqa: E501 if ((domainname is not None and typeName is collClause is constraints is None # noqa: E501 and isinstance(domainname, dict) and '@' in domainname)): super().__init__(domainname) else: self.domainname = domainname self.typeName = typeName self.collClause = collClause self.constraints = constraints class CreateEnumStmt(Node): __slots__ = {'typeName': 'List*', 'vals': 'List*'} # noqa: E501 def __init__(self, typeName=None, vals=None): # pragma: no cover # noqa: E501 if ((typeName is not None and vals is None # noqa: E501 and isinstance(typeName, dict) and '@' in typeName)): super().__init__(typeName) else: self.typeName = typeName self.vals = vals class CreateEventTrigStmt(Node): __slots__ = {'trigname': 'char*', 'eventname': 'char*', 'whenclause': 'List*', 'funcname': 'List*'} # noqa: E501 def __init__(self, trigname=None, eventname=None, whenclause=None, funcname=None): # pragma: no cover # noqa: E501 if ((trigname is not None and eventname is whenclause is funcname is None # noqa: E501 and isinstance(trigname, dict) and '@' in trigname)): super().__init__(trigname) else: self.trigname = trigname self.eventname = eventname self.whenclause = whenclause self.funcname = funcname class CreateExtensionStmt(Node): __slots__ = {'extname': 'char*', 'if_not_exists': 'bool', 'options': 'List*'} # noqa: E501 def __init__(self, extname=None, if_not_exists=None, options=None): # pragma: no cover # noqa: E501 if ((extname is not None and if_not_exists is options is None # noqa: E501 and isinstance(extname, dict) and '@' in extname)): super().__init__(extname) else: self.extname = extname self.if_not_exists = if_not_exists self.options = options class CreateFdwStmt(Node): __slots__ = {'fdwname': 'char*', 'func_options': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, fdwname=None, func_options=None, options=None): # pragma: no cover # noqa: E501 if ((fdwname is not None and func_options is options is None # noqa: E501 and isinstance(fdwname, dict) and '@' in fdwname)): super().__init__(fdwname) else: self.fdwname = fdwname self.func_options = func_options self.options = options class CreateForeignServerStmt(Node): __slots__ = {'servername': 'char*', 'servertype': 'char*', 'version': 'char*', 'fdwname': 'char*', 'if_not_exists': 'bool', 'options': 'List*'} # noqa: E501 def __init__(self, servername=None, servertype=None, version=None, fdwname=None, if_not_exists=None, options=None): # pragma: no cover # noqa: E501 if ((servername is not None and servertype is version is fdwname is if_not_exists is options is None # noqa: E501 and isinstance(servername, dict) and '@' in servername)): super().__init__(servername) else: self.servername = servername self.servertype = servertype self.version = version self.fdwname = fdwname self.if_not_exists = if_not_exists self.options = options class CreateForeignTableStmt(Node): __slots__ = {'base': 'CreateStmt', 'servername': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, base=None, servername=None, options=None): # pragma: no cover # noqa: E501 if ((base is not None and servername is options is None # noqa: E501 and isinstance(base, dict) and '@' in base)): super().__init__(base) else: self.base = base self.servername = servername self.options = options class CreateFunctionStmt(Node): __slots__ = {'is_procedure': 'bool', 'replace': 'bool', 'funcname': 'List*', 'parameters': 'List*', 'returnType': 'TypeName*', 'options': 'List*', 'sql_body': 'Node*'} # noqa: E501 def __init__(self, is_procedure=None, replace=None, funcname=None, parameters=None, returnType=None, options=None, sql_body=None): # pragma: no cover # noqa: E501 if ((is_procedure is not None and replace is funcname is parameters is returnType is options is sql_body is None # noqa: E501 and isinstance(is_procedure, dict) and '@' in is_procedure)): super().__init__(is_procedure) else: self.is_procedure = is_procedure self.replace = replace self.funcname = funcname self.parameters = parameters self.returnType = returnType self.options = options self.sql_body = sql_body class CreateOpClassItem(Node): __slots__ = {'itemtype': 'int', 'name': 'ObjectWithArgs*', 'number': 'int', 'order_family': 'List*', 'class_args': 'List*', 'storedtype': 'TypeName*'} # noqa: E501 def __init__(self, itemtype=None, name=None, number=None, order_family=None, class_args=None, storedtype=None): # pragma: no cover # noqa: E501 if ((itemtype is not None and name is number is order_family is class_args is storedtype is None # noqa: E501 and isinstance(itemtype, dict) and '@' in itemtype)): super().__init__(itemtype) else: self.itemtype = itemtype self.name = name self.number = number self.order_family = order_family self.class_args = class_args self.storedtype = storedtype class CreateOpClassStmt(Node): __slots__ = {'opclassname': 'List*', 'opfamilyname': 'List*', 'amname': 'char*', 'datatype': 'TypeName*', 'items': 'List*', 'isDefault': 'bool'} # noqa: E501 def __init__(self, opclassname=None, opfamilyname=None, amname=None, datatype=None, items=None, isDefault=None): # pragma: no cover # noqa: E501 if ((opclassname is not None and opfamilyname is amname is datatype is items is isDefault is None # noqa: E501 and isinstance(opclassname, dict) and '@' in opclassname)): super().__init__(opclassname) else: self.opclassname = opclassname self.opfamilyname = opfamilyname self.amname = amname self.datatype = datatype self.items = items self.isDefault = isDefault class CreateOpFamilyStmt(Node): __slots__ = {'opfamilyname': 'List*', 'amname': 'char*'} # noqa: E501 def __init__(self, opfamilyname=None, amname=None): # pragma: no cover # noqa: E501 if ((opfamilyname is not None and amname is None # noqa: E501 and isinstance(opfamilyname, dict) and '@' in opfamilyname)): super().__init__(opfamilyname) else: self.opfamilyname = opfamilyname self.amname = amname class CreatePLangStmt(Node): __slots__ = {'replace': 'bool', 'plname': 'char*', 'plhandler': 'List*', 'plinline': 'List*', 'plvalidator': 'List*', 'pltrusted': 'bool'} # noqa: E501 def __init__(self, replace=None, plname=None, plhandler=None, plinline=None, plvalidator=None, pltrusted=None): # pragma: no cover # noqa: E501 if ((replace is not None and plname is plhandler is plinline is plvalidator is pltrusted is None # noqa: E501 and isinstance(replace, dict) and '@' in replace)): super().__init__(replace) else: self.replace = replace self.plname = plname self.plhandler = plhandler self.plinline = plinline self.plvalidator = plvalidator self.pltrusted = pltrusted class CreatePolicyStmt(Node): __slots__ = {'policy_name': 'char*', 'table': 'RangeVar*', 'cmd_name': 'char*', 'permissive': 'bool', 'roles': 'List*', 'qual': 'Node*', 'with_check': 'Node*'} # noqa: E501 def __init__(self, policy_name=None, table=None, cmd_name=None, permissive=None, roles=None, qual=None, with_check=None): # pragma: no cover # noqa: E501 if ((policy_name is not None and table is cmd_name is permissive is roles is qual is with_check is None # noqa: E501 and isinstance(policy_name, dict) and '@' in policy_name)): super().__init__(policy_name) else: self.policy_name = policy_name self.table = table self.cmd_name = cmd_name self.permissive = permissive self.roles = roles self.qual = qual self.with_check = with_check class CreatePublicationStmt(Node): __slots__ = {'pubname': 'char*', 'options': 'List*', 'pubobjects': 'List*', 'for_all_tables': 'bool'} # noqa: E501 def __init__(self, pubname=None, options=None, pubobjects=None, for_all_tables=None): # pragma: no cover # noqa: E501 if ((pubname is not None and options is pubobjects is for_all_tables is None # noqa: E501 and isinstance(pubname, dict) and '@' in pubname)): super().__init__(pubname) else: self.pubname = pubname self.options = options self.pubobjects = pubobjects self.for_all_tables = for_all_tables class CreateRangeStmt(Node): __slots__ = {'typeName': 'List*', 'params': 'List*'} # noqa: E501 def __init__(self, typeName=None, params=None): # pragma: no cover # noqa: E501 if ((typeName is not None and params is None # noqa: E501 and isinstance(typeName, dict) and '@' in typeName)): super().__init__(typeName) else: self.typeName = typeName self.params = params class CreateRoleStmt(Node): __slots__ = {'stmt_type': 'RoleStmtType', 'role': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, stmt_type=None, role=None, options=None): # pragma: no cover # noqa: E501 if ((stmt_type is not None and role is options is None # noqa: E501 and isinstance(stmt_type, dict) and '@' in stmt_type)): super().__init__(stmt_type) else: self.stmt_type = stmt_type self.role = role self.options = options class CreateSchemaStmt(Node): __slots__ = {'schemaname': 'char*', 'authrole': 'RoleSpec*', 'schemaElts': 'List*', 'if_not_exists': 'bool'} # noqa: E501 def __init__(self, schemaname=None, authrole=None, schemaElts=None, if_not_exists=None): # pragma: no cover # noqa: E501 if ((schemaname is not None and authrole is schemaElts is if_not_exists is None # noqa: E501 and isinstance(schemaname, dict) and '@' in schemaname)): super().__init__(schemaname) else: self.schemaname = schemaname self.authrole = authrole self.schemaElts = schemaElts self.if_not_exists = if_not_exists class CreateSeqStmt(Node): __slots__ = {'sequence': 'RangeVar*', 'options': 'List*', 'for_identity': 'bool', 'if_not_exists': 'bool'} # noqa: E501 def __init__(self, sequence=None, options=None, for_identity=None, if_not_exists=None): # pragma: no cover # noqa: E501 if ((sequence is not None and options is for_identity is if_not_exists is None # noqa: E501 and isinstance(sequence, dict) and '@' in sequence)): super().__init__(sequence) else: self.sequence = sequence self.options = options self.for_identity = for_identity self.if_not_exists = if_not_exists class CreateStatsStmt(Node): __slots__ = {'defnames': 'List*', 'stat_types': 'List*', 'exprs': 'List*', 'relations': 'List*', 'stxcomment': 'char*', 'transformed': 'bool', 'if_not_exists': 'bool'} # noqa: E501 def __init__(self, defnames=None, stat_types=None, exprs=None, relations=None, stxcomment=None, transformed=None, if_not_exists=None): # pragma: no cover # noqa: E501 if ((defnames is not None and stat_types is exprs is relations is stxcomment is transformed is if_not_exists is None # noqa: E501 and isinstance(defnames, dict) and '@' in defnames)): super().__init__(defnames) else: self.defnames = defnames self.stat_types = stat_types self.exprs = exprs self.relations = relations self.stxcomment = stxcomment self.transformed = transformed self.if_not_exists = if_not_exists class CreateStmt(Node): __slots__ = {'relation': 'RangeVar*', 'tableElts': 'List*', 'inhRelations': 'List*', 'partbound': 'PartitionBoundSpec*', 'partspec': 'PartitionSpec*', 'ofTypename': 'TypeName*', 'constraints': 'List*', 'options': 'List*', 'oncommit': 'OnCommitAction', 'tablespacename': 'char*', 'accessMethod': 'char*', 'if_not_exists': 'bool'} # noqa: E501 def __init__(self, relation=None, tableElts=None, inhRelations=None, partbound=None, partspec=None, ofTypename=None, constraints=None, options=None, oncommit=None, tablespacename=None, accessMethod=None, if_not_exists=None): # pragma: no cover # noqa: E501 if ((relation is not None and tableElts is inhRelations is partbound is partspec is ofTypename is constraints is options is oncommit is tablespacename is accessMethod is if_not_exists is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.tableElts = tableElts self.inhRelations = inhRelations self.partbound = partbound self.partspec = partspec self.ofTypename = ofTypename self.constraints = constraints self.options = options self.oncommit = oncommit self.tablespacename = tablespacename self.accessMethod = accessMethod self.if_not_exists = if_not_exists class CreateSubscriptionStmt(Node): __slots__ = {'subname': 'char*', 'conninfo': 'char*', 'publication': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, subname=None, conninfo=None, publication=None, options=None): # pragma: no cover # noqa: E501 if ((subname is not None and conninfo is publication is options is None # noqa: E501 and isinstance(subname, dict) and '@' in subname)): super().__init__(subname) else: self.subname = subname self.conninfo = conninfo self.publication = publication self.options = options class CreateTableAsStmt(Node): __slots__ = {'query': 'Node*', 'into': 'IntoClause*', 'objtype': 'ObjectType', 'is_select_into': 'bool', 'if_not_exists': 'bool'} # noqa: E501 def __init__(self, query=None, into=None, objtype=None, is_select_into=None, if_not_exists=None): # pragma: no cover # noqa: E501 if ((query is not None and into is objtype is is_select_into is if_not_exists is None # noqa: E501 and isinstance(query, dict) and '@' in query)): super().__init__(query) else: self.query = query self.into = into self.objtype = objtype self.is_select_into = is_select_into self.if_not_exists = if_not_exists class CreateTableSpaceStmt(Node): __slots__ = {'tablespacename': 'char*', 'owner': 'RoleSpec*', 'location': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, tablespacename=None, owner=None, location=None, options=None): # pragma: no cover # noqa: E501 if ((tablespacename is not None and owner is location is options is None # noqa: E501 and isinstance(tablespacename, dict) and '@' in tablespacename)): super().__init__(tablespacename) else: self.tablespacename = tablespacename self.owner = owner self.location = location self.options = options class CreateTransformStmt(Node): __slots__ = {'replace': 'bool', 'type_name': 'TypeName*', 'lang': 'char*', 'fromsql': 'ObjectWithArgs*', 'tosql': 'ObjectWithArgs*'} # noqa: E501 def __init__(self, replace=None, type_name=None, lang=None, fromsql=None, tosql=None): # pragma: no cover # noqa: E501 if ((replace is not None and type_name is lang is fromsql is tosql is None # noqa: E501 and isinstance(replace, dict) and '@' in replace)): super().__init__(replace) else: self.replace = replace self.type_name = type_name self.lang = lang self.fromsql = fromsql self.tosql = tosql class CreateTrigStmt(Node): __slots__ = {'replace': 'bool', 'isconstraint': 'bool', 'trigname': 'char*', 'relation': 'RangeVar*', 'funcname': 'List*', 'args': 'List*', 'row': 'bool', 'timing': 'int16', 'events': 'int16', 'columns': 'List*', 'whenClause': 'Node*', 'transitionRels': 'List*', 'deferrable': 'bool', 'initdeferred': 'bool', 'constrrel': 'RangeVar*'} # noqa: E501 def __init__(self, replace=None, isconstraint=None, trigname=None, relation=None, funcname=None, args=None, row=None, timing=None, events=None, columns=None, whenClause=None, transitionRels=None, deferrable=None, initdeferred=None, constrrel=None): # pragma: no cover # noqa: E501 if ((replace is not None and isconstraint is trigname is relation is funcname is args is row is timing is events is columns is whenClause is transitionRels is deferrable is initdeferred is constrrel is None # noqa: E501 and isinstance(replace, dict) and '@' in replace)): super().__init__(replace) else: self.replace = replace self.isconstraint = isconstraint self.trigname = trigname self.relation = relation self.funcname = funcname self.args = args self.row = row self.timing = timing self.events = events self.columns = columns self.whenClause = whenClause self.transitionRels = transitionRels self.deferrable = deferrable self.initdeferred = initdeferred self.constrrel = constrrel class CreateUserMappingStmt(Node): __slots__ = {'user': 'RoleSpec*', 'servername': 'char*', 'if_not_exists': 'bool', 'options': 'List*'} # noqa: E501 def __init__(self, user=None, servername=None, if_not_exists=None, options=None): # pragma: no cover # noqa: E501 if ((user is not None and servername is if_not_exists is options is None # noqa: E501 and isinstance(user, dict) and '@' in user)): super().__init__(user) else: self.user = user self.servername = servername self.if_not_exists = if_not_exists self.options = options class CreatedbStmt(Node): __slots__ = {'dbname': 'char*', 'options': 'List*'} # noqa: E501 def __init__(self, dbname=None, options=None): # pragma: no cover # noqa: E501 if ((dbname is not None and options is None # noqa: E501 and isinstance(dbname, dict) and '@' in dbname)): super().__init__(dbname) else: self.dbname = dbname self.options = options class CurrentOfExpr(Expr): __slots__ = {'cvarno': 'Index', 'cursor_name': 'char*', 'cursor_param': 'int'} # noqa: E501 def __init__(self, cvarno=None, cursor_name=None, cursor_param=None): # pragma: no cover # noqa: E501 if ((cvarno is not None and cursor_name is cursor_param is None # noqa: E501 and isinstance(cvarno, dict) and '@' in cvarno)): super().__init__(cvarno) else: self.cvarno = cvarno self.cursor_name = cursor_name self.cursor_param = cursor_param class DeallocateStmt(Node): __slots__ = {'name': 'char*', 'isall': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, name=None, isall=None, location=None): # pragma: no cover # noqa: E501 if ((name is not None and isall is location is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.isall = isall self.location = location class DeclareCursorStmt(Node): __slots__ = {'portalname': 'char*', 'options': 'int', 'query': 'Node*'} # noqa: E501 def __init__(self, portalname=None, options=None, query=None): # pragma: no cover # noqa: E501 if ((portalname is not None and options is query is None # noqa: E501 and isinstance(portalname, dict) and '@' in portalname)): super().__init__(portalname) else: self.portalname = portalname self.options = options self.query = query class DefElem(Node): __slots__ = {'defnamespace': 'char*', 'defname': 'char*', 'arg': 'Node*', 'defaction': 'DefElemAction', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, defnamespace=None, defname=None, arg=None, defaction=None, location=None): # pragma: no cover # noqa: E501 if ((defnamespace is not None and defname is arg is defaction is location is None # noqa: E501 and isinstance(defnamespace, dict) and '@' in defnamespace)): super().__init__(defnamespace) else: self.defnamespace = defnamespace self.defname = defname self.arg = arg self.defaction = defaction self.location = location class DefineStmt(Node): __slots__ = {'kind': 'ObjectType', 'oldstyle': 'bool', 'defnames': 'List*', 'args': 'List*', 'definition': 'List*', 'if_not_exists': 'bool', 'replace': 'bool'} # noqa: E501 def __init__(self, kind=None, oldstyle=None, defnames=None, args=None, definition=None, if_not_exists=None, replace=None): # pragma: no cover # noqa: E501 if ((kind is not None and oldstyle is defnames is args is definition is if_not_exists is replace is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.oldstyle = oldstyle self.defnames = defnames self.args = args self.definition = definition self.if_not_exists = if_not_exists self.replace = replace class DeleteStmt(Node): __slots__ = {'relation': 'RangeVar*', 'usingClause': 'List*', 'whereClause': 'Node*', 'returningList': 'List*', 'withClause': 'WithClause*'} # noqa: E501 def __init__(self, relation=None, usingClause=None, whereClause=None, returningList=None, withClause=None): # pragma: no cover # noqa: E501 if ((relation is not None and usingClause is whereClause is returningList is withClause is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.usingClause = usingClause self.whereClause = whereClause self.returningList = returningList self.withClause = withClause class DiscardStmt(Node): __slots__ = {'target': 'DiscardMode'} # noqa: E501 def __init__(self, target=None): # pragma: no cover # noqa: E501 if ((target is not None and isinstance(target, dict) and '@' in target)): super().__init__(target) else: self.target = target class DoStmt(Node): __slots__ = {'args': 'List*'} # noqa: E501 def __init__(self, args=None): # pragma: no cover # noqa: E501 if ((args is not None and isinstance(args, dict) and '@' in args)): super().__init__(args) else: self.args = args class DropOwnedStmt(Node): __slots__ = {'roles': 'List*', 'behavior': 'DropBehavior'} # noqa: E501 def __init__(self, roles=None, behavior=None): # pragma: no cover # noqa: E501 if ((roles is not None and behavior is None # noqa: E501 and isinstance(roles, dict) and '@' in roles)): super().__init__(roles) else: self.roles = roles self.behavior = behavior class DropRoleStmt(Node): __slots__ = {'roles': 'List*', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, roles=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((roles is not None and missing_ok is None # noqa: E501 and isinstance(roles, dict) and '@' in roles)): super().__init__(roles) else: self.roles = roles self.missing_ok = missing_ok class DropStmt(Node): __slots__ = {'objects': 'List*', 'removeType': 'ObjectType', 'behavior': 'DropBehavior', 'missing_ok': 'bool', 'concurrent': 'bool'} # noqa: E501 def __init__(self, objects=None, removeType=None, behavior=None, missing_ok=None, concurrent=None): # pragma: no cover # noqa: E501 if ((objects is not None and removeType is behavior is missing_ok is concurrent is None # noqa: E501 and isinstance(objects, dict) and '@' in objects)): super().__init__(objects) else: self.objects = objects self.removeType = removeType self.behavior = behavior self.missing_ok = missing_ok self.concurrent = concurrent class DropSubscriptionStmt(Node): __slots__ = {'subname': 'char*', 'missing_ok': 'bool', 'behavior': 'DropBehavior'} # noqa: E501 def __init__(self, subname=None, missing_ok=None, behavior=None): # pragma: no cover # noqa: E501 if ((subname is not None and missing_ok is behavior is None # noqa: E501 and isinstance(subname, dict) and '@' in subname)): super().__init__(subname) else: self.subname = subname self.missing_ok = missing_ok self.behavior = behavior class DropTableSpaceStmt(Node): __slots__ = {'tablespacename': 'char*', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, tablespacename=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((tablespacename is not None and missing_ok is None # noqa: E501 and isinstance(tablespacename, dict) and '@' in tablespacename)): super().__init__(tablespacename) else: self.tablespacename = tablespacename self.missing_ok = missing_ok class DropUserMappingStmt(Node): __slots__ = {'user': 'RoleSpec*', 'servername': 'char*', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, user=None, servername=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((user is not None and servername is missing_ok is None # noqa: E501 and isinstance(user, dict) and '@' in user)): super().__init__(user) else: self.user = user self.servername = servername self.missing_ok = missing_ok class DropdbStmt(Node): __slots__ = {'dbname': 'char*', 'missing_ok': 'bool', 'options': 'List*'} # noqa: E501 def __init__(self, dbname=None, missing_ok=None, options=None): # pragma: no cover # noqa: E501 if ((dbname is not None and missing_ok is options is None # noqa: E501 and isinstance(dbname, dict) and '@' in dbname)): super().__init__(dbname) else: self.dbname = dbname self.missing_ok = missing_ok self.options = options class ExecuteStmt(Node): __slots__ = {'name': 'char*', 'params': 'List*'} # noqa: E501 def __init__(self, name=None, params=None): # pragma: no cover # noqa: E501 if ((name is not None and params is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.params = params class ExplainStmt(Node): __slots__ = {'query': 'Node*', 'options': 'List*'} # noqa: E501 def __init__(self, query=None, options=None): # pragma: no cover # noqa: E501 if ((query is not None and options is None # noqa: E501 and isinstance(query, dict) and '@' in query)): super().__init__(query) else: self.query = query self.options = options class FetchStmt(Node): __slots__ = {'direction': 'FetchDirection', 'howMany': 'long', 'portalname': 'char*', 'ismove': 'bool'} # noqa: E501 def __init__(self, direction=None, howMany=None, portalname=None, ismove=None): # pragma: no cover # noqa: E501 if ((direction is not None and howMany is portalname is ismove is None # noqa: E501 and isinstance(direction, dict) and '@' in direction)): super().__init__(direction) else: self.direction = direction self.howMany = howMany self.portalname = portalname self.ismove = ismove class FieldSelect(Expr): __slots__ = {'arg': 'Expr*', 'fieldnum': 'AttrNumber', 'resulttypmod': 'int32'} # noqa: E501 def __init__(self, arg=None, fieldnum=None, resulttypmod=None): # pragma: no cover # noqa: E501 if ((arg is not None and fieldnum is resulttypmod is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.fieldnum = fieldnum self.resulttypmod = resulttypmod class FieldStore(Expr): __slots__ = {'arg': 'Expr*', 'newvals': 'List*', 'fieldnums': 'List*'} # noqa: E501 def __init__(self, arg=None, newvals=None, fieldnums=None): # pragma: no cover # noqa: E501 if ((arg is not None and newvals is fieldnums is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.newvals = newvals self.fieldnums = fieldnums class Float(Node): __slots__ = {'fval': 'char*'} # noqa: E501 def __init__(self, fval=None): # pragma: no cover # noqa: E501 if ((fval is not None and isinstance(fval, dict) and '@' in fval)): super().__init__(fval) else: self.fval = fval class FromExpr(Node): __slots__ = {'fromlist': 'List*', 'quals': 'Node*'} # noqa: E501 def __init__(self, fromlist=None, quals=None): # pragma: no cover # noqa: E501 if ((fromlist is not None and quals is None # noqa: E501 and isinstance(fromlist, dict) and '@' in fromlist)): super().__init__(fromlist) else: self.fromlist = fromlist self.quals = quals class FuncCall(Node): __slots__ = {'funcname': 'List*', 'args': 'List*', 'agg_order': 'List*', 'agg_filter': 'Node*', 'over': 'WindowDef*', 'agg_within_group': 'bool', 'agg_star': 'bool', 'agg_distinct': 'bool', 'func_variadic': 'bool', 'funcformat': 'CoercionForm', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'funcformat', 'location'} def __init__(self, funcname=None, args=None, agg_order=None, agg_filter=None, over=None, agg_within_group=None, agg_star=None, agg_distinct=None, func_variadic=None, funcformat=None, location=None): # pragma: no cover # noqa: E501 if ((funcname is not None and args is agg_order is agg_filter is over is agg_within_group is agg_star is agg_distinct is func_variadic is funcformat is location is None # noqa: E501 and isinstance(funcname, dict) and '@' in funcname)): super().__init__(funcname) else: self.funcname = funcname self.args = args self.agg_order = agg_order self.agg_filter = agg_filter self.over = over self.agg_within_group = agg_within_group self.agg_star = agg_star self.agg_distinct = agg_distinct self.func_variadic = func_variadic self.funcformat = funcformat self.location = location class FuncExpr(Expr): __slots__ = {'funcretset': 'bool', 'funcvariadic': 'bool', 'funcformat': 'CoercionForm', 'args': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'funcformat', 'location'} def __init__(self, funcretset=None, funcvariadic=None, funcformat=None, args=None, location=None): # pragma: no cover # noqa: E501 if ((funcretset is not None and funcvariadic is funcformat is args is location is None # noqa: E501 and isinstance(funcretset, dict) and '@' in funcretset)): super().__init__(funcretset) else: self.funcretset = funcretset self.funcvariadic = funcvariadic self.funcformat = funcformat self.args = args self.location = location class FunctionParameter(Node): __slots__ = {'name': 'char*', 'argType': 'TypeName*', 'mode': 'FunctionParameterMode', 'defexpr': 'Node*'} # noqa: E501 def __init__(self, name=None, argType=None, mode=None, defexpr=None): # pragma: no cover # noqa: E501 if ((name is not None and argType is mode is defexpr is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.argType = argType self.mode = mode self.defexpr = defexpr class GrantRoleStmt(Node): __slots__ = {'granted_roles': 'List*', 'grantee_roles': 'List*', 'is_grant': 'bool', 'opt': 'List*', 'grantor': 'RoleSpec*', 'behavior': 'DropBehavior'} # noqa: E501 def __init__(self, granted_roles=None, grantee_roles=None, is_grant=None, opt=None, grantor=None, behavior=None): # pragma: no cover # noqa: E501 if ((granted_roles is not None and grantee_roles is is_grant is opt is grantor is behavior is None # noqa: E501 and isinstance(granted_roles, dict) and '@' in granted_roles)): super().__init__(granted_roles) else: self.granted_roles = granted_roles self.grantee_roles = grantee_roles self.is_grant = is_grant self.opt = opt self.grantor = grantor self.behavior = behavior class GrantStmt(Node): __slots__ = {'is_grant': 'bool', 'targtype': 'GrantTargetType', 'objtype': 'ObjectType', 'objects': 'List*', 'privileges': 'List*', 'grantees': 'List*', 'grant_option': 'bool', 'grantor': 'RoleSpec*', 'behavior': 'DropBehavior'} # noqa: E501 def __init__(self, is_grant=None, targtype=None, objtype=None, objects=None, privileges=None, grantees=None, grant_option=None, grantor=None, behavior=None): # pragma: no cover # noqa: E501 if ((is_grant is not None and targtype is objtype is objects is privileges is grantees is grant_option is grantor is behavior is None # noqa: E501 and isinstance(is_grant, dict) and '@' in is_grant)): super().__init__(is_grant) else: self.is_grant = is_grant self.targtype = targtype self.objtype = objtype self.objects = objects self.privileges = privileges self.grantees = grantees self.grant_option = grant_option self.grantor = grantor self.behavior = behavior class GroupingFunc(Expr): __slots__ = {'args': 'List*', 'refs': 'List*', 'agglevelsup': 'Index', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, args=None, refs=None, agglevelsup=None, location=None): # pragma: no cover # noqa: E501 if ((args is not None and refs is agglevelsup is location is None # noqa: E501 and isinstance(args, dict) and '@' in args)): super().__init__(args) else: self.args = args self.refs = refs self.agglevelsup = agglevelsup self.location = location class GroupingSet(Node): __slots__ = {'kind': 'GroupingSetKind', 'content': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, kind=None, content=None, location=None): # pragma: no cover # noqa: E501 if ((kind is not None and content is location is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.content = content self.location = location class ImportForeignSchemaStmt(Node): __slots__ = {'server_name': 'char*', 'remote_schema': 'char*', 'local_schema': 'char*', 'list_type': 'ImportForeignSchemaType', 'table_list': 'List*', 'options': 'List*'} # noqa: E501 def __init__(self, server_name=None, remote_schema=None, local_schema=None, list_type=None, table_list=None, options=None): # pragma: no cover # noqa: E501 if ((server_name is not None and remote_schema is local_schema is list_type is table_list is options is None # noqa: E501 and isinstance(server_name, dict) and '@' in server_name)): super().__init__(server_name) else: self.server_name = server_name self.remote_schema = remote_schema self.local_schema = local_schema self.list_type = list_type self.table_list = table_list self.options = options class IndexElem(Node): __slots__ = {'name': 'char*', 'expr': 'Node*', 'indexcolname': 'char*', 'collation': 'List*', 'opclass': 'List*', 'opclassopts': 'List*', 'ordering': 'SortByDir', 'nulls_ordering': 'SortByNulls'} # noqa: E501 def __init__(self, name=None, expr=None, indexcolname=None, collation=None, opclass=None, opclassopts=None, ordering=None, nulls_ordering=None): # pragma: no cover # noqa: E501 if ((name is not None and expr is indexcolname is collation is opclass is opclassopts is ordering is nulls_ordering is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.expr = expr self.indexcolname = indexcolname self.collation = collation self.opclass = opclass self.opclassopts = opclassopts self.ordering = ordering self.nulls_ordering = nulls_ordering class IndexStmt(Node): __slots__ = {'idxname': 'char*', 'relation': 'RangeVar*', 'accessMethod': 'char*', 'tableSpace': 'char*', 'indexParams': 'List*', 'indexIncludingParams': 'List*', 'options': 'List*', 'whereClause': 'Node*', 'excludeOpNames': 'List*', 'idxcomment': 'char*', 'oldNumber': 'RelFileNumber', 'oldCreateSubid': 'SubTransactionId', 'oldFirstRelfilelocatorSubid': 'SubTransactionId', 'unique': 'bool', 'nulls_not_distinct': 'bool', 'primary': 'bool', 'isconstraint': 'bool', 'deferrable': 'bool', 'initdeferred': 'bool', 'transformed': 'bool', 'concurrent': 'bool', 'if_not_exists': 'bool', 'reset_default_tblspc': 'bool'} # noqa: E501 def __init__(self, idxname=None, relation=None, accessMethod=None, tableSpace=None, indexParams=None, indexIncludingParams=None, options=None, whereClause=None, excludeOpNames=None, idxcomment=None, oldNumber=None, oldCreateSubid=None, oldFirstRelfilelocatorSubid=None, unique=None, nulls_not_distinct=None, primary=None, isconstraint=None, deferrable=None, initdeferred=None, transformed=None, concurrent=None, if_not_exists=None, reset_default_tblspc=None): # pragma: no cover # noqa: E501 if ((idxname is not None and relation is accessMethod is tableSpace is indexParams is indexIncludingParams is options is whereClause is excludeOpNames is idxcomment is oldNumber is oldCreateSubid is oldFirstRelfilelocatorSubid is unique is nulls_not_distinct is primary is isconstraint is deferrable is initdeferred is transformed is concurrent is if_not_exists is reset_default_tblspc is None # noqa: E501 and isinstance(idxname, dict) and '@' in idxname)): super().__init__(idxname) else: self.idxname = idxname self.relation = relation self.accessMethod = accessMethod self.tableSpace = tableSpace self.indexParams = indexParams self.indexIncludingParams = indexIncludingParams self.options = options self.whereClause = whereClause self.excludeOpNames = excludeOpNames self.idxcomment = idxcomment self.oldNumber = oldNumber self.oldCreateSubid = oldCreateSubid self.oldFirstRelfilelocatorSubid = oldFirstRelfilelocatorSubid self.unique = unique self.nulls_not_distinct = nulls_not_distinct self.primary = primary self.isconstraint = isconstraint self.deferrable = deferrable self.initdeferred = initdeferred self.transformed = transformed self.concurrent = concurrent self.if_not_exists = if_not_exists self.reset_default_tblspc = reset_default_tblspc class InferClause(Node): __slots__ = {'indexElems': 'List*', 'whereClause': 'Node*', 'conname': 'char*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, indexElems=None, whereClause=None, conname=None, location=None): # pragma: no cover # noqa: E501 if ((indexElems is not None and whereClause is conname is location is None # noqa: E501 and isinstance(indexElems, dict) and '@' in indexElems)): super().__init__(indexElems) else: self.indexElems = indexElems self.whereClause = whereClause self.conname = conname self.location = location class InferenceElem(Expr): __slots__ = {'expr': 'Node*'} # noqa: E501 def __init__(self, expr=None): # pragma: no cover # noqa: E501 if ((expr is not None and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr class InlineCodeBlock(Node): __slots__ = {'source_text': 'char*', 'langIsTrusted': 'bool', 'atomic': 'bool'} # noqa: E501 def __init__(self, source_text=None, langIsTrusted=None, atomic=None): # pragma: no cover # noqa: E501 if ((source_text is not None and langIsTrusted is atomic is None # noqa: E501 and isinstance(source_text, dict) and '@' in source_text)): super().__init__(source_text) else: self.source_text = source_text self.langIsTrusted = langIsTrusted self.atomic = atomic class InsertStmt(Node): __slots__ = {'relation': 'RangeVar*', 'cols': 'List*', 'selectStmt': 'Node*', 'onConflictClause': 'OnConflictClause*', 'returningList': 'List*', 'withClause': 'WithClause*', 'override': 'OverridingKind'} # noqa: E501 def __init__(self, relation=None, cols=None, selectStmt=None, onConflictClause=None, returningList=None, withClause=None, override=None): # pragma: no cover # noqa: E501 if ((relation is not None and cols is selectStmt is onConflictClause is returningList is withClause is override is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.cols = cols self.selectStmt = selectStmt self.onConflictClause = onConflictClause self.returningList = returningList self.withClause = withClause self.override = override class Integer(Node): __slots__ = {'ival': 'long'} # noqa: E501 def __init__(self, ival=None): # pragma: no cover # noqa: E501 if ((ival is not None and isinstance(ival, dict) and '@' in ival)): super().__init__(ival) else: self.ival = ival class IntoClause(Node): __slots__ = {'rel': 'RangeVar*', 'colNames': 'List*', 'accessMethod': 'char*', 'options': 'List*', 'onCommit': 'OnCommitAction', 'tableSpaceName': 'char*', 'viewQuery': 'Node*', 'skipData': 'bool'} # noqa: E501 def __init__(self, rel=None, colNames=None, accessMethod=None, options=None, onCommit=None, tableSpaceName=None, viewQuery=None, skipData=None): # pragma: no cover # noqa: E501 if ((rel is not None and colNames is accessMethod is options is onCommit is tableSpaceName is viewQuery is skipData is None # noqa: E501 and isinstance(rel, dict) and '@' in rel)): super().__init__(rel) else: self.rel = rel self.colNames = colNames self.accessMethod = accessMethod self.options = options self.onCommit = onCommit self.tableSpaceName = tableSpaceName self.viewQuery = viewQuery self.skipData = skipData class JoinExpr(Node): __slots__ = {'jointype': 'JoinType', 'isNatural': 'bool', 'larg': 'Node*', 'rarg': 'Node*', 'usingClause': 'List*', 'join_using_alias': 'Alias*', 'quals': 'Node*', 'alias': 'Alias*', 'rtindex': 'int'} # noqa: E501 def __init__(self, jointype=None, isNatural=None, larg=None, rarg=None, usingClause=None, join_using_alias=None, quals=None, alias=None, rtindex=None): # pragma: no cover # noqa: E501 if ((jointype is not None and isNatural is larg is rarg is usingClause is join_using_alias is quals is alias is rtindex is None # noqa: E501 and isinstance(jointype, dict) and '@' in jointype)): super().__init__(jointype) else: self.jointype = jointype self.isNatural = isNatural self.larg = larg self.rarg = rarg self.usingClause = usingClause self.join_using_alias = join_using_alias self.quals = quals self.alias = alias self.rtindex = rtindex class JsonAggConstructor(Node): __slots__ = {'output': 'JsonOutput*', 'agg_filter': 'Node*', 'agg_order': 'List*', 'over': 'WindowDef*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, output=None, agg_filter=None, agg_order=None, over=None, location=None): # pragma: no cover # noqa: E501 if ((output is not None and agg_filter is agg_order is over is location is None # noqa: E501 and isinstance(output, dict) and '@' in output)): super().__init__(output) else: self.output = output self.agg_filter = agg_filter self.agg_order = agg_order self.over = over self.location = location class JsonArgument(Node): __slots__ = {'val': 'JsonValueExpr*', 'name': 'char*'} # noqa: E501 def __init__(self, val=None, name=None): # pragma: no cover # noqa: E501 if ((val is not None and name is None # noqa: E501 and isinstance(val, dict) and '@' in val)): super().__init__(val) else: self.val = val self.name = name class JsonArrayAgg(Node): __slots__ = {'constructor': 'JsonAggConstructor*', 'arg': 'JsonValueExpr*', 'absent_on_null': 'bool'} # noqa: E501 def __init__(self, constructor=None, arg=None, absent_on_null=None): # pragma: no cover # noqa: E501 if ((constructor is not None and arg is absent_on_null is None # noqa: E501 and isinstance(constructor, dict) and '@' in constructor)): super().__init__(constructor) else: self.constructor = constructor self.arg = arg self.absent_on_null = absent_on_null class JsonArrayConstructor(Node): __slots__ = {'exprs': 'List*', 'output': 'JsonOutput*', 'absent_on_null': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, exprs=None, output=None, absent_on_null=None, location=None): # pragma: no cover # noqa: E501 if ((exprs is not None and output is absent_on_null is location is None # noqa: E501 and isinstance(exprs, dict) and '@' in exprs)): super().__init__(exprs) else: self.exprs = exprs self.output = output self.absent_on_null = absent_on_null self.location = location class JsonArrayQueryConstructor(Node): __slots__ = {'query': 'Node*', 'output': 'JsonOutput*', 'format': 'JsonFormat*', 'absent_on_null': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, query=None, output=None, format=None, absent_on_null=None, location=None): # pragma: no cover # noqa: E501 if ((query is not None and output is format is absent_on_null is location is None # noqa: E501 and isinstance(query, dict) and '@' in query)): super().__init__(query) else: self.query = query self.output = output self.format = format self.absent_on_null = absent_on_null self.location = location class JsonBehavior(Node): __slots__ = {'btype': 'JsonBehaviorType', 'expr': 'Node*', 'coerce': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, btype=None, expr=None, coerce=None, location=None): # pragma: no cover # noqa: E501 if ((btype is not None and expr is coerce is location is None # noqa: E501 and isinstance(btype, dict) and '@' in btype)): super().__init__(btype) else: self.btype = btype self.expr = expr self.coerce = coerce self.location = location class JsonConstructorExpr(Expr): __slots__ = {'type': 'JsonConstructorType', 'args': 'List*', 'func': 'Expr*', 'coercion': 'Expr*', 'returning': 'JsonReturning*', 'absent_on_null': 'bool', 'unique': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, type=None, args=None, func=None, coercion=None, returning=None, absent_on_null=None, unique=None, location=None): # pragma: no cover # noqa: E501 if ((type is not None and args is func is coercion is returning is absent_on_null is unique is location is None # noqa: E501 and isinstance(type, dict) and '@' in type)): super().__init__(type) else: self.type = type self.args = args self.func = func self.coercion = coercion self.returning = returning self.absent_on_null = absent_on_null self.unique = unique self.location = location class JsonExpr(Expr): __slots__ = {'op': 'JsonExprOp', 'column_name': 'char*', 'formatted_expr': 'Node*', 'format': 'JsonFormat*', 'path_spec': 'Node*', 'returning': 'JsonReturning*', 'passing_names': 'List*', 'passing_values': 'List*', 'on_empty': 'JsonBehavior*', 'on_error': 'JsonBehavior*', 'use_io_coercion': 'bool', 'use_json_coercion': 'bool', 'wrapper': 'JsonWrapper', 'omit_quotes': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, op=None, column_name=None, formatted_expr=None, format=None, path_spec=None, returning=None, passing_names=None, passing_values=None, on_empty=None, on_error=None, use_io_coercion=None, use_json_coercion=None, wrapper=None, omit_quotes=None, location=None): # pragma: no cover # noqa: E501 if ((op is not None and column_name is formatted_expr is format is path_spec is returning is passing_names is passing_values is on_empty is on_error is use_io_coercion is use_json_coercion is wrapper is omit_quotes is location is None # noqa: E501 and isinstance(op, dict) and '@' in op)): super().__init__(op) else: self.op = op self.column_name = column_name self.formatted_expr = formatted_expr self.format = format self.path_spec = path_spec self.returning = returning self.passing_names = passing_names self.passing_values = passing_values self.on_empty = on_empty self.on_error = on_error self.use_io_coercion = use_io_coercion self.use_json_coercion = use_json_coercion self.wrapper = wrapper self.omit_quotes = omit_quotes self.location = location class JsonFormat(Node): __slots__ = {'format_type': 'JsonFormatType', 'encoding': 'JsonEncoding', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, format_type=None, encoding=None, location=None): # pragma: no cover # noqa: E501 if ((format_type is not None and encoding is location is None # noqa: E501 and isinstance(format_type, dict) and '@' in format_type)): super().__init__(format_type) else: self.format_type = format_type self.encoding = encoding self.location = location class JsonFuncExpr(Node): __slots__ = {'op': 'JsonExprOp', 'column_name': 'char*', 'context_item': 'JsonValueExpr*', 'pathspec': 'Node*', 'passing': 'List*', 'output': 'JsonOutput*', 'on_empty': 'JsonBehavior*', 'on_error': 'JsonBehavior*', 'wrapper': 'JsonWrapper', 'quotes': 'JsonQuotes', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, op=None, column_name=None, context_item=None, pathspec=None, passing=None, output=None, on_empty=None, on_error=None, wrapper=None, quotes=None, location=None): # pragma: no cover # noqa: E501 if ((op is not None and column_name is context_item is pathspec is passing is output is on_empty is on_error is wrapper is quotes is location is None # noqa: E501 and isinstance(op, dict) and '@' in op)): super().__init__(op) else: self.op = op self.column_name = column_name self.context_item = context_item self.pathspec = pathspec self.passing = passing self.output = output self.on_empty = on_empty self.on_error = on_error self.wrapper = wrapper self.quotes = quotes self.location = location class JsonIsPredicate(Node): __slots__ = {'expr': 'Node*', 'format': 'JsonFormat*', 'item_type': 'JsonValueType', 'unique_keys': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, expr=None, format=None, item_type=None, unique_keys=None, location=None): # pragma: no cover # noqa: E501 if ((expr is not None and format is item_type is unique_keys is location is None # noqa: E501 and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr self.format = format self.item_type = item_type self.unique_keys = unique_keys self.location = location class JsonKeyValue(Node): __slots__ = {'key': 'Expr*', 'value': 'JsonValueExpr*'} # noqa: E501 def __init__(self, key=None, value=None): # pragma: no cover # noqa: E501 if ((key is not None and value is None # noqa: E501 and isinstance(key, dict) and '@' in key)): super().__init__(key) else: self.key = key self.value = value class JsonObjectAgg(Node): __slots__ = {'constructor': 'JsonAggConstructor*', 'arg': 'JsonKeyValue*', 'absent_on_null': 'bool', 'unique': 'bool'} # noqa: E501 def __init__(self, constructor=None, arg=None, absent_on_null=None, unique=None): # pragma: no cover # noqa: E501 if ((constructor is not None and arg is absent_on_null is unique is None # noqa: E501 and isinstance(constructor, dict) and '@' in constructor)): super().__init__(constructor) else: self.constructor = constructor self.arg = arg self.absent_on_null = absent_on_null self.unique = unique class JsonObjectConstructor(Node): __slots__ = {'exprs': 'List*', 'output': 'JsonOutput*', 'absent_on_null': 'bool', 'unique': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, exprs=None, output=None, absent_on_null=None, unique=None, location=None): # pragma: no cover # noqa: E501 if ((exprs is not None and output is absent_on_null is unique is location is None # noqa: E501 and isinstance(exprs, dict) and '@' in exprs)): super().__init__(exprs) else: self.exprs = exprs self.output = output self.absent_on_null = absent_on_null self.unique = unique self.location = location class JsonOutput(Node): __slots__ = {'typeName': 'TypeName*', 'returning': 'JsonReturning*'} # noqa: E501 def __init__(self, typeName=None, returning=None): # pragma: no cover # noqa: E501 if ((typeName is not None and returning is None # noqa: E501 and isinstance(typeName, dict) and '@' in typeName)): super().__init__(typeName) else: self.typeName = typeName self.returning = returning class JsonParseExpr(Node): __slots__ = {'expr': 'JsonValueExpr*', 'output': 'JsonOutput*', 'unique_keys': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, expr=None, output=None, unique_keys=None, location=None): # pragma: no cover # noqa: E501 if ((expr is not None and output is unique_keys is location is None # noqa: E501 and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr self.output = output self.unique_keys = unique_keys self.location = location class JsonReturning(Node): __slots__ = {'format': 'JsonFormat*', 'typmod': 'int32'} # noqa: E501 def __init__(self, format=None, typmod=None): # pragma: no cover # noqa: E501 if ((format is not None and typmod is None # noqa: E501 and isinstance(format, dict) and '@' in format)): super().__init__(format) else: self.format = format self.typmod = typmod class JsonScalarExpr(Node): __slots__ = {'expr': 'Expr*', 'output': 'JsonOutput*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, expr=None, output=None, location=None): # pragma: no cover # noqa: E501 if ((expr is not None and output is location is None # noqa: E501 and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr self.output = output self.location = location class JsonSerializeExpr(Node): __slots__ = {'expr': 'JsonValueExpr*', 'output': 'JsonOutput*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, expr=None, output=None, location=None): # pragma: no cover # noqa: E501 if ((expr is not None and output is location is None # noqa: E501 and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr self.output = output self.location = location class JsonTable(Node): __slots__ = {'context_item': 'JsonValueExpr*', 'pathspec': 'JsonTablePathSpec*', 'passing': 'List*', 'columns': 'List*', 'on_error': 'JsonBehavior*', 'alias': 'Alias*', 'lateral': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, context_item=None, pathspec=None, passing=None, columns=None, on_error=None, alias=None, lateral=None, location=None): # pragma: no cover # noqa: E501 if ((context_item is not None and pathspec is passing is columns is on_error is alias is lateral is location is None # noqa: E501 and isinstance(context_item, dict) and '@' in context_item)): super().__init__(context_item) else: self.context_item = context_item self.pathspec = pathspec self.passing = passing self.columns = columns self.on_error = on_error self.alias = alias self.lateral = lateral self.location = location class JsonTableColumn(Node): __slots__ = {'coltype': 'JsonTableColumnType', 'name': 'char*', 'typeName': 'TypeName*', 'pathspec': 'JsonTablePathSpec*', 'format': 'JsonFormat*', 'wrapper': 'JsonWrapper', 'quotes': 'JsonQuotes', 'columns': 'List*', 'on_empty': 'JsonBehavior*', 'on_error': 'JsonBehavior*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, coltype=None, name=None, typeName=None, pathspec=None, format=None, wrapper=None, quotes=None, columns=None, on_empty=None, on_error=None, location=None): # pragma: no cover # noqa: E501 if ((coltype is not None and name is typeName is pathspec is format is wrapper is quotes is columns is on_empty is on_error is location is None # noqa: E501 and isinstance(coltype, dict) and '@' in coltype)): super().__init__(coltype) else: self.coltype = coltype self.name = name self.typeName = typeName self.pathspec = pathspec self.format = format self.wrapper = wrapper self.quotes = quotes self.columns = columns self.on_empty = on_empty self.on_error = on_error self.location = location class JsonTablePathSpec(Node): __slots__ = {'string': 'Node*', 'name': 'char*', 'name_location': 'ParseLoc', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location', 'name_location'} def __init__(self, string=None, name=None, name_location=None, location=None): # pragma: no cover # noqa: E501 if ((string is not None and name is name_location is location is None # noqa: E501 and isinstance(string, dict) and '@' in string)): super().__init__(string) else: self.string = string self.name = name self.name_location = name_location self.location = location class JsonValueExpr(Node): __slots__ = {'raw_expr': 'Expr*', 'formatted_expr': 'Expr*', 'format': 'JsonFormat*'} # noqa: E501 def __init__(self, raw_expr=None, formatted_expr=None, format=None): # pragma: no cover # noqa: E501 if ((raw_expr is not None and formatted_expr is format is None # noqa: E501 and isinstance(raw_expr, dict) and '@' in raw_expr)): super().__init__(raw_expr) else: self.raw_expr = raw_expr self.formatted_expr = formatted_expr self.format = format class ListenStmt(Node): __slots__ = {'conditionname': 'char*'} # noqa: E501 def __init__(self, conditionname=None): # pragma: no cover # noqa: E501 if ((conditionname is not None and isinstance(conditionname, dict) and '@' in conditionname)): super().__init__(conditionname) else: self.conditionname = conditionname class LoadStmt(Node): __slots__ = {'filename': 'char*'} # noqa: E501 def __init__(self, filename=None): # pragma: no cover # noqa: E501 if ((filename is not None and isinstance(filename, dict) and '@' in filename)): super().__init__(filename) else: self.filename = filename class LockStmt(Node): __slots__ = {'relations': 'List*', 'mode': 'int', 'nowait': 'bool'} # noqa: E501 def __init__(self, relations=None, mode=None, nowait=None): # pragma: no cover # noqa: E501 if ((relations is not None and mode is nowait is None # noqa: E501 and isinstance(relations, dict) and '@' in relations)): super().__init__(relations) else: self.relations = relations self.mode = mode self.nowait = nowait class LockingClause(Node): __slots__ = {'lockedRels': 'List*', 'strength': 'LockClauseStrength', 'waitPolicy': 'LockWaitPolicy'} # noqa: E501 def __init__(self, lockedRels=None, strength=None, waitPolicy=None): # pragma: no cover # noqa: E501 if ((lockedRels is not None and strength is waitPolicy is None # noqa: E501 and isinstance(lockedRels, dict) and '@' in lockedRels)): super().__init__(lockedRels) else: self.lockedRels = lockedRels self.strength = strength self.waitPolicy = waitPolicy class MergeAction(Node): __slots__ = {'matchKind': 'MergeMatchKind', 'commandType': 'CmdType', 'override': 'OverridingKind', 'qual': 'Node*', 'targetList': 'List*', 'updateColnos': 'List*'} # noqa: E501 def __init__(self, matchKind=None, commandType=None, override=None, qual=None, targetList=None, updateColnos=None): # pragma: no cover # noqa: E501 if ((matchKind is not None and commandType is override is qual is targetList is updateColnos is None # noqa: E501 and isinstance(matchKind, dict) and '@' in matchKind)): super().__init__(matchKind) else: self.matchKind = matchKind self.commandType = commandType self.override = override self.qual = qual self.targetList = targetList self.updateColnos = updateColnos class MergeStmt(Node): __slots__ = {'relation': 'RangeVar*', 'sourceRelation': 'Node*', 'joinCondition': 'Node*', 'mergeWhenClauses': 'List*', 'returningList': 'List*', 'withClause': 'WithClause*'} # noqa: E501 def __init__(self, relation=None, sourceRelation=None, joinCondition=None, mergeWhenClauses=None, returningList=None, withClause=None): # pragma: no cover # noqa: E501 if ((relation is not None and sourceRelation is joinCondition is mergeWhenClauses is returningList is withClause is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.sourceRelation = sourceRelation self.joinCondition = joinCondition self.mergeWhenClauses = mergeWhenClauses self.returningList = returningList self.withClause = withClause class MergeSupportFunc(Expr): __slots__ = {'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, location=None): # pragma: no cover # noqa: E501 if ((location is not None and isinstance(location, dict) and '@' in location)): super().__init__(location) else: self.location = location class MergeWhenClause(Node): __slots__ = {'matchKind': 'MergeMatchKind', 'commandType': 'CmdType', 'override': 'OverridingKind', 'condition': 'Node*', 'targetList': 'List*', 'values': 'List*'} # noqa: E501 def __init__(self, matchKind=None, commandType=None, override=None, condition=None, targetList=None, values=None): # pragma: no cover # noqa: E501 if ((matchKind is not None and commandType is override is condition is targetList is values is None # noqa: E501 and isinstance(matchKind, dict) and '@' in matchKind)): super().__init__(matchKind) else: self.matchKind = matchKind self.commandType = commandType self.override = override self.condition = condition self.targetList = targetList self.values = values class MinMaxExpr(Expr): __slots__ = {'op': 'MinMaxOp', 'args': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, op=None, args=None, location=None): # pragma: no cover # noqa: E501 if ((op is not None and args is location is None # noqa: E501 and isinstance(op, dict) and '@' in op)): super().__init__(op) else: self.op = op self.args = args self.location = location class MultiAssignRef(Node): __slots__ = {'source': 'Node*', 'colno': 'int', 'ncolumns': 'int'} # noqa: E501 def __init__(self, source=None, colno=None, ncolumns=None): # pragma: no cover # noqa: E501 if ((source is not None and colno is ncolumns is None # noqa: E501 and isinstance(source, dict) and '@' in source)): super().__init__(source) else: self.source = source self.colno = colno self.ncolumns = ncolumns class NamedArgExpr(Expr): __slots__ = {'arg': 'Expr*', 'name': 'char*', 'argnumber': 'int', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, name=None, argnumber=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and name is argnumber is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.name = name self.argnumber = argnumber self.location = location class NotifyStmt(Node): __slots__ = {'conditionname': 'char*', 'payload': 'char*'} # noqa: E501 def __init__(self, conditionname=None, payload=None): # pragma: no cover # noqa: E501 if ((conditionname is not None and payload is None # noqa: E501 and isinstance(conditionname, dict) and '@' in conditionname)): super().__init__(conditionname) else: self.conditionname = conditionname self.payload = payload class NullTest(Expr): __slots__ = {'arg': 'Expr*', 'nulltesttype': 'NullTestType', 'argisrow': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, nulltesttype=None, argisrow=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and nulltesttype is argisrow is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.nulltesttype = nulltesttype self.argisrow = argisrow self.location = location class ObjectWithArgs(Node): __slots__ = {'objname': 'List*', 'objargs': 'List*', 'objfuncargs': 'List*', 'args_unspecified': 'bool'} # noqa: E501 def __init__(self, objname=None, objargs=None, objfuncargs=None, args_unspecified=None): # pragma: no cover # noqa: E501 if ((objname is not None and objargs is objfuncargs is args_unspecified is None # noqa: E501 and isinstance(objname, dict) and '@' in objname)): super().__init__(objname) else: self.objname = objname self.objargs = objargs self.objfuncargs = objfuncargs self.args_unspecified = args_unspecified class OnConflictClause(Node): __slots__ = {'action': 'OnConflictAction', 'infer': 'InferClause*', 'targetList': 'List*', 'whereClause': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, action=None, infer=None, targetList=None, whereClause=None, location=None): # pragma: no cover # noqa: E501 if ((action is not None and infer is targetList is whereClause is location is None # noqa: E501 and isinstance(action, dict) and '@' in action)): super().__init__(action) else: self.action = action self.infer = infer self.targetList = targetList self.whereClause = whereClause self.location = location class OnConflictExpr(Node): __slots__ = {'action': 'OnConflictAction', 'arbiterElems': 'List*', 'arbiterWhere': 'Node*', 'onConflictSet': 'List*', 'onConflictWhere': 'Node*', 'exclRelIndex': 'int', 'exclRelTlist': 'List*'} # noqa: E501 def __init__(self, action=None, arbiterElems=None, arbiterWhere=None, onConflictSet=None, onConflictWhere=None, exclRelIndex=None, exclRelTlist=None): # pragma: no cover # noqa: E501 if ((action is not None and arbiterElems is arbiterWhere is onConflictSet is onConflictWhere is exclRelIndex is exclRelTlist is None # noqa: E501 and isinstance(action, dict) and '@' in action)): super().__init__(action) else: self.action = action self.arbiterElems = arbiterElems self.arbiterWhere = arbiterWhere self.onConflictSet = onConflictSet self.onConflictWhere = onConflictWhere self.exclRelIndex = exclRelIndex self.exclRelTlist = exclRelTlist class OpExpr(Expr): __slots__ = {'opretset': 'bool', 'args': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, opretset=None, args=None, location=None): # pragma: no cover # noqa: E501 if ((opretset is not None and args is location is None # noqa: E501 and isinstance(opretset, dict) and '@' in opretset)): super().__init__(opretset) else: self.opretset = opretset self.args = args self.location = location class PLAssignStmt(Node): __slots__ = {'name': 'char*', 'indirection': 'List*', 'nnames': 'int', 'val': 'SelectStmt*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, name=None, indirection=None, nnames=None, val=None, location=None): # pragma: no cover # noqa: E501 if ((name is not None and indirection is nnames is val is location is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.indirection = indirection self.nnames = nnames self.val = val self.location = location class Param(Expr): __slots__ = {'paramkind': 'ParamKind', 'paramid': 'int', 'paramtypmod': 'int32', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, paramkind=None, paramid=None, paramtypmod=None, location=None): # pragma: no cover # noqa: E501 if ((paramkind is not None and paramid is paramtypmod is location is None # noqa: E501 and isinstance(paramkind, dict) and '@' in paramkind)): super().__init__(paramkind) else: self.paramkind = paramkind self.paramid = paramid self.paramtypmod = paramtypmod self.location = location class ParamRef(Node): __slots__ = {'number': 'int', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, number=None, location=None): # pragma: no cover # noqa: E501 if ((number is not None and location is None # noqa: E501 and isinstance(number, dict) and '@' in number)): super().__init__(number) else: self.number = number self.location = location class PartitionBoundSpec(Node): __slots__ = {'strategy': 'char', 'is_default': 'bool', 'modulus': 'int', 'remainder': 'int', 'listdatums': 'List*', 'lowerdatums': 'List*', 'upperdatums': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, strategy=None, is_default=None, modulus=None, remainder=None, listdatums=None, lowerdatums=None, upperdatums=None, location=None): # pragma: no cover # noqa: E501 if ((strategy is not None and is_default is modulus is remainder is listdatums is lowerdatums is upperdatums is location is None # noqa: E501 and isinstance(strategy, dict) and '@' in strategy)): super().__init__(strategy) else: self.strategy = strategy self.is_default = is_default self.modulus = modulus self.remainder = remainder self.listdatums = listdatums self.lowerdatums = lowerdatums self.upperdatums = upperdatums self.location = location class PartitionCmd(Node): __slots__ = {'name': 'RangeVar*', 'bound': 'PartitionBoundSpec*', 'concurrent': 'bool'} # noqa: E501 def __init__(self, name=None, bound=None, concurrent=None): # pragma: no cover # noqa: E501 if ((name is not None and bound is concurrent is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.bound = bound self.concurrent = concurrent class PartitionElem(Node): __slots__ = {'name': 'char*', 'expr': 'Node*', 'collation': 'List*', 'opclass': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, name=None, expr=None, collation=None, opclass=None, location=None): # pragma: no cover # noqa: E501 if ((name is not None and expr is collation is opclass is location is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.expr = expr self.collation = collation self.opclass = opclass self.location = location class PartitionRangeDatum(Node): __slots__ = {'kind': 'PartitionRangeDatumKind', 'value': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, kind=None, value=None, location=None): # pragma: no cover # noqa: E501 if ((kind is not None and value is location is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.value = value self.location = location class PartitionSpec(Node): __slots__ = {'strategy': 'PartitionStrategy', 'partParams': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, strategy=None, partParams=None, location=None): # pragma: no cover # noqa: E501 if ((strategy is not None and partParams is location is None # noqa: E501 and isinstance(strategy, dict) and '@' in strategy)): super().__init__(strategy) else: self.strategy = strategy self.partParams = partParams self.location = location class PrepareStmt(Node): __slots__ = {'name': 'char*', 'argtypes': 'List*', 'query': 'Node*'} # noqa: E501 def __init__(self, name=None, argtypes=None, query=None): # pragma: no cover # noqa: E501 if ((name is not None and argtypes is query is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.argtypes = argtypes self.query = query class PublicationObjSpec(Node): __slots__ = {'pubobjtype': 'PublicationObjSpecType', 'name': 'char*', 'pubtable': 'PublicationTable*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, pubobjtype=None, name=None, pubtable=None, location=None): # pragma: no cover # noqa: E501 if ((pubobjtype is not None and name is pubtable is location is None # noqa: E501 and isinstance(pubobjtype, dict) and '@' in pubobjtype)): super().__init__(pubobjtype) else: self.pubobjtype = pubobjtype self.name = name self.pubtable = pubtable self.location = location class PublicationTable(Node): __slots__ = {'relation': 'RangeVar*', 'whereClause': 'Node*', 'columns': 'List*'} # noqa: E501 def __init__(self, relation=None, whereClause=None, columns=None): # pragma: no cover # noqa: E501 if ((relation is not None and whereClause is columns is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.whereClause = whereClause self.columns = columns class Query(Node): __slots__ = {'commandType': 'CmdType', 'querySource': 'QuerySource', 'canSetTag': 'bool', 'utilityStmt': 'Node*', 'resultRelation': 'int', 'hasAggs': 'bool', 'hasWindowFuncs': 'bool', 'hasTargetSRFs': 'bool', 'hasSubLinks': 'bool', 'hasDistinctOn': 'bool', 'hasRecursive': 'bool', 'hasModifyingCTE': 'bool', 'hasForUpdate': 'bool', 'hasRowSecurity': 'bool', 'isReturn': 'bool', 'cteList': 'List*', 'rtable': 'List*', 'rteperminfos': 'List*', 'jointree': 'FromExpr*', 'mergeActionList': 'List*', 'mergeTargetRelation': 'int', 'mergeJoinCondition': 'Node*', 'targetList': 'List*', 'override': 'OverridingKind', 'onConflict': 'OnConflictExpr*', 'returningList': 'List*', 'groupClause': 'List*', 'groupDistinct': 'bool', 'groupingSets': 'List*', 'havingQual': 'Node*', 'windowClause': 'List*', 'distinctClause': 'List*', 'sortClause': 'List*', 'limitOffset': 'Node*', 'limitCount': 'Node*', 'limitOption': 'LimitOption', 'rowMarks': 'List*', 'setOperations': 'Node*', 'constraintDeps': 'List*', 'withCheckOptions': 'List*', 'stmt_location': 'ParseLoc', 'stmt_len': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'stmt_len', 'stmt_location'} def __init__(self, commandType=None, querySource=None, canSetTag=None, utilityStmt=None, resultRelation=None, hasAggs=None, hasWindowFuncs=None, hasTargetSRFs=None, hasSubLinks=None, hasDistinctOn=None, hasRecursive=None, hasModifyingCTE=None, hasForUpdate=None, hasRowSecurity=None, isReturn=None, cteList=None, rtable=None, rteperminfos=None, jointree=None, mergeActionList=None, mergeTargetRelation=None, mergeJoinCondition=None, targetList=None, override=None, onConflict=None, returningList=None, groupClause=None, groupDistinct=None, groupingSets=None, havingQual=None, windowClause=None, distinctClause=None, sortClause=None, limitOffset=None, limitCount=None, limitOption=None, rowMarks=None, setOperations=None, constraintDeps=None, withCheckOptions=None, stmt_location=None, stmt_len=None): # pragma: no cover # noqa: E501 if ((commandType is not None and querySource is canSetTag is utilityStmt is resultRelation is hasAggs is hasWindowFuncs is hasTargetSRFs is hasSubLinks is hasDistinctOn is hasRecursive is hasModifyingCTE is hasForUpdate is hasRowSecurity is isReturn is cteList is rtable is rteperminfos is jointree is mergeActionList is mergeTargetRelation is mergeJoinCondition is targetList is override is onConflict is returningList is groupClause is groupDistinct is groupingSets is havingQual is windowClause is distinctClause is sortClause is limitOffset is limitCount is limitOption is rowMarks is setOperations is constraintDeps is withCheckOptions is stmt_location is stmt_len is None # noqa: E501 and isinstance(commandType, dict) and '@' in commandType)): super().__init__(commandType) else: self.commandType = commandType self.querySource = querySource self.canSetTag = canSetTag self.utilityStmt = utilityStmt self.resultRelation = resultRelation self.hasAggs = hasAggs self.hasWindowFuncs = hasWindowFuncs self.hasTargetSRFs = hasTargetSRFs self.hasSubLinks = hasSubLinks self.hasDistinctOn = hasDistinctOn self.hasRecursive = hasRecursive self.hasModifyingCTE = hasModifyingCTE self.hasForUpdate = hasForUpdate self.hasRowSecurity = hasRowSecurity self.isReturn = isReturn self.cteList = cteList self.rtable = rtable self.rteperminfos = rteperminfos self.jointree = jointree self.mergeActionList = mergeActionList self.mergeTargetRelation = mergeTargetRelation self.mergeJoinCondition = mergeJoinCondition self.targetList = targetList self.override = override self.onConflict = onConflict self.returningList = returningList self.groupClause = groupClause self.groupDistinct = groupDistinct self.groupingSets = groupingSets self.havingQual = havingQual self.windowClause = windowClause self.distinctClause = distinctClause self.sortClause = sortClause self.limitOffset = limitOffset self.limitCount = limitCount self.limitOption = limitOption self.rowMarks = rowMarks self.setOperations = setOperations self.constraintDeps = constraintDeps self.withCheckOptions = withCheckOptions self.stmt_location = stmt_location self.stmt_len = stmt_len class RTEPermissionInfo(Node): __slots__ = {'inh': 'bool', 'requiredPerms': 'AclMode', 'selectedCols': 'Bitmapset*', 'insertedCols': 'Bitmapset*', 'updatedCols': 'Bitmapset*'} # noqa: E501 def __init__(self, inh=None, requiredPerms=None, selectedCols=None, insertedCols=None, updatedCols=None): # pragma: no cover # noqa: E501 if ((inh is not None and requiredPerms is selectedCols is insertedCols is updatedCols is None # noqa: E501 and isinstance(inh, dict) and '@' in inh)): super().__init__(inh) else: self.inh = inh self.requiredPerms = requiredPerms self.selectedCols = selectedCols self.insertedCols = insertedCols self.updatedCols = updatedCols class RangeFunction(Node): __slots__ = {'lateral': 'bool', 'ordinality': 'bool', 'is_rowsfrom': 'bool', 'functions': 'List*', 'alias': 'Alias*', 'coldeflist': 'List*'} # noqa: E501 def __init__(self, lateral=None, ordinality=None, is_rowsfrom=None, functions=None, alias=None, coldeflist=None): # pragma: no cover # noqa: E501 if ((lateral is not None and ordinality is is_rowsfrom is functions is alias is coldeflist is None # noqa: E501 and isinstance(lateral, dict) and '@' in lateral)): super().__init__(lateral) else: self.lateral = lateral self.ordinality = ordinality self.is_rowsfrom = is_rowsfrom self.functions = functions self.alias = alias self.coldeflist = coldeflist class RangeSubselect(Node): __slots__ = {'lateral': 'bool', 'subquery': 'Node*', 'alias': 'Alias*'} # noqa: E501 def __init__(self, lateral=None, subquery=None, alias=None): # pragma: no cover # noqa: E501 if ((lateral is not None and subquery is alias is None # noqa: E501 and isinstance(lateral, dict) and '@' in lateral)): super().__init__(lateral) else: self.lateral = lateral self.subquery = subquery self.alias = alias class RangeTableFunc(Node): __slots__ = {'lateral': 'bool', 'docexpr': 'Node*', 'rowexpr': 'Node*', 'namespaces': 'List*', 'columns': 'List*', 'alias': 'Alias*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, lateral=None, docexpr=None, rowexpr=None, namespaces=None, columns=None, alias=None, location=None): # pragma: no cover # noqa: E501 if ((lateral is not None and docexpr is rowexpr is namespaces is columns is alias is location is None # noqa: E501 and isinstance(lateral, dict) and '@' in lateral)): super().__init__(lateral) else: self.lateral = lateral self.docexpr = docexpr self.rowexpr = rowexpr self.namespaces = namespaces self.columns = columns self.alias = alias self.location = location class RangeTableFuncCol(Node): __slots__ = {'colname': 'char*', 'typeName': 'TypeName*', 'for_ordinality': 'bool', 'is_not_null': 'bool', 'colexpr': 'Node*', 'coldefexpr': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, colname=None, typeName=None, for_ordinality=None, is_not_null=None, colexpr=None, coldefexpr=None, location=None): # pragma: no cover # noqa: E501 if ((colname is not None and typeName is for_ordinality is is_not_null is colexpr is coldefexpr is location is None # noqa: E501 and isinstance(colname, dict) and '@' in colname)): super().__init__(colname) else: self.colname = colname self.typeName = typeName self.for_ordinality = for_ordinality self.is_not_null = is_not_null self.colexpr = colexpr self.coldefexpr = coldefexpr self.location = location class RangeTableSample(Node): __slots__ = {'relation': 'Node*', 'method': 'List*', 'args': 'List*', 'repeatable': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, relation=None, method=None, args=None, repeatable=None, location=None): # pragma: no cover # noqa: E501 if ((relation is not None and method is args is repeatable is location is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.method = method self.args = args self.repeatable = repeatable self.location = location class RangeTblEntry(Node): __slots__ = {'alias': 'Alias*', 'eref': 'Alias*', 'rtekind': 'RTEKind', 'inh': 'bool', 'relkind': 'char', 'rellockmode': 'int', 'perminfoindex': 'Index', 'tablesample': 'TableSampleClause*', 'subquery': 'Query*', 'security_barrier': 'bool', 'jointype': 'JoinType', 'joinmergedcols': 'int', 'joinaliasvars': 'List*', 'joinleftcols': 'List*', 'joinrightcols': 'List*', 'join_using_alias': 'Alias*', 'functions': 'List*', 'funcordinality': 'bool', 'tablefunc': 'TableFunc*', 'values_lists': 'List*', 'ctename': 'char*', 'ctelevelsup': 'Index', 'self_reference': 'bool', 'coltypes': 'List*', 'coltypmods': 'List*', 'colcollations': 'List*', 'enrname': 'char*', 'enrtuples': 'Cardinality', 'lateral': 'bool', 'inFromCl': 'bool', 'securityQuals': 'List*'} # noqa: E501 def __init__(self, alias=None, eref=None, rtekind=None, inh=None, relkind=None, rellockmode=None, perminfoindex=None, tablesample=None, subquery=None, security_barrier=None, jointype=None, joinmergedcols=None, joinaliasvars=None, joinleftcols=None, joinrightcols=None, join_using_alias=None, functions=None, funcordinality=None, tablefunc=None, values_lists=None, ctename=None, ctelevelsup=None, self_reference=None, coltypes=None, coltypmods=None, colcollations=None, enrname=None, enrtuples=None, lateral=None, inFromCl=None, securityQuals=None): # pragma: no cover # noqa: E501 if ((alias is not None and eref is rtekind is inh is relkind is rellockmode is perminfoindex is tablesample is subquery is security_barrier is jointype is joinmergedcols is joinaliasvars is joinleftcols is joinrightcols is join_using_alias is functions is funcordinality is tablefunc is values_lists is ctename is ctelevelsup is self_reference is coltypes is coltypmods is colcollations is enrname is enrtuples is lateral is inFromCl is securityQuals is None # noqa: E501 and isinstance(alias, dict) and '@' in alias)): super().__init__(alias) else: self.alias = alias self.eref = eref self.rtekind = rtekind self.inh = inh self.relkind = relkind self.rellockmode = rellockmode self.perminfoindex = perminfoindex self.tablesample = tablesample self.subquery = subquery self.security_barrier = security_barrier self.jointype = jointype self.joinmergedcols = joinmergedcols self.joinaliasvars = joinaliasvars self.joinleftcols = joinleftcols self.joinrightcols = joinrightcols self.join_using_alias = join_using_alias self.functions = functions self.funcordinality = funcordinality self.tablefunc = tablefunc self.values_lists = values_lists self.ctename = ctename self.ctelevelsup = ctelevelsup self.self_reference = self_reference self.coltypes = coltypes self.coltypmods = coltypmods self.colcollations = colcollations self.enrname = enrname self.enrtuples = enrtuples self.lateral = lateral self.inFromCl = inFromCl self.securityQuals = securityQuals class RangeTblFunction(Node): __slots__ = {'funcexpr': 'Node*', 'funccolcount': 'int', 'funccolnames': 'List*', 'funccoltypes': 'List*', 'funccoltypmods': 'List*', 'funccolcollations': 'List*', 'funcparams': 'Bitmapset*'} # noqa: E501 def __init__(self, funcexpr=None, funccolcount=None, funccolnames=None, funccoltypes=None, funccoltypmods=None, funccolcollations=None, funcparams=None): # pragma: no cover # noqa: E501 if ((funcexpr is not None and funccolcount is funccolnames is funccoltypes is funccoltypmods is funccolcollations is funcparams is None # noqa: E501 and isinstance(funcexpr, dict) and '@' in funcexpr)): super().__init__(funcexpr) else: self.funcexpr = funcexpr self.funccolcount = funccolcount self.funccolnames = funccolnames self.funccoltypes = funccoltypes self.funccoltypmods = funccoltypmods self.funccolcollations = funccolcollations self.funcparams = funcparams class RangeTblRef(Node): __slots__ = {'rtindex': 'int'} # noqa: E501 def __init__(self, rtindex=None): # pragma: no cover # noqa: E501 if ((rtindex is not None and isinstance(rtindex, dict) and '@' in rtindex)): super().__init__(rtindex) else: self.rtindex = rtindex class RangeVar(Node): __slots__ = {'catalogname': 'char*', 'schemaname': 'char*', 'relname': 'char*', 'inh': 'bool', 'relpersistence': 'char', 'alias': 'Alias*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, catalogname=None, schemaname=None, relname=None, inh=None, relpersistence=None, alias=None, location=None): # pragma: no cover # noqa: E501 if ((catalogname is not None and schemaname is relname is inh is relpersistence is alias is location is None # noqa: E501 and isinstance(catalogname, dict) and '@' in catalogname)): super().__init__(catalogname) else: self.catalogname = catalogname self.schemaname = schemaname self.relname = relname self.inh = inh self.relpersistence = relpersistence self.alias = alias self.location = location class RawStmt(Node): __slots__ = {'stmt': 'Node*', 'stmt_location': 'ParseLoc', 'stmt_len': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'stmt_len', 'stmt_location'} def __init__(self, stmt=None, stmt_location=None, stmt_len=None): # pragma: no cover # noqa: E501 if ((stmt is not None and stmt_location is stmt_len is None # noqa: E501 and isinstance(stmt, dict) and '@' in stmt)): super().__init__(stmt) else: self.stmt = stmt self.stmt_location = stmt_location self.stmt_len = stmt_len class ReassignOwnedStmt(Node): __slots__ = {'roles': 'List*', 'newrole': 'RoleSpec*'} # noqa: E501 def __init__(self, roles=None, newrole=None): # pragma: no cover # noqa: E501 if ((roles is not None and newrole is None # noqa: E501 and isinstance(roles, dict) and '@' in roles)): super().__init__(roles) else: self.roles = roles self.newrole = newrole class RefreshMatViewStmt(Node): __slots__ = {'concurrent': 'bool', 'skipData': 'bool', 'relation': 'RangeVar*'} # noqa: E501 def __init__(self, concurrent=None, skipData=None, relation=None): # pragma: no cover # noqa: E501 if ((concurrent is not None and skipData is relation is None # noqa: E501 and isinstance(concurrent, dict) and '@' in concurrent)): super().__init__(concurrent) else: self.concurrent = concurrent self.skipData = skipData self.relation = relation class ReindexStmt(Node): __slots__ = {'kind': 'ReindexObjectType', 'relation': 'RangeVar*', 'name': 'char*', 'params': 'List*'} # noqa: E501 def __init__(self, kind=None, relation=None, name=None, params=None): # pragma: no cover # noqa: E501 if ((kind is not None and relation is name is params is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.relation = relation self.name = name self.params = params class RelabelType(Expr): __slots__ = {'arg': 'Expr*', 'resulttypmod': 'int32', 'relabelformat': 'CoercionForm', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location', 'relabelformat'} def __init__(self, arg=None, resulttypmod=None, relabelformat=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and resulttypmod is relabelformat is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.resulttypmod = resulttypmod self.relabelformat = relabelformat self.location = location class RenameStmt(Node): __slots__ = {'renameType': 'ObjectType', 'relationType': 'ObjectType', 'relation': 'RangeVar*', 'object': 'Node*', 'subname': 'char*', 'newname': 'char*', 'behavior': 'DropBehavior', 'missing_ok': 'bool'} # noqa: E501 def __init__(self, renameType=None, relationType=None, relation=None, object=None, subname=None, newname=None, behavior=None, missing_ok=None): # pragma: no cover # noqa: E501 if ((renameType is not None and relationType is relation is object is subname is newname is behavior is missing_ok is None # noqa: E501 and isinstance(renameType, dict) and '@' in renameType)): super().__init__(renameType) else: self.renameType = renameType self.relationType = relationType self.relation = relation self.object = object self.subname = subname self.newname = newname self.behavior = behavior self.missing_ok = missing_ok class ReplicaIdentityStmt(Node): __slots__ = {'identity_type': 'char', 'name': 'char*'} # noqa: E501 def __init__(self, identity_type=None, name=None): # pragma: no cover # noqa: E501 if ((identity_type is not None and name is None # noqa: E501 and isinstance(identity_type, dict) and '@' in identity_type)): super().__init__(identity_type) else: self.identity_type = identity_type self.name = name class ResTarget(Node): __slots__ = {'name': 'char*', 'indirection': 'List*', 'val': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, name=None, indirection=None, val=None, location=None): # pragma: no cover # noqa: E501 if ((name is not None and indirection is val is location is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.indirection = indirection self.val = val self.location = location class ReturnStmt(Node): __slots__ = {'returnval': 'Node*'} # noqa: E501 def __init__(self, returnval=None): # pragma: no cover # noqa: E501 if ((returnval is not None and isinstance(returnval, dict) and '@' in returnval)): super().__init__(returnval) else: self.returnval = returnval class RoleSpec(Node): __slots__ = {'roletype': 'RoleSpecType', 'rolename': 'char*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, roletype=None, rolename=None, location=None): # pragma: no cover # noqa: E501 if ((roletype is not None and rolename is location is None # noqa: E501 and isinstance(roletype, dict) and '@' in roletype)): super().__init__(roletype) else: self.roletype = roletype self.rolename = rolename self.location = location class RowCompareExpr(Expr): __slots__ = {'rctype': 'RowCompareType', 'opnos': 'List*', 'opfamilies': 'List*', 'inputcollids': 'List*', 'largs': 'List*', 'rargs': 'List*'} # noqa: E501 def __init__(self, rctype=None, opnos=None, opfamilies=None, inputcollids=None, largs=None, rargs=None): # pragma: no cover # noqa: E501 if ((rctype is not None and opnos is opfamilies is inputcollids is largs is rargs is None # noqa: E501 and isinstance(rctype, dict) and '@' in rctype)): super().__init__(rctype) else: self.rctype = rctype self.opnos = opnos self.opfamilies = opfamilies self.inputcollids = inputcollids self.largs = largs self.rargs = rargs class RowExpr(Expr): __slots__ = {'args': 'List*', 'row_format': 'CoercionForm', 'colnames': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location', 'row_format'} def __init__(self, args=None, row_format=None, colnames=None, location=None): # pragma: no cover # noqa: E501 if ((args is not None and row_format is colnames is location is None # noqa: E501 and isinstance(args, dict) and '@' in args)): super().__init__(args) else: self.args = args self.row_format = row_format self.colnames = colnames self.location = location class RowMarkClause(Node): __slots__ = {'rti': 'Index', 'strength': 'LockClauseStrength', 'waitPolicy': 'LockWaitPolicy', 'pushedDown': 'bool'} # noqa: E501 def __init__(self, rti=None, strength=None, waitPolicy=None, pushedDown=None): # pragma: no cover # noqa: E501 if ((rti is not None and strength is waitPolicy is pushedDown is None # noqa: E501 and isinstance(rti, dict) and '@' in rti)): super().__init__(rti) else: self.rti = rti self.strength = strength self.waitPolicy = waitPolicy self.pushedDown = pushedDown class RuleStmt(Node): __slots__ = {'relation': 'RangeVar*', 'rulename': 'char*', 'whereClause': 'Node*', 'event': 'CmdType', 'instead': 'bool', 'actions': 'List*', 'replace': 'bool'} # noqa: E501 def __init__(self, relation=None, rulename=None, whereClause=None, event=None, instead=None, actions=None, replace=None): # pragma: no cover # noqa: E501 if ((relation is not None and rulename is whereClause is event is instead is actions is replace is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.rulename = rulename self.whereClause = whereClause self.event = event self.instead = instead self.actions = actions self.replace = replace class SQLValueFunction(Expr): __slots__ = {'op': 'SQLValueFunctionOp', 'typmod': 'int32', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, op=None, typmod=None, location=None): # pragma: no cover # noqa: E501 if ((op is not None and typmod is location is None # noqa: E501 and isinstance(op, dict) and '@' in op)): super().__init__(op) else: self.op = op self.typmod = typmod self.location = location class ScalarArrayOpExpr(Expr): __slots__ = {'useOr': 'bool', 'args': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, useOr=None, args=None, location=None): # pragma: no cover # noqa: E501 if ((useOr is not None and args is location is None # noqa: E501 and isinstance(useOr, dict) and '@' in useOr)): super().__init__(useOr) else: self.useOr = useOr self.args = args self.location = location class SecLabelStmt(Node): __slots__ = {'objtype': 'ObjectType', 'object': 'Node*', 'provider': 'char*', 'label': 'char*'} # noqa: E501 def __init__(self, objtype=None, object=None, provider=None, label=None): # pragma: no cover # noqa: E501 if ((objtype is not None and object is provider is label is None # noqa: E501 and isinstance(objtype, dict) and '@' in objtype)): super().__init__(objtype) else: self.objtype = objtype self.object = object self.provider = provider self.label = label class SelectStmt(Node): __slots__ = {'distinctClause': 'List*', 'intoClause': 'IntoClause*', 'targetList': 'List*', 'fromClause': 'List*', 'whereClause': 'Node*', 'groupClause': 'List*', 'groupDistinct': 'bool', 'havingClause': 'Node*', 'windowClause': 'List*', 'valuesLists': 'List*', 'sortClause': 'List*', 'limitOffset': 'Node*', 'limitCount': 'Node*', 'limitOption': 'LimitOption', 'lockingClause': 'List*', 'withClause': 'WithClause*', 'op': 'SetOperation', 'all': 'bool', 'larg': 'SelectStmt*', 'rarg': 'SelectStmt*'} # noqa: E501 def __init__(self, distinctClause=None, intoClause=None, targetList=None, fromClause=None, whereClause=None, groupClause=None, groupDistinct=None, havingClause=None, windowClause=None, valuesLists=None, sortClause=None, limitOffset=None, limitCount=None, limitOption=None, lockingClause=None, withClause=None, op=None, all=None, larg=None, rarg=None): # pragma: no cover # noqa: E501 if ((distinctClause is not None and intoClause is targetList is fromClause is whereClause is groupClause is groupDistinct is havingClause is windowClause is valuesLists is sortClause is limitOffset is limitCount is limitOption is lockingClause is withClause is op is all is larg is rarg is None # noqa: E501 and isinstance(distinctClause, dict) and '@' in distinctClause)): super().__init__(distinctClause) else: self.distinctClause = distinctClause self.intoClause = intoClause self.targetList = targetList self.fromClause = fromClause self.whereClause = whereClause self.groupClause = groupClause self.groupDistinct = groupDistinct self.havingClause = havingClause self.windowClause = windowClause self.valuesLists = valuesLists self.sortClause = sortClause self.limitOffset = limitOffset self.limitCount = limitCount self.limitOption = limitOption self.lockingClause = lockingClause self.withClause = withClause self.op = op self.all = all self.larg = larg self.rarg = rarg class SetOperationStmt(Node): __slots__ = {'op': 'SetOperation', 'all': 'bool', 'larg': 'Node*', 'rarg': 'Node*', 'colTypes': 'List*', 'colTypmods': 'List*', 'colCollations': 'List*', 'groupClauses': 'List*'} # noqa: E501 def __init__(self, op=None, all=None, larg=None, rarg=None, colTypes=None, colTypmods=None, colCollations=None, groupClauses=None): # pragma: no cover # noqa: E501 if ((op is not None and all is larg is rarg is colTypes is colTypmods is colCollations is groupClauses is None # noqa: E501 and isinstance(op, dict) and '@' in op)): super().__init__(op) else: self.op = op self.all = all self.larg = larg self.rarg = rarg self.colTypes = colTypes self.colTypmods = colTypmods self.colCollations = colCollations self.groupClauses = groupClauses class SetToDefault(Expr): __slots__ = {'typeMod': 'int32', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, typeMod=None, location=None): # pragma: no cover # noqa: E501 if ((typeMod is not None and location is None # noqa: E501 and isinstance(typeMod, dict) and '@' in typeMod)): super().__init__(typeMod) else: self.typeMod = typeMod self.location = location class SinglePartitionSpec(Node): __slots__ = {} # noqa: E501 def __init__(self): # pragma: no cover pass class SortBy(Node): __slots__ = {'node': 'Node*', 'sortby_dir': 'SortByDir', 'sortby_nulls': 'SortByNulls', 'useOp': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, node=None, sortby_dir=None, sortby_nulls=None, useOp=None, location=None): # pragma: no cover # noqa: E501 if ((node is not None and sortby_dir is sortby_nulls is useOp is location is None # noqa: E501 and isinstance(node, dict) and '@' in node)): super().__init__(node) else: self.node = node self.sortby_dir = sortby_dir self.sortby_nulls = sortby_nulls self.useOp = useOp self.location = location class SortGroupClause(Node): __slots__ = {'tleSortGroupRef': 'Index', 'nulls_first': 'bool', 'hashable': 'bool'} # noqa: E501 def __init__(self, tleSortGroupRef=None, nulls_first=None, hashable=None): # pragma: no cover # noqa: E501 if ((tleSortGroupRef is not None and nulls_first is hashable is None # noqa: E501 and isinstance(tleSortGroupRef, dict) and '@' in tleSortGroupRef)): super().__init__(tleSortGroupRef) else: self.tleSortGroupRef = tleSortGroupRef self.nulls_first = nulls_first self.hashable = hashable class StatsElem(Node): __slots__ = {'name': 'char*', 'expr': 'Node*'} # noqa: E501 def __init__(self, name=None, expr=None): # pragma: no cover # noqa: E501 if ((name is not None and expr is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.expr = expr class String(Node): __slots__ = {'sval': 'char*'} # noqa: E501 def __init__(self, sval=None): # pragma: no cover # noqa: E501 if ((sval is not None and isinstance(sval, dict) and '@' in sval)): super().__init__(sval) else: self.sval = sval class SubLink(Expr): __slots__ = {'subLinkType': 'SubLinkType', 'subLinkId': 'int', 'testexpr': 'Node*', 'operName': 'List*', 'subselect': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, subLinkType=None, subLinkId=None, testexpr=None, operName=None, subselect=None, location=None): # pragma: no cover # noqa: E501 if ((subLinkType is not None and subLinkId is testexpr is operName is subselect is location is None # noqa: E501 and isinstance(subLinkType, dict) and '@' in subLinkType)): super().__init__(subLinkType) else: self.subLinkType = subLinkType self.subLinkId = subLinkId self.testexpr = testexpr self.operName = operName self.subselect = subselect self.location = location class SubPlan(Expr): __slots__ = {'subLinkType': 'SubLinkType', 'testexpr': 'Node*', 'paramIds': 'List*', 'plan_id': 'int', 'plan_name': 'char*', 'firstColTypmod': 'int32', 'useHashTable': 'bool', 'unknownEqFalse': 'bool', 'parallel_safe': 'bool', 'setParam': 'List*', 'parParam': 'List*', 'args': 'List*', 'startup_cost': 'Cost', 'per_call_cost': 'Cost'} # noqa: E501 def __init__(self, subLinkType=None, testexpr=None, paramIds=None, plan_id=None, plan_name=None, firstColTypmod=None, useHashTable=None, unknownEqFalse=None, parallel_safe=None, setParam=None, parParam=None, args=None, startup_cost=None, per_call_cost=None): # pragma: no cover # noqa: E501 if ((subLinkType is not None and testexpr is paramIds is plan_id is plan_name is firstColTypmod is useHashTable is unknownEqFalse is parallel_safe is setParam is parParam is args is startup_cost is per_call_cost is None # noqa: E501 and isinstance(subLinkType, dict) and '@' in subLinkType)): super().__init__(subLinkType) else: self.subLinkType = subLinkType self.testexpr = testexpr self.paramIds = paramIds self.plan_id = plan_id self.plan_name = plan_name self.firstColTypmod = firstColTypmod self.useHashTable = useHashTable self.unknownEqFalse = unknownEqFalse self.parallel_safe = parallel_safe self.setParam = setParam self.parParam = parParam self.args = args self.startup_cost = startup_cost self.per_call_cost = per_call_cost class SubscriptingRef(Expr): __slots__ = {'reftypmod': 'int32', 'refupperindexpr': 'List*', 'reflowerindexpr': 'List*', 'refexpr': 'Expr*', 'refassgnexpr': 'Expr*'} # noqa: E501 def __init__(self, reftypmod=None, refupperindexpr=None, reflowerindexpr=None, refexpr=None, refassgnexpr=None): # pragma: no cover # noqa: E501 if ((reftypmod is not None and refupperindexpr is reflowerindexpr is refexpr is refassgnexpr is None # noqa: E501 and isinstance(reftypmod, dict) and '@' in reftypmod)): super().__init__(reftypmod) else: self.reftypmod = reftypmod self.refupperindexpr = refupperindexpr self.reflowerindexpr = reflowerindexpr self.refexpr = refexpr self.refassgnexpr = refassgnexpr class TableFunc(Node): __slots__ = {'functype': 'TableFuncType', 'ns_uris': 'List*', 'ns_names': 'List*', 'docexpr': 'Node*', 'rowexpr': 'Node*', 'colnames': 'List*', 'coltypes': 'List*', 'coltypmods': 'List*', 'colcollations': 'List*', 'colexprs': 'List*', 'coldefexprs': 'List*', 'colvalexprs': 'List*', 'passingvalexprs': 'List*', 'notnulls': 'Bitmapset*', 'plan': 'Node*', 'ordinalitycol': 'int', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, functype=None, ns_uris=None, ns_names=None, docexpr=None, rowexpr=None, colnames=None, coltypes=None, coltypmods=None, colcollations=None, colexprs=None, coldefexprs=None, colvalexprs=None, passingvalexprs=None, notnulls=None, plan=None, ordinalitycol=None, location=None): # pragma: no cover # noqa: E501 if ((functype is not None and ns_uris is ns_names is docexpr is rowexpr is colnames is coltypes is coltypmods is colcollations is colexprs is coldefexprs is colvalexprs is passingvalexprs is notnulls is plan is ordinalitycol is location is None # noqa: E501 and isinstance(functype, dict) and '@' in functype)): super().__init__(functype) else: self.functype = functype self.ns_uris = ns_uris self.ns_names = ns_names self.docexpr = docexpr self.rowexpr = rowexpr self.colnames = colnames self.coltypes = coltypes self.coltypmods = coltypmods self.colcollations = colcollations self.colexprs = colexprs self.coldefexprs = coldefexprs self.colvalexprs = colvalexprs self.passingvalexprs = passingvalexprs self.notnulls = notnulls self.plan = plan self.ordinalitycol = ordinalitycol self.location = location class TableLikeClause(Node): __slots__ = {'relation': 'RangeVar*', 'options': 'bits32'} # noqa: E501 def __init__(self, relation=None, options=None): # pragma: no cover # noqa: E501 if ((relation is not None and options is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.options = options class TableSampleClause(Node): __slots__ = {'args': 'List*', 'repeatable': 'Expr*'} # noqa: E501 def __init__(self, args=None, repeatable=None): # pragma: no cover # noqa: E501 if ((args is not None and repeatable is None # noqa: E501 and isinstance(args, dict) and '@' in args)): super().__init__(args) else: self.args = args self.repeatable = repeatable class TargetEntry(Expr): __slots__ = {'expr': 'Expr*', 'resno': 'AttrNumber', 'resname': 'char*', 'ressortgroupref': 'Index', 'resorigcol': 'AttrNumber', 'resjunk': 'bool'} # noqa: E501 def __init__(self, expr=None, resno=None, resname=None, ressortgroupref=None, resorigcol=None, resjunk=None): # pragma: no cover # noqa: E501 if ((expr is not None and resno is resname is ressortgroupref is resorigcol is resjunk is None # noqa: E501 and isinstance(expr, dict) and '@' in expr)): super().__init__(expr) else: self.expr = expr self.resno = resno self.resname = resname self.ressortgroupref = ressortgroupref self.resorigcol = resorigcol self.resjunk = resjunk class TransactionStmt(Node): __slots__ = {'kind': 'TransactionStmtKind', 'options': 'List*', 'savepoint_name': 'char*', 'gid': 'char*', 'chain': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, kind=None, options=None, savepoint_name=None, gid=None, chain=None, location=None): # pragma: no cover # noqa: E501 if ((kind is not None and options is savepoint_name is gid is chain is location is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.options = options self.savepoint_name = savepoint_name self.gid = gid self.chain = chain self.location = location class TriggerTransition(Node): __slots__ = {'name': 'char*', 'isNew': 'bool', 'isTable': 'bool'} # noqa: E501 def __init__(self, name=None, isNew=None, isTable=None): # pragma: no cover # noqa: E501 if ((name is not None and isNew is isTable is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.isNew = isNew self.isTable = isTable class TruncateStmt(Node): __slots__ = {'relations': 'List*', 'restart_seqs': 'bool', 'behavior': 'DropBehavior'} # noqa: E501 def __init__(self, relations=None, restart_seqs=None, behavior=None): # pragma: no cover # noqa: E501 if ((relations is not None and restart_seqs is behavior is None # noqa: E501 and isinstance(relations, dict) and '@' in relations)): super().__init__(relations) else: self.relations = relations self.restart_seqs = restart_seqs self.behavior = behavior class TypeCast(Node): __slots__ = {'arg': 'Node*', 'typeName': 'TypeName*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, arg=None, typeName=None, location=None): # pragma: no cover # noqa: E501 if ((arg is not None and typeName is location is None # noqa: E501 and isinstance(arg, dict) and '@' in arg)): super().__init__(arg) else: self.arg = arg self.typeName = typeName self.location = location class TypeName(Node): __slots__ = {'names': 'List*', 'setof': 'bool', 'pct_type': 'bool', 'typmods': 'List*', 'typemod': 'int32', 'arrayBounds': 'List*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, names=None, setof=None, pct_type=None, typmods=None, typemod=None, arrayBounds=None, location=None): # pragma: no cover # noqa: E501 if ((names is not None and setof is pct_type is typmods is typemod is arrayBounds is location is None # noqa: E501 and isinstance(names, dict) and '@' in names)): super().__init__(names) else: self.names = names self.setof = setof self.pct_type = pct_type self.typmods = typmods self.typemod = typemod self.arrayBounds = arrayBounds self.location = location class UnlistenStmt(Node): __slots__ = {'conditionname': 'char*'} # noqa: E501 def __init__(self, conditionname=None): # pragma: no cover # noqa: E501 if ((conditionname is not None and isinstance(conditionname, dict) and '@' in conditionname)): super().__init__(conditionname) else: self.conditionname = conditionname class UpdateStmt(Node): __slots__ = {'relation': 'RangeVar*', 'targetList': 'List*', 'whereClause': 'Node*', 'fromClause': 'List*', 'returningList': 'List*', 'withClause': 'WithClause*'} # noqa: E501 def __init__(self, relation=None, targetList=None, whereClause=None, fromClause=None, returningList=None, withClause=None): # pragma: no cover # noqa: E501 if ((relation is not None and targetList is whereClause is fromClause is returningList is withClause is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.targetList = targetList self.whereClause = whereClause self.fromClause = fromClause self.returningList = returningList self.withClause = withClause class VacuumRelation(Node): __slots__ = {'relation': 'RangeVar*', 'va_cols': 'List*'} # noqa: E501 def __init__(self, relation=None, va_cols=None): # pragma: no cover # noqa: E501 if ((relation is not None and va_cols is None # noqa: E501 and isinstance(relation, dict) and '@' in relation)): super().__init__(relation) else: self.relation = relation self.va_cols = va_cols class VacuumStmt(Node): __slots__ = {'options': 'List*', 'rels': 'List*', 'is_vacuumcmd': 'bool'} # noqa: E501 def __init__(self, options=None, rels=None, is_vacuumcmd=None): # pragma: no cover # noqa: E501 if ((options is not None and rels is is_vacuumcmd is None # noqa: E501 and isinstance(options, dict) and '@' in options)): super().__init__(options) else: self.options = options self.rels = rels self.is_vacuumcmd = is_vacuumcmd class Var(Expr): __slots__ = {'varno': 'int', 'varattno': 'AttrNumber', 'vartypmod': 'int32', 'varnullingrels': 'Bitmapset*', 'varlevelsup': 'Index', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, varno=None, varattno=None, vartypmod=None, varnullingrels=None, varlevelsup=None, location=None): # pragma: no cover # noqa: E501 if ((varno is not None and varattno is vartypmod is varnullingrels is varlevelsup is location is None # noqa: E501 and isinstance(varno, dict) and '@' in varno)): super().__init__(varno) else: self.varno = varno self.varattno = varattno self.vartypmod = vartypmod self.varnullingrels = varnullingrels self.varlevelsup = varlevelsup self.location = location class VariableSetStmt(Node): __slots__ = {'kind': 'VariableSetKind', 'name': 'char*', 'args': 'List*', 'is_local': 'bool'} # noqa: E501 def __init__(self, kind=None, name=None, args=None, is_local=None): # pragma: no cover # noqa: E501 if ((kind is not None and name is args is is_local is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.name = name self.args = args self.is_local = is_local class VariableShowStmt(Node): __slots__ = {'name': 'char*'} # noqa: E501 def __init__(self, name=None): # pragma: no cover # noqa: E501 if ((name is not None and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name class ViewStmt(Node): __slots__ = {'view': 'RangeVar*', 'aliases': 'List*', 'query': 'Node*', 'replace': 'bool', 'options': 'List*', 'withCheckOption': 'ViewCheckOption'} # noqa: E501 def __init__(self, view=None, aliases=None, query=None, replace=None, options=None, withCheckOption=None): # pragma: no cover # noqa: E501 if ((view is not None and aliases is query is replace is options is withCheckOption is None # noqa: E501 and isinstance(view, dict) and '@' in view)): super().__init__(view) else: self.view = view self.aliases = aliases self.query = query self.replace = replace self.options = options self.withCheckOption = withCheckOption class WindowClause(Node): __slots__ = {'name': 'char*', 'refname': 'char*', 'partitionClause': 'List*', 'orderClause': 'List*', 'frameOptions': 'int', 'startOffset': 'Node*', 'endOffset': 'Node*', 'inRangeAsc': 'bool', 'inRangeNullsFirst': 'bool', 'winref': 'Index', 'copiedOrder': 'bool'} # noqa: E501 def __init__(self, name=None, refname=None, partitionClause=None, orderClause=None, frameOptions=None, startOffset=None, endOffset=None, inRangeAsc=None, inRangeNullsFirst=None, winref=None, copiedOrder=None): # pragma: no cover # noqa: E501 if ((name is not None and refname is partitionClause is orderClause is frameOptions is startOffset is endOffset is inRangeAsc is inRangeNullsFirst is winref is copiedOrder is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.refname = refname self.partitionClause = partitionClause self.orderClause = orderClause self.frameOptions = frameOptions self.startOffset = startOffset self.endOffset = endOffset self.inRangeAsc = inRangeAsc self.inRangeNullsFirst = inRangeNullsFirst self.winref = winref self.copiedOrder = copiedOrder class WindowDef(Node): __slots__ = {'name': 'char*', 'refname': 'char*', 'partitionClause': 'List*', 'orderClause': 'List*', 'frameOptions': 'int', 'startOffset': 'Node*', 'endOffset': 'Node*', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, name=None, refname=None, partitionClause=None, orderClause=None, frameOptions=None, startOffset=None, endOffset=None, location=None): # pragma: no cover # noqa: E501 if ((name is not None and refname is partitionClause is orderClause is frameOptions is startOffset is endOffset is location is None # noqa: E501 and isinstance(name, dict) and '@' in name)): super().__init__(name) else: self.name = name self.refname = refname self.partitionClause = partitionClause self.orderClause = orderClause self.frameOptions = frameOptions self.startOffset = startOffset self.endOffset = endOffset self.location = location class WindowFunc(Expr): __slots__ = {'args': 'List*', 'aggfilter': 'Expr*', 'runCondition': 'List*', 'winref': 'Index', 'winstar': 'bool', 'winagg': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, args=None, aggfilter=None, runCondition=None, winref=None, winstar=None, winagg=None, location=None): # pragma: no cover # noqa: E501 if ((args is not None and aggfilter is runCondition is winref is winstar is winagg is location is None # noqa: E501 and isinstance(args, dict) and '@' in args)): super().__init__(args) else: self.args = args self.aggfilter = aggfilter self.runCondition = runCondition self.winref = winref self.winstar = winstar self.winagg = winagg self.location = location class WindowFuncRunCondition(Expr): __slots__ = {'wfunc_left': 'bool', 'arg': 'Expr*'} # noqa: E501 def __init__(self, wfunc_left=None, arg=None): # pragma: no cover # noqa: E501 if ((wfunc_left is not None and arg is None # noqa: E501 and isinstance(wfunc_left, dict) and '@' in wfunc_left)): super().__init__(wfunc_left) else: self.wfunc_left = wfunc_left self.arg = arg class WithCheckOption(Node): __slots__ = {'kind': 'WCOKind', 'relname': 'char*', 'polname': 'char*', 'qual': 'Node*', 'cascaded': 'bool'} # noqa: E501 def __init__(self, kind=None, relname=None, polname=None, qual=None, cascaded=None): # pragma: no cover # noqa: E501 if ((kind is not None and relname is polname is qual is cascaded is None # noqa: E501 and isinstance(kind, dict) and '@' in kind)): super().__init__(kind) else: self.kind = kind self.relname = relname self.polname = polname self.qual = qual self.cascaded = cascaded class WithClause(Node): __slots__ = {'ctes': 'List*', 'recursive': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, ctes=None, recursive=None, location=None): # pragma: no cover # noqa: E501 if ((ctes is not None and recursive is location is None # noqa: E501 and isinstance(ctes, dict) and '@' in ctes)): super().__init__(ctes) else: self.ctes = ctes self.recursive = recursive self.location = location class XmlExpr(Expr): __slots__ = {'op': 'XmlExprOp', 'name': 'char*', 'named_args': 'List*', 'arg_names': 'List*', 'args': 'List*', 'xmloption': 'XmlOptionType', 'indent': 'bool', 'typmod': 'int32', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Expr._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, op=None, name=None, named_args=None, arg_names=None, args=None, xmloption=None, indent=None, typmod=None, location=None): # pragma: no cover # noqa: E501 if ((op is not None and name is named_args is arg_names is args is xmloption is indent is typmod is location is None # noqa: E501 and isinstance(op, dict) and '@' in op)): super().__init__(op) else: self.op = op self.name = name self.named_args = named_args self.arg_names = arg_names self.args = args self.xmloption = xmloption self.indent = indent self.typmod = typmod self.location = location class XmlSerialize(Node): __slots__ = {'xmloption': 'XmlOptionType', 'expr': 'Node*', 'typeName': 'TypeName*', 'indent': 'bool', 'location': 'ParseLoc'} # noqa: E501 _ATTRS_TO_IGNORE_IN_COMPARISON = Node._ATTRS_TO_IGNORE_IN_COMPARISON | {'location'} def __init__(self, xmloption=None, expr=None, typeName=None, indent=None, location=None): # pragma: no cover # noqa: E501 if ((xmloption is not None and expr is typeName is indent is location is None # noqa: E501 and isinstance(xmloption, dict) and '@' in xmloption)): super().__init__(xmloption) else: self.xmloption = xmloption self.expr = expr self.typeName = typeName self.indent = indent self.location = location def _fixup_attribute_types_in_slots(): G = globals() def traverse_sub_classes(cls): for subc in cls.__subclasses__(): yield subc yield from traverse_sub_classes(subc) for cls in traverse_sub_classes(Node): slots = cls.__slots__ if not (slots and isinstance(slots, dict) and isinstance(next(iter(slots.values())), str)): continue for attr in slots: adaptor = None ctype = slots[attr] if ctype == 'List*': ptype = (list, tuple) def adaptor(value): return tuple(G[i['@']](i) if isinstance(i, dict) and '@' in i else i for i in value) elif ctype == 'bool': ptype = (bool, int) adaptor = bool elif ctype == 'char': ptype = (str, int) def adaptor(value): if isinstance(value, int): value = chr(value) elif len(value) != 1: raise ValueError(f'Bad value for attribute {cls.__name__}.{attr},' f' expected a single char, got {value!r}') return value elif cls is Float and ctype == 'char*': ptype = (str, int, float, Decimal) adaptor = str elif ctype == 'char*': ptype = str elif ctype in {'Expr*', 'Node*'}: ptype = (dict, list, tuple, Node) def adaptor(value): if isinstance(value, dict): if '@' in value: value = G[value['@']](value) elif isinstance(value, (list, tuple)): value = tuple(G[i['@']](i) if isinstance(i, dict) and '@' in i else i for i in value) return value elif ctype in {'AclMode', 'AttrNumber', 'Index', 'ParseLoc', 'RelFileNumber', 'SubTransactionId', 'bits32', 'int', 'int16', 'int32', 'long', 'uint32', 'uint64'}: ptype = int elif ctype in {'Cardinality', 'Cost'}: ptype = float elif ctype == 'CreateStmt': ptype = (dict, CreateStmt) def adaptor(value): if isinstance(value, dict): if '@' in value: value = G[value['@']](value) return value elif ctype == 'Bitmapset*': ptype = (list, set, tuple) def adaptor(value): if isinstance(value, (list, tuple)): return set(value) else: return value elif ctype in ('JsonTablePlan', 'ValUnion'): ptype = Node else: from pglast import enums if hasattr(enums, ctype): ptype = (int, str, dict, getattr(enums, ctype)) else: if ctype.endswith('*'): ptype = G.get(ctype[:-1]) if ptype is None: aname = f'{cls.__name__}.{attr}' raise NotImplementedError(f'Unhandled C type of {aname}: {ctype}') else: ptype = (dict, ptype) else: aname = f'{cls.__name__}.{attr}' raise NotImplementedError(f'Unhandled C type of {aname}: {ctype}') slots[attr] = SlotTypeInfo(ctype, ptype, adaptor) _fixup_attribute_types_in_slots() del _fixup_attribute_types_in_slots pglast-7.7/pglast/ast.pyx000066400000000000000000005242421477366773500155460ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from struct_defs.json @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021-2025 Lele Gaifax # #cython: language_level=3 from cpython.ref cimport Py_INCREF from cpython.tuple cimport PyTuple_New, PyTuple_SET_ITEM from pglast import ast, enums from pglast cimport structs cdef _pg_bitmapset_to_set(const structs.Bitmapset* bms): cdef set result cdef int m if bms is not NULL: result = set() m = structs.bms_next_member(bms, -1) while m >= 0: result.add(m) m = structs.bms_next_member(bms, m) else: result = None return result cdef _pg_list_to_tuple(const structs.List* lst, offset_to_index): cdef tuple result cdef int i if lst is not NULL: result = PyTuple_New(lst.length) for i in range(lst.length): item = create(structs.list_nth(lst, i), offset_to_index) Py_INCREF(item) PyTuple_SET_ITEM(result, i, item) else: result = None return result cdef create_Query(structs.Query* data, offset_to_index): cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) cdef object v_canSetTag = bool(data.canSetTag) cdef object v_utilityStmt = create(data.utilityStmt, offset_to_index) if data.utilityStmt is not NULL else None cdef object v_resultRelation = data.resultRelation cdef object v_hasAggs = bool(data.hasAggs) cdef object v_hasWindowFuncs = bool(data.hasWindowFuncs) cdef object v_hasTargetSRFs = bool(data.hasTargetSRFs) cdef object v_hasSubLinks = bool(data.hasSubLinks) cdef object v_hasDistinctOn = bool(data.hasDistinctOn) cdef object v_hasRecursive = bool(data.hasRecursive) cdef object v_hasModifyingCTE = bool(data.hasModifyingCTE) cdef object v_hasForUpdate = bool(data.hasForUpdate) cdef object v_hasRowSecurity = bool(data.hasRowSecurity) cdef object v_isReturn = bool(data.isReturn) cdef tuple v_cteList = _pg_list_to_tuple(data.cteList, offset_to_index) cdef tuple v_rtable = _pg_list_to_tuple(data.rtable, offset_to_index) cdef tuple v_rteperminfos = _pg_list_to_tuple(data.rteperminfos, offset_to_index) cdef object v_jointree = create(data.jointree, offset_to_index) if data.jointree is not NULL else None cdef tuple v_mergeActionList = _pg_list_to_tuple(data.mergeActionList, offset_to_index) cdef object v_mergeTargetRelation = data.mergeTargetRelation cdef object v_mergeJoinCondition = create(data.mergeJoinCondition, offset_to_index) if data.mergeJoinCondition is not NULL else None cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) cdef object v_override = getattr(enums, 'OverridingKind')(data.override) cdef object v_onConflict = create(data.onConflict, offset_to_index) if data.onConflict is not NULL else None cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) cdef object v_groupDistinct = bool(data.groupDistinct) cdef tuple v_groupingSets = _pg_list_to_tuple(data.groupingSets, offset_to_index) cdef object v_havingQual = create(data.havingQual, offset_to_index) if data.havingQual is not NULL else None cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) cdef tuple v_rowMarks = _pg_list_to_tuple(data.rowMarks, offset_to_index) cdef object v_setOperations = create(data.setOperations, offset_to_index) if data.setOperations is not NULL else None cdef tuple v_constraintDeps = _pg_list_to_tuple(data.constraintDeps, offset_to_index) cdef tuple v_withCheckOptions = _pg_list_to_tuple(data.withCheckOptions, offset_to_index) cdef object v_stmt_location = offset_to_index(data.stmt_location) cdef object v_stmt_len = offset_to_index(data.stmt_len) return ast.Query(v_commandType, v_querySource, v_canSetTag, v_utilityStmt, v_resultRelation, v_hasAggs, v_hasWindowFuncs, v_hasTargetSRFs, v_hasSubLinks, v_hasDistinctOn, v_hasRecursive, v_hasModifyingCTE, v_hasForUpdate, v_hasRowSecurity, v_isReturn, v_cteList, v_rtable, v_rteperminfos, v_jointree, v_mergeActionList, v_mergeTargetRelation, v_mergeJoinCondition, v_targetList, v_override, v_onConflict, v_returningList, v_groupClause, v_groupDistinct, v_groupingSets, v_havingQual, v_windowClause, v_distinctClause, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_rowMarks, v_setOperations, v_constraintDeps, v_withCheckOptions, v_stmt_location, v_stmt_len) cdef create_TypeName(structs.TypeName* data, offset_to_index): cdef tuple v_names = _pg_list_to_tuple(data.names, offset_to_index) cdef object v_setof = bool(data.setof) cdef object v_pct_type = bool(data.pct_type) cdef tuple v_typmods = _pg_list_to_tuple(data.typmods, offset_to_index) cdef object v_typemod = data.typemod cdef tuple v_arrayBounds = _pg_list_to_tuple(data.arrayBounds, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.TypeName(v_names, v_setof, v_pct_type, v_typmods, v_typemod, v_arrayBounds, v_location) cdef create_ColumnRef(structs.ColumnRef* data, offset_to_index): cdef tuple v_fields = _pg_list_to_tuple(data.fields, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.ColumnRef(v_fields, v_location) cdef create_ParamRef(structs.ParamRef* data, offset_to_index): cdef object v_number = data.number cdef object v_location = offset_to_index(data.location) return ast.ParamRef(v_number, v_location) cdef create_A_Expr(structs.A_Expr* data, offset_to_index): cdef object v_kind = getattr(enums, 'A_Expr_Kind')(data.kind) cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) cdef object v_lexpr = create(data.lexpr, offset_to_index) if data.lexpr is not NULL else None cdef object v_rexpr = create(data.rexpr, offset_to_index) if data.rexpr is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.A_Expr(v_kind, v_name, v_lexpr, v_rexpr, v_location) cdef create_TypeCast(structs.TypeCast* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.TypeCast(v_arg, v_typeName, v_location) cdef create_CollateClause(structs.CollateClause* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.CollateClause(v_arg, v_collname, v_location) cdef create_RoleSpec(structs.RoleSpec* data, offset_to_index): cdef object v_roletype = getattr(enums, 'RoleSpecType')(data.roletype) cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.RoleSpec(v_roletype, v_rolename, v_location) cdef create_FuncCall(structs.FuncCall* data, offset_to_index): cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None cdef object v_agg_within_group = bool(data.agg_within_group) cdef object v_agg_star = bool(data.agg_star) cdef object v_agg_distinct = bool(data.agg_distinct) cdef object v_func_variadic = bool(data.func_variadic) cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) cdef object v_location = offset_to_index(data.location) return ast.FuncCall(v_funcname, v_args, v_agg_order, v_agg_filter, v_over, v_agg_within_group, v_agg_star, v_agg_distinct, v_func_variadic, v_funcformat, v_location) cdef create_A_Star(structs.A_Star* data, offset_to_index): return ast.A_Star() cdef create_A_Indices(structs.A_Indices* data, offset_to_index): cdef object v_is_slice = bool(data.is_slice) cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None cdef object v_uidx = create(data.uidx, offset_to_index) if data.uidx is not NULL else None return ast.A_Indices(v_is_slice, v_lidx, v_uidx) cdef create_A_Indirection(structs.A_Indirection* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) return ast.A_Indirection(v_arg, v_indirection) cdef create_A_ArrayExpr(structs.A_ArrayExpr* data, offset_to_index): cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.A_ArrayExpr(v_elements, v_location) cdef create_ResTarget(structs.ResTarget* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.ResTarget(v_name, v_indirection, v_val, v_location) cdef create_MultiAssignRef(structs.MultiAssignRef* data, offset_to_index): cdef object v_source = create(data.source, offset_to_index) if data.source is not NULL else None cdef object v_colno = data.colno cdef object v_ncolumns = data.ncolumns return ast.MultiAssignRef(v_source, v_colno, v_ncolumns) cdef create_SortBy(structs.SortBy* data, offset_to_index): cdef object v_node = create(data.node, offset_to_index) if data.node is not NULL else None cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) cdef object v_sortby_nulls = getattr(enums, 'SortByNulls')(data.sortby_nulls) cdef tuple v_useOp = _pg_list_to_tuple(data.useOp, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.SortBy(v_node, v_sortby_dir, v_sortby_nulls, v_useOp, v_location) cdef create_WindowDef(structs.WindowDef* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) cdef object v_frameOptions = data.frameOptions cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.WindowDef(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_location) cdef create_RangeSubselect(structs.RangeSubselect* data, offset_to_index): cdef object v_lateral = bool(data.lateral) cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None return ast.RangeSubselect(v_lateral, v_subquery, v_alias) cdef create_RangeFunction(structs.RangeFunction* data, offset_to_index): cdef object v_lateral = bool(data.lateral) cdef object v_ordinality = bool(data.ordinality) cdef object v_is_rowsfrom = bool(data.is_rowsfrom) cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) return ast.RangeFunction(v_lateral, v_ordinality, v_is_rowsfrom, v_functions, v_alias, v_coldeflist) cdef create_RangeTableFunc(structs.RangeTableFunc* data, offset_to_index): cdef object v_lateral = bool(data.lateral) cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None cdef tuple v_namespaces = _pg_list_to_tuple(data.namespaces, offset_to_index) cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.RangeTableFunc(v_lateral, v_docexpr, v_rowexpr, v_namespaces, v_columns, v_alias, v_location) cdef create_RangeTableFuncCol(structs.RangeTableFuncCol* data, offset_to_index): cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_for_ordinality = bool(data.for_ordinality) cdef object v_is_not_null = bool(data.is_not_null) cdef object v_colexpr = create(data.colexpr, offset_to_index) if data.colexpr is not NULL else None cdef object v_coldefexpr = create(data.coldefexpr, offset_to_index) if data.coldefexpr is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.RangeTableFuncCol(v_colname, v_typeName, v_for_ordinality, v_is_not_null, v_colexpr, v_coldefexpr, v_location) cdef create_RangeTableSample(structs.RangeTableSample* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.RangeTableSample(v_relation, v_method, v_args, v_repeatable, v_location) cdef create_ColumnDef(structs.ColumnDef* data, offset_to_index): cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_compression = data.compression.decode("utf-8") if data.compression is not NULL else None cdef object v_inhcount = data.inhcount cdef object v_is_local = bool(data.is_local) cdef object v_is_not_null = bool(data.is_not_null) cdef object v_is_from_type = bool(data.is_from_type) cdef object v_storage = chr(data.storage) cdef object v_storage_name = data.storage_name.decode("utf-8") if data.storage_name is not NULL else None cdef object v_raw_default = create(data.raw_default, offset_to_index) if data.raw_default is not NULL else None cdef object v_cooked_default = create(data.cooked_default, offset_to_index) if data.cooked_default is not NULL else None cdef object v_identity = chr(data.identity) cdef object v_identitySequence = create(data.identitySequence, offset_to_index) if data.identitySequence is not NULL else None cdef object v_generated = chr(data.generated) cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) cdef tuple v_fdwoptions = _pg_list_to_tuple(data.fdwoptions, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.ColumnDef(v_colname, v_typeName, v_compression, v_inhcount, v_is_local, v_is_not_null, v_is_from_type, v_storage, v_storage_name, v_raw_default, v_cooked_default, v_identity, v_identitySequence, v_generated, v_collClause, v_constraints, v_fdwoptions, v_location) cdef create_TableLikeClause(structs.TableLikeClause* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_options = data.options return ast.TableLikeClause(v_relation, v_options) cdef create_IndexElem(structs.IndexElem* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_indexcolname = data.indexcolname.decode("utf-8") if data.indexcolname is not NULL else None cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) cdef tuple v_opclassopts = _pg_list_to_tuple(data.opclassopts, offset_to_index) cdef object v_ordering = getattr(enums, 'SortByDir')(data.ordering) cdef object v_nulls_ordering = getattr(enums, 'SortByNulls')(data.nulls_ordering) return ast.IndexElem(v_name, v_expr, v_indexcolname, v_collation, v_opclass, v_opclassopts, v_ordering, v_nulls_ordering) cdef create_DefElem(structs.DefElem* data, offset_to_index): cdef object v_defnamespace = data.defnamespace.decode("utf-8") if data.defnamespace is not NULL else None cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_defaction = getattr(enums, 'DefElemAction')(data.defaction) cdef object v_location = offset_to_index(data.location) return ast.DefElem(v_defnamespace, v_defname, v_arg, v_defaction, v_location) cdef create_LockingClause(structs.LockingClause* data, offset_to_index): cdef tuple v_lockedRels = _pg_list_to_tuple(data.lockedRels, offset_to_index) cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) return ast.LockingClause(v_lockedRels, v_strength, v_waitPolicy) cdef create_XmlSerialize(structs.XmlSerialize* data, offset_to_index): cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_indent = bool(data.indent) cdef object v_location = offset_to_index(data.location) return ast.XmlSerialize(v_xmloption, v_expr, v_typeName, v_indent, v_location) cdef create_PartitionElem(structs.PartitionElem* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.PartitionElem(v_name, v_expr, v_collation, v_opclass, v_location) cdef create_PartitionSpec(structs.PartitionSpec* data, offset_to_index): cdef object v_strategy = getattr(enums, 'PartitionStrategy')(chr(data.strategy)) cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.PartitionSpec(v_strategy, v_partParams, v_location) cdef create_PartitionBoundSpec(structs.PartitionBoundSpec* data, offset_to_index): cdef object v_strategy = chr(data.strategy) cdef object v_is_default = bool(data.is_default) cdef object v_modulus = data.modulus cdef object v_remainder = data.remainder cdef tuple v_listdatums = _pg_list_to_tuple(data.listdatums, offset_to_index) cdef tuple v_lowerdatums = _pg_list_to_tuple(data.lowerdatums, offset_to_index) cdef tuple v_upperdatums = _pg_list_to_tuple(data.upperdatums, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.PartitionBoundSpec(v_strategy, v_is_default, v_modulus, v_remainder, v_listdatums, v_lowerdatums, v_upperdatums, v_location) cdef create_PartitionRangeDatum(structs.PartitionRangeDatum* data, offset_to_index): cdef object v_kind = getattr(enums, 'PartitionRangeDatumKind')(data.kind) cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.PartitionRangeDatum(v_kind, v_value, v_location) cdef create_SinglePartitionSpec(structs.SinglePartitionSpec* data, offset_to_index): return ast.SinglePartitionSpec() cdef create_PartitionCmd(structs.PartitionCmd* data, offset_to_index): cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None cdef object v_concurrent = bool(data.concurrent) return ast.PartitionCmd(v_name, v_bound, v_concurrent) cdef create_RangeTblEntry(structs.RangeTblEntry* data, offset_to_index): cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None cdef object v_rtekind = getattr(enums, 'RTEKind')(data.rtekind) cdef object v_inh = bool(data.inh) cdef object v_relkind = chr(data.relkind) cdef object v_rellockmode = data.rellockmode cdef object v_perminfoindex = data.perminfoindex cdef object v_tablesample = create(data.tablesample, offset_to_index) if data.tablesample is not NULL else None cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None cdef object v_security_barrier = bool(data.security_barrier) cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) cdef object v_joinmergedcols = data.joinmergedcols cdef tuple v_joinaliasvars = _pg_list_to_tuple(data.joinaliasvars, offset_to_index) cdef tuple v_joinleftcols = _pg_list_to_tuple(data.joinleftcols, offset_to_index) cdef tuple v_joinrightcols = _pg_list_to_tuple(data.joinrightcols, offset_to_index) cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) cdef object v_funcordinality = bool(data.funcordinality) cdef object v_tablefunc = create(data.tablefunc, offset_to_index) if data.tablefunc is not NULL else None cdef tuple v_values_lists = _pg_list_to_tuple(data.values_lists, offset_to_index) cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None cdef object v_ctelevelsup = data.ctelevelsup cdef object v_self_reference = bool(data.self_reference) cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) cdef object v_enrname = data.enrname.decode("utf-8") if data.enrname is not NULL else None cdef object v_enrtuples = data.enrtuples cdef object v_lateral = bool(data.lateral) cdef object v_inFromCl = bool(data.inFromCl) cdef tuple v_securityQuals = _pg_list_to_tuple(data.securityQuals, offset_to_index) return ast.RangeTblEntry(v_alias, v_eref, v_rtekind, v_inh, v_relkind, v_rellockmode, v_perminfoindex, v_tablesample, v_subquery, v_security_barrier, v_jointype, v_joinmergedcols, v_joinaliasvars, v_joinleftcols, v_joinrightcols, v_join_using_alias, v_functions, v_funcordinality, v_tablefunc, v_values_lists, v_ctename, v_ctelevelsup, v_self_reference, v_coltypes, v_coltypmods, v_colcollations, v_enrname, v_enrtuples, v_lateral, v_inFromCl, v_securityQuals) cdef create_RTEPermissionInfo(structs.RTEPermissionInfo* data, offset_to_index): cdef object v_inh = bool(data.inh) cdef object v_requiredPerms = data.requiredPerms cdef set v_selectedCols = _pg_bitmapset_to_set(data.selectedCols) cdef set v_insertedCols = _pg_bitmapset_to_set(data.insertedCols) cdef set v_updatedCols = _pg_bitmapset_to_set(data.updatedCols) return ast.RTEPermissionInfo(v_inh, v_requiredPerms, v_selectedCols, v_insertedCols, v_updatedCols) cdef create_RangeTblFunction(structs.RangeTblFunction* data, offset_to_index): cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None cdef object v_funccolcount = data.funccolcount cdef tuple v_funccolnames = _pg_list_to_tuple(data.funccolnames, offset_to_index) cdef tuple v_funccoltypes = _pg_list_to_tuple(data.funccoltypes, offset_to_index) cdef tuple v_funccoltypmods = _pg_list_to_tuple(data.funccoltypmods, offset_to_index) cdef tuple v_funccolcollations = _pg_list_to_tuple(data.funccolcollations, offset_to_index) cdef set v_funcparams = _pg_bitmapset_to_set(data.funcparams) return ast.RangeTblFunction(v_funcexpr, v_funccolcount, v_funccolnames, v_funccoltypes, v_funccoltypmods, v_funccolcollations, v_funcparams) cdef create_TableSampleClause(structs.TableSampleClause* data, offset_to_index): cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None return ast.TableSampleClause(v_args, v_repeatable) cdef create_WithCheckOption(structs.WithCheckOption* data, offset_to_index): cdef object v_kind = getattr(enums, 'WCOKind')(data.kind) cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None cdef object v_polname = data.polname.decode("utf-8") if data.polname is not NULL else None cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None cdef object v_cascaded = bool(data.cascaded) return ast.WithCheckOption(v_kind, v_relname, v_polname, v_qual, v_cascaded) cdef create_SortGroupClause(structs.SortGroupClause* data, offset_to_index): cdef object v_tleSortGroupRef = data.tleSortGroupRef cdef object v_nulls_first = bool(data.nulls_first) cdef object v_hashable = bool(data.hashable) return ast.SortGroupClause(v_tleSortGroupRef, v_nulls_first, v_hashable) cdef create_GroupingSet(structs.GroupingSet* data, offset_to_index): cdef object v_kind = getattr(enums, 'GroupingSetKind')(data.kind) cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.GroupingSet(v_kind, v_content, v_location) cdef create_WindowClause(structs.WindowClause* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) cdef object v_frameOptions = data.frameOptions cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None cdef object v_inRangeAsc = bool(data.inRangeAsc) cdef object v_inRangeNullsFirst = bool(data.inRangeNullsFirst) cdef object v_winref = data.winref cdef object v_copiedOrder = bool(data.copiedOrder) return ast.WindowClause(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_inRangeAsc, v_inRangeNullsFirst, v_winref, v_copiedOrder) cdef create_RowMarkClause(structs.RowMarkClause* data, offset_to_index): cdef object v_rti = data.rti cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) cdef object v_pushedDown = bool(data.pushedDown) return ast.RowMarkClause(v_rti, v_strength, v_waitPolicy, v_pushedDown) cdef create_WithClause(structs.WithClause* data, offset_to_index): cdef tuple v_ctes = _pg_list_to_tuple(data.ctes, offset_to_index) cdef object v_recursive = bool(data.recursive) cdef object v_location = offset_to_index(data.location) return ast.WithClause(v_ctes, v_recursive, v_location) cdef create_InferClause(structs.InferClause* data, offset_to_index): cdef tuple v_indexElems = _pg_list_to_tuple(data.indexElems, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.InferClause(v_indexElems, v_whereClause, v_conname, v_location) cdef create_OnConflictClause(structs.OnConflictClause* data, offset_to_index): cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.OnConflictClause(v_action, v_infer, v_targetList, v_whereClause, v_location) cdef create_CTESearchClause(structs.CTESearchClause* data, offset_to_index): cdef tuple v_search_col_list = _pg_list_to_tuple(data.search_col_list, offset_to_index) cdef object v_search_breadth_first = bool(data.search_breadth_first) cdef object v_search_seq_column = data.search_seq_column.decode("utf-8") if data.search_seq_column is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.CTESearchClause(v_search_col_list, v_search_breadth_first, v_search_seq_column, v_location) cdef create_CTECycleClause(structs.CTECycleClause* data, offset_to_index): cdef tuple v_cycle_col_list = _pg_list_to_tuple(data.cycle_col_list, offset_to_index) cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None cdef object v_cycle_mark_value = create(data.cycle_mark_value, offset_to_index) if data.cycle_mark_value is not NULL else None cdef object v_cycle_mark_default = create(data.cycle_mark_default, offset_to_index) if data.cycle_mark_default is not NULL else None cdef object v_cycle_path_column = data.cycle_path_column.decode("utf-8") if data.cycle_path_column is not NULL else None cdef object v_location = offset_to_index(data.location) cdef object v_cycle_mark_typmod = data.cycle_mark_typmod return ast.CTECycleClause(v_cycle_col_list, v_cycle_mark_column, v_cycle_mark_value, v_cycle_mark_default, v_cycle_path_column, v_location, v_cycle_mark_typmod) cdef create_CommonTableExpr(structs.CommonTableExpr* data, offset_to_index): cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) cdef object v_ctematerialized = getattr(enums, 'CTEMaterialize')(data.ctematerialized) cdef object v_ctequery = create(data.ctequery, offset_to_index) if data.ctequery is not NULL else None cdef object v_search_clause = create(data.search_clause, offset_to_index) if data.search_clause is not NULL else None cdef object v_cycle_clause = create(data.cycle_clause, offset_to_index) if data.cycle_clause is not NULL else None cdef object v_location = offset_to_index(data.location) cdef object v_cterecursive = bool(data.cterecursive) cdef object v_cterefcount = data.cterefcount cdef tuple v_ctecolnames = _pg_list_to_tuple(data.ctecolnames, offset_to_index) cdef tuple v_ctecoltypes = _pg_list_to_tuple(data.ctecoltypes, offset_to_index) cdef tuple v_ctecoltypmods = _pg_list_to_tuple(data.ctecoltypmods, offset_to_index) cdef tuple v_ctecolcollations = _pg_list_to_tuple(data.ctecolcollations, offset_to_index) return ast.CommonTableExpr(v_ctename, v_aliascolnames, v_ctematerialized, v_ctequery, v_search_clause, v_cycle_clause, v_location, v_cterecursive, v_cterefcount, v_ctecolnames, v_ctecoltypes, v_ctecoltypmods, v_ctecolcollations) cdef create_MergeWhenClause(structs.MergeWhenClause* data, offset_to_index): cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) cdef object v_override = getattr(enums, 'OverridingKind')(data.override) cdef object v_condition = create(data.condition, offset_to_index) if data.condition is not NULL else None cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) cdef tuple v_values = _pg_list_to_tuple(data.values, offset_to_index) return ast.MergeWhenClause(v_matchKind, v_commandType, v_override, v_condition, v_targetList, v_values) cdef create_TriggerTransition(structs.TriggerTransition* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_isNew = bool(data.isNew) cdef object v_isTable = bool(data.isTable) return ast.TriggerTransition(v_name, v_isNew, v_isTable) cdef create_JsonOutput(structs.JsonOutput* data, offset_to_index): cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None return ast.JsonOutput(v_typeName, v_returning) cdef create_JsonArgument(structs.JsonArgument* data, offset_to_index): cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None return ast.JsonArgument(v_val, v_name) cdef create_JsonFuncExpr(structs.JsonFuncExpr* data, offset_to_index): cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) cdef object v_location = offset_to_index(data.location) return ast.JsonFuncExpr(v_op, v_column_name, v_context_item, v_pathspec, v_passing, v_output, v_on_empty, v_on_error, v_wrapper, v_quotes, v_location) cdef create_JsonTablePathSpec(structs.JsonTablePathSpec* data, offset_to_index): cdef object v_string = create(data.string, offset_to_index) if data.string is not NULL else None cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_name_location = offset_to_index(data.name_location) cdef object v_location = offset_to_index(data.location) return ast.JsonTablePathSpec(v_string, v_name, v_name_location, v_location) cdef create_JsonTable(structs.JsonTable* data, offset_to_index): cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None cdef object v_lateral = bool(data.lateral) cdef object v_location = offset_to_index(data.location) return ast.JsonTable(v_context_item, v_pathspec, v_passing, v_columns, v_on_error, v_alias, v_lateral, v_location) cdef create_JsonTableColumn(structs.JsonTableColumn* data, offset_to_index): cdef object v_coltype = getattr(enums, 'JsonTableColumnType')(data.coltype) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.JsonTableColumn(v_coltype, v_name, v_typeName, v_pathspec, v_format, v_wrapper, v_quotes, v_columns, v_on_empty, v_on_error, v_location) cdef create_JsonKeyValue(structs.JsonKeyValue* data, offset_to_index): cdef object v_key = create(data.key, offset_to_index) if data.key is not NULL else None cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None return ast.JsonKeyValue(v_key, v_value) cdef create_JsonParseExpr(structs.JsonParseExpr* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_unique_keys = bool(data.unique_keys) cdef object v_location = offset_to_index(data.location) return ast.JsonParseExpr(v_expr, v_output, v_unique_keys, v_location) cdef create_JsonScalarExpr(structs.JsonScalarExpr* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.JsonScalarExpr(v_expr, v_output, v_location) cdef create_JsonSerializeExpr(structs.JsonSerializeExpr* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.JsonSerializeExpr(v_expr, v_output, v_location) cdef create_JsonObjectConstructor(structs.JsonObjectConstructor* data, offset_to_index): cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_absent_on_null = bool(data.absent_on_null) cdef object v_unique = bool(data.unique) cdef object v_location = offset_to_index(data.location) return ast.JsonObjectConstructor(v_exprs, v_output, v_absent_on_null, v_unique, v_location) cdef create_JsonArrayConstructor(structs.JsonArrayConstructor* data, offset_to_index): cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_absent_on_null = bool(data.absent_on_null) cdef object v_location = offset_to_index(data.location) return ast.JsonArrayConstructor(v_exprs, v_output, v_absent_on_null, v_location) cdef create_JsonArrayQueryConstructor(structs.JsonArrayQueryConstructor* data, offset_to_index): cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None cdef object v_absent_on_null = bool(data.absent_on_null) cdef object v_location = offset_to_index(data.location) return ast.JsonArrayQueryConstructor(v_query, v_output, v_format, v_absent_on_null, v_location) cdef create_JsonAggConstructor(structs.JsonAggConstructor* data, offset_to_index): cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.JsonAggConstructor(v_output, v_agg_filter, v_agg_order, v_over, v_location) cdef create_JsonObjectAgg(structs.JsonObjectAgg* data, offset_to_index): cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_absent_on_null = bool(data.absent_on_null) cdef object v_unique = bool(data.unique) return ast.JsonObjectAgg(v_constructor, v_arg, v_absent_on_null, v_unique) cdef create_JsonArrayAgg(structs.JsonArrayAgg* data, offset_to_index): cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_absent_on_null = bool(data.absent_on_null) return ast.JsonArrayAgg(v_constructor, v_arg, v_absent_on_null) cdef create_RawStmt(structs.RawStmt* data, offset_to_index): cdef object v_stmt = create(data.stmt, offset_to_index) if data.stmt is not NULL else None cdef object v_stmt_location = offset_to_index(data.stmt_location) cdef object v_stmt_len = offset_to_index(data.stmt_len) return ast.RawStmt(v_stmt, v_stmt_location, v_stmt_len) cdef create_InsertStmt(structs.InsertStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) cdef object v_selectStmt = create(data.selectStmt, offset_to_index) if data.selectStmt is not NULL else None cdef object v_onConflictClause = create(data.onConflictClause, offset_to_index) if data.onConflictClause is not NULL else None cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None cdef object v_override = getattr(enums, 'OverridingKind')(data.override) return ast.InsertStmt(v_relation, v_cols, v_selectStmt, v_onConflictClause, v_returningList, v_withClause, v_override) cdef create_DeleteStmt(structs.DeleteStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None return ast.DeleteStmt(v_relation, v_usingClause, v_whereClause, v_returningList, v_withClause) cdef create_UpdateStmt(structs.UpdateStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None return ast.UpdateStmt(v_relation, v_targetList, v_whereClause, v_fromClause, v_returningList, v_withClause) cdef create_MergeStmt(structs.MergeStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None cdef object v_joinCondition = create(data.joinCondition, offset_to_index) if data.joinCondition is not NULL else None cdef tuple v_mergeWhenClauses = _pg_list_to_tuple(data.mergeWhenClauses, offset_to_index) cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None return ast.MergeStmt(v_relation, v_sourceRelation, v_joinCondition, v_mergeWhenClauses, v_returningList, v_withClause) cdef create_SelectStmt(structs.SelectStmt* data, offset_to_index): cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) cdef object v_groupDistinct = bool(data.groupDistinct) cdef object v_havingClause = create(data.havingClause, offset_to_index) if data.havingClause is not NULL else None cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) cdef tuple v_valuesLists = _pg_list_to_tuple(data.valuesLists, offset_to_index) cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) cdef tuple v_lockingClause = _pg_list_to_tuple(data.lockingClause, offset_to_index) cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None cdef object v_op = getattr(enums, 'SetOperation')(data.op) cdef object v_all = bool(data.all) cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None return ast.SelectStmt(v_distinctClause, v_intoClause, v_targetList, v_fromClause, v_whereClause, v_groupClause, v_groupDistinct, v_havingClause, v_windowClause, v_valuesLists, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_lockingClause, v_withClause, v_op, v_all, v_larg, v_rarg) cdef create_SetOperationStmt(structs.SetOperationStmt* data, offset_to_index): cdef object v_op = getattr(enums, 'SetOperation')(data.op) cdef object v_all = bool(data.all) cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None cdef tuple v_colTypes = _pg_list_to_tuple(data.colTypes, offset_to_index) cdef tuple v_colTypmods = _pg_list_to_tuple(data.colTypmods, offset_to_index) cdef tuple v_colCollations = _pg_list_to_tuple(data.colCollations, offset_to_index) cdef tuple v_groupClauses = _pg_list_to_tuple(data.groupClauses, offset_to_index) return ast.SetOperationStmt(v_op, v_all, v_larg, v_rarg, v_colTypes, v_colTypmods, v_colCollations, v_groupClauses) cdef create_ReturnStmt(structs.ReturnStmt* data, offset_to_index): cdef object v_returnval = create(data.returnval, offset_to_index) if data.returnval is not NULL else None return ast.ReturnStmt(v_returnval) cdef create_PLAssignStmt(structs.PLAssignStmt* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) cdef object v_nnames = data.nnames cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.PLAssignStmt(v_name, v_indirection, v_nnames, v_val, v_location) cdef create_CreateSchemaStmt(structs.CreateSchemaStmt* data, offset_to_index): cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None cdef tuple v_schemaElts = _pg_list_to_tuple(data.schemaElts, offset_to_index) cdef object v_if_not_exists = bool(data.if_not_exists) return ast.CreateSchemaStmt(v_schemaname, v_authrole, v_schemaElts, v_if_not_exists) cdef create_AlterTableStmt(structs.AlterTableStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef object v_missing_ok = bool(data.missing_ok) return ast.AlterTableStmt(v_relation, v_cmds, v_objtype, v_missing_ok) cdef create_ReplicaIdentityStmt(structs.ReplicaIdentityStmt* data, offset_to_index): cdef object v_identity_type = chr(data.identity_type) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None return ast.ReplicaIdentityStmt(v_identity_type, v_name) cdef create_AlterTableCmd(structs.AlterTableCmd* data, offset_to_index): cdef object v_subtype = getattr(enums, 'AlterTableType')(data.subtype) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_num = data.num cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) cdef object v_missing_ok = bool(data.missing_ok) cdef object v_recurse = bool(data.recurse) return ast.AlterTableCmd(v_subtype, v_name, v_num, v_newowner, v_def_, v_behavior, v_missing_ok, v_recurse) cdef create_AlterCollationStmt(structs.AlterCollationStmt* data, offset_to_index): cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) return ast.AlterCollationStmt(v_collname) cdef create_AlterDomainStmt(structs.AlterDomainStmt* data, offset_to_index): cdef object v_subtype = chr(data.subtype) cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) cdef object v_missing_ok = bool(data.missing_ok) return ast.AlterDomainStmt(v_subtype, v_typeName, v_name, v_def_, v_behavior, v_missing_ok) cdef create_GrantStmt(structs.GrantStmt* data, offset_to_index): cdef object v_is_grant = bool(data.is_grant) cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) cdef tuple v_privileges = _pg_list_to_tuple(data.privileges, offset_to_index) cdef tuple v_grantees = _pg_list_to_tuple(data.grantees, offset_to_index) cdef object v_grant_option = bool(data.grant_option) cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) return ast.GrantStmt(v_is_grant, v_targtype, v_objtype, v_objects, v_privileges, v_grantees, v_grant_option, v_grantor, v_behavior) cdef create_ObjectWithArgs(structs.ObjectWithArgs* data, offset_to_index): cdef tuple v_objname = _pg_list_to_tuple(data.objname, offset_to_index) cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) cdef tuple v_objfuncargs = _pg_list_to_tuple(data.objfuncargs, offset_to_index) cdef object v_args_unspecified = bool(data.args_unspecified) return ast.ObjectWithArgs(v_objname, v_objargs, v_objfuncargs, v_args_unspecified) cdef create_AccessPriv(structs.AccessPriv* data, offset_to_index): cdef object v_priv_name = data.priv_name.decode("utf-8") if data.priv_name is not NULL else None cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) return ast.AccessPriv(v_priv_name, v_cols) cdef create_GrantRoleStmt(structs.GrantRoleStmt* data, offset_to_index): cdef tuple v_granted_roles = _pg_list_to_tuple(data.granted_roles, offset_to_index) cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) cdef object v_is_grant = bool(data.is_grant) cdef tuple v_opt = _pg_list_to_tuple(data.opt, offset_to_index) cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) return ast.GrantRoleStmt(v_granted_roles, v_grantee_roles, v_is_grant, v_opt, v_grantor, v_behavior) cdef create_AlterDefaultPrivilegesStmt(structs.AlterDefaultPrivilegesStmt* data, offset_to_index): cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_action = create(data.action, offset_to_index) if data.action is not NULL else None return ast.AlterDefaultPrivilegesStmt(v_options, v_action) cdef create_CopyStmt(structs.CopyStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None cdef tuple v_attlist = _pg_list_to_tuple(data.attlist, offset_to_index) cdef object v_is_from = bool(data.is_from) cdef object v_is_program = bool(data.is_program) cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None return ast.CopyStmt(v_relation, v_query, v_attlist, v_is_from, v_is_program, v_filename, v_options, v_whereClause) cdef create_VariableSetStmt(structs.VariableSetStmt* data, offset_to_index): cdef object v_kind = getattr(enums, 'VariableSetKind')(data.kind) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_is_local = bool(data.is_local) return ast.VariableSetStmt(v_kind, v_name, v_args, v_is_local) cdef create_VariableShowStmt(structs.VariableShowStmt* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None return ast.VariableShowStmt(v_name) cdef create_CreateStmt(structs.CreateStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) cdef tuple v_inhRelations = _pg_list_to_tuple(data.inhRelations, offset_to_index) cdef object v_partbound = create(data.partbound, offset_to_index) if data.partbound is not NULL else None cdef object v_partspec = create(data.partspec, offset_to_index) if data.partspec is not NULL else None cdef object v_ofTypename = create(data.ofTypename, offset_to_index) if data.ofTypename is not NULL else None cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_oncommit = getattr(enums, 'OnCommitAction')(data.oncommit) cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None cdef object v_if_not_exists = bool(data.if_not_exists) return ast.CreateStmt(v_relation, v_tableElts, v_inhRelations, v_partbound, v_partspec, v_ofTypename, v_constraints, v_options, v_oncommit, v_tablespacename, v_accessMethod, v_if_not_exists) cdef create_Constraint(structs.Constraint* data, offset_to_index): cdef object v_contype = getattr(enums, 'ConstrType')(data.contype) cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None cdef object v_deferrable = bool(data.deferrable) cdef object v_initdeferred = bool(data.initdeferred) cdef object v_skip_validation = bool(data.skip_validation) cdef object v_initially_valid = bool(data.initially_valid) cdef object v_is_no_inherit = bool(data.is_no_inherit) cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None cdef object v_cooked_expr = data.cooked_expr.decode("utf-8") if data.cooked_expr is not NULL else None cdef object v_generated_when = chr(data.generated_when) cdef object v_inhcount = data.inhcount cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) cdef tuple v_keys = _pg_list_to_tuple(data.keys, offset_to_index) cdef tuple v_including = _pg_list_to_tuple(data.including, offset_to_index) cdef tuple v_exclusions = _pg_list_to_tuple(data.exclusions, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None cdef object v_indexspace = data.indexspace.decode("utf-8") if data.indexspace is not NULL else None cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) cdef object v_access_method = data.access_method.decode("utf-8") if data.access_method is not NULL else None cdef object v_where_clause = create(data.where_clause, offset_to_index) if data.where_clause is not NULL else None cdef object v_pktable = create(data.pktable, offset_to_index) if data.pktable is not NULL else None cdef tuple v_fk_attrs = _pg_list_to_tuple(data.fk_attrs, offset_to_index) cdef tuple v_pk_attrs = _pg_list_to_tuple(data.pk_attrs, offset_to_index) cdef object v_fk_matchtype = chr(data.fk_matchtype) cdef object v_fk_upd_action = chr(data.fk_upd_action) cdef object v_fk_del_action = chr(data.fk_del_action) cdef tuple v_fk_del_set_cols = _pg_list_to_tuple(data.fk_del_set_cols, offset_to_index) cdef tuple v_old_conpfeqop = _pg_list_to_tuple(data.old_conpfeqop, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.Constraint(v_contype, v_conname, v_deferrable, v_initdeferred, v_skip_validation, v_initially_valid, v_is_no_inherit, v_raw_expr, v_cooked_expr, v_generated_when, v_inhcount, v_nulls_not_distinct, v_keys, v_including, v_exclusions, v_options, v_indexname, v_indexspace, v_reset_default_tblspc, v_access_method, v_where_clause, v_pktable, v_fk_attrs, v_pk_attrs, v_fk_matchtype, v_fk_upd_action, v_fk_del_action, v_fk_del_set_cols, v_old_conpfeqop, v_location) cdef create_CreateTableSpaceStmt(structs.CreateTableSpaceStmt* data, offset_to_index): cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None cdef object v_location = data.location.decode("utf-8") if data.location is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateTableSpaceStmt(v_tablespacename, v_owner, v_location, v_options) cdef create_DropTableSpaceStmt(structs.DropTableSpaceStmt* data, offset_to_index): cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None cdef object v_missing_ok = bool(data.missing_ok) return ast.DropTableSpaceStmt(v_tablespacename, v_missing_ok) cdef create_AlterTableSpaceOptionsStmt(structs.AlterTableSpaceOptionsStmt* data, offset_to_index): cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_isReset = bool(data.isReset) return ast.AlterTableSpaceOptionsStmt(v_tablespacename, v_options, v_isReset) cdef create_AlterTableMoveAllStmt(structs.AlterTableMoveAllStmt* data, offset_to_index): cdef object v_orig_tablespacename = data.orig_tablespacename.decode("utf-8") if data.orig_tablespacename is not NULL else None cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) cdef object v_new_tablespacename = data.new_tablespacename.decode("utf-8") if data.new_tablespacename is not NULL else None cdef object v_nowait = bool(data.nowait) return ast.AlterTableMoveAllStmt(v_orig_tablespacename, v_objtype, v_roles, v_new_tablespacename, v_nowait) cdef create_CreateExtensionStmt(structs.CreateExtensionStmt* data, offset_to_index): cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None cdef object v_if_not_exists = bool(data.if_not_exists) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateExtensionStmt(v_extname, v_if_not_exists, v_options) cdef create_AlterExtensionStmt(structs.AlterExtensionStmt* data, offset_to_index): cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterExtensionStmt(v_extname, v_options) cdef create_AlterExtensionContentsStmt(structs.AlterExtensionContentsStmt* data, offset_to_index): cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None cdef object v_action = data.action cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None return ast.AlterExtensionContentsStmt(v_extname, v_action, v_objtype, v_object) cdef create_CreateFdwStmt(structs.CreateFdwStmt* data, offset_to_index): cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateFdwStmt(v_fdwname, v_func_options, v_options) cdef create_AlterFdwStmt(structs.AlterFdwStmt* data, offset_to_index): cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterFdwStmt(v_fdwname, v_func_options, v_options) cdef create_CreateForeignServerStmt(structs.CreateForeignServerStmt* data, offset_to_index): cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None cdef object v_if_not_exists = bool(data.if_not_exists) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateForeignServerStmt(v_servername, v_servertype, v_version, v_fdwname, v_if_not_exists, v_options) cdef create_AlterForeignServerStmt(structs.AlterForeignServerStmt* data, offset_to_index): cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_has_version = bool(data.has_version) return ast.AlterForeignServerStmt(v_servername, v_version, v_options, v_has_version) cdef create_CreateForeignTableStmt(structs.CreateForeignTableStmt* data, offset_to_index): cdef object v_base = create_CreateStmt( data, offset_to_index) cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateForeignTableStmt(v_base, v_servername, v_options) cdef create_CreateUserMappingStmt(structs.CreateUserMappingStmt* data, offset_to_index): cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None cdef object v_if_not_exists = bool(data.if_not_exists) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateUserMappingStmt(v_user, v_servername, v_if_not_exists, v_options) cdef create_AlterUserMappingStmt(structs.AlterUserMappingStmt* data, offset_to_index): cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterUserMappingStmt(v_user, v_servername, v_options) cdef create_DropUserMappingStmt(structs.DropUserMappingStmt* data, offset_to_index): cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None cdef object v_missing_ok = bool(data.missing_ok) return ast.DropUserMappingStmt(v_user, v_servername, v_missing_ok) cdef create_ImportForeignSchemaStmt(structs.ImportForeignSchemaStmt* data, offset_to_index): cdef object v_server_name = data.server_name.decode("utf-8") if data.server_name is not NULL else None cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None cdef object v_local_schema = data.local_schema.decode("utf-8") if data.local_schema is not NULL else None cdef object v_list_type = getattr(enums, 'ImportForeignSchemaType')(data.list_type) cdef tuple v_table_list = _pg_list_to_tuple(data.table_list, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.ImportForeignSchemaStmt(v_server_name, v_remote_schema, v_local_schema, v_list_type, v_table_list, v_options) cdef create_CreatePolicyStmt(structs.CreatePolicyStmt* data, offset_to_index): cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None cdef object v_cmd_name = data.cmd_name.decode("utf-8") if data.cmd_name is not NULL else None cdef object v_permissive = bool(data.permissive) cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None return ast.CreatePolicyStmt(v_policy_name, v_table, v_cmd_name, v_permissive, v_roles, v_qual, v_with_check) cdef create_AlterPolicyStmt(structs.AlterPolicyStmt* data, offset_to_index): cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None return ast.AlterPolicyStmt(v_policy_name, v_table, v_roles, v_qual, v_with_check) cdef create_CreateAmStmt(structs.CreateAmStmt* data, offset_to_index): cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) cdef object v_amtype = chr(data.amtype) return ast.CreateAmStmt(v_amname, v_handler_name, v_amtype) cdef create_CreateTrigStmt(structs.CreateTrigStmt* data, offset_to_index): cdef object v_replace = bool(data.replace) cdef object v_isconstraint = bool(data.isconstraint) cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_row = bool(data.row) cdef object v_timing = data.timing cdef object v_events = data.events cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) cdef object v_whenClause = create(data.whenClause, offset_to_index) if data.whenClause is not NULL else None cdef tuple v_transitionRels = _pg_list_to_tuple(data.transitionRels, offset_to_index) cdef object v_deferrable = bool(data.deferrable) cdef object v_initdeferred = bool(data.initdeferred) cdef object v_constrrel = create(data.constrrel, offset_to_index) if data.constrrel is not NULL else None return ast.CreateTrigStmt(v_replace, v_isconstraint, v_trigname, v_relation, v_funcname, v_args, v_row, v_timing, v_events, v_columns, v_whenClause, v_transitionRels, v_deferrable, v_initdeferred, v_constrrel) cdef create_CreateEventTrigStmt(structs.CreateEventTrigStmt* data, offset_to_index): cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None cdef tuple v_whenclause = _pg_list_to_tuple(data.whenclause, offset_to_index) cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) return ast.CreateEventTrigStmt(v_trigname, v_eventname, v_whenclause, v_funcname) cdef create_AlterEventTrigStmt(structs.AlterEventTrigStmt* data, offset_to_index): cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None cdef object v_tgenabled = chr(data.tgenabled) return ast.AlterEventTrigStmt(v_trigname, v_tgenabled) cdef create_CreatePLangStmt(structs.CreatePLangStmt* data, offset_to_index): cdef object v_replace = bool(data.replace) cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None cdef tuple v_plhandler = _pg_list_to_tuple(data.plhandler, offset_to_index) cdef tuple v_plinline = _pg_list_to_tuple(data.plinline, offset_to_index) cdef tuple v_plvalidator = _pg_list_to_tuple(data.plvalidator, offset_to_index) cdef object v_pltrusted = bool(data.pltrusted) return ast.CreatePLangStmt(v_replace, v_plname, v_plhandler, v_plinline, v_plvalidator, v_pltrusted) cdef create_CreateRoleStmt(structs.CreateRoleStmt* data, offset_to_index): cdef object v_stmt_type = getattr(enums, 'RoleStmtType')(data.stmt_type) cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateRoleStmt(v_stmt_type, v_role, v_options) cdef create_AlterRoleStmt(structs.AlterRoleStmt* data, offset_to_index): cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_action = data.action return ast.AlterRoleStmt(v_role, v_options, v_action) cdef create_AlterRoleSetStmt(structs.AlterRoleSetStmt* data, offset_to_index): cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None return ast.AlterRoleSetStmt(v_role, v_database, v_setstmt) cdef create_DropRoleStmt(structs.DropRoleStmt* data, offset_to_index): cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) cdef object v_missing_ok = bool(data.missing_ok) return ast.DropRoleStmt(v_roles, v_missing_ok) cdef create_CreateSeqStmt(structs.CreateSeqStmt* data, offset_to_index): cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_for_identity = bool(data.for_identity) cdef object v_if_not_exists = bool(data.if_not_exists) return ast.CreateSeqStmt(v_sequence, v_options, v_for_identity, v_if_not_exists) cdef create_AlterSeqStmt(structs.AlterSeqStmt* data, offset_to_index): cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_for_identity = bool(data.for_identity) cdef object v_missing_ok = bool(data.missing_ok) return ast.AlterSeqStmt(v_sequence, v_options, v_for_identity, v_missing_ok) cdef create_DefineStmt(structs.DefineStmt* data, offset_to_index): cdef object v_kind = getattr(enums, 'ObjectType')(data.kind) cdef object v_oldstyle = bool(data.oldstyle) cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef tuple v_definition = _pg_list_to_tuple(data.definition, offset_to_index) cdef object v_if_not_exists = bool(data.if_not_exists) cdef object v_replace = bool(data.replace) return ast.DefineStmt(v_kind, v_oldstyle, v_defnames, v_args, v_definition, v_if_not_exists, v_replace) cdef create_CreateDomainStmt(structs.CreateDomainStmt* data, offset_to_index): cdef tuple v_domainname = _pg_list_to_tuple(data.domainname, offset_to_index) cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) return ast.CreateDomainStmt(v_domainname, v_typeName, v_collClause, v_constraints) cdef create_CreateOpClassStmt(structs.CreateOpClassStmt* data, offset_to_index): cdef tuple v_opclassname = _pg_list_to_tuple(data.opclassname, offset_to_index) cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None cdef object v_datatype = create(data.datatype, offset_to_index) if data.datatype is not NULL else None cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) cdef object v_isDefault = bool(data.isDefault) return ast.CreateOpClassStmt(v_opclassname, v_opfamilyname, v_amname, v_datatype, v_items, v_isDefault) cdef create_CreateOpClassItem(structs.CreateOpClassItem* data, offset_to_index): cdef object v_itemtype = data.itemtype cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None cdef object v_number = data.number cdef tuple v_order_family = _pg_list_to_tuple(data.order_family, offset_to_index) cdef tuple v_class_args = _pg_list_to_tuple(data.class_args, offset_to_index) cdef object v_storedtype = create(data.storedtype, offset_to_index) if data.storedtype is not NULL else None return ast.CreateOpClassItem(v_itemtype, v_name, v_number, v_order_family, v_class_args, v_storedtype) cdef create_CreateOpFamilyStmt(structs.CreateOpFamilyStmt* data, offset_to_index): cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None return ast.CreateOpFamilyStmt(v_opfamilyname, v_amname) cdef create_AlterOpFamilyStmt(structs.AlterOpFamilyStmt* data, offset_to_index): cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None cdef object v_isDrop = bool(data.isDrop) cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) return ast.AlterOpFamilyStmt(v_opfamilyname, v_amname, v_isDrop, v_items) cdef create_DropStmt(structs.DropStmt* data, offset_to_index): cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) cdef object v_missing_ok = bool(data.missing_ok) cdef object v_concurrent = bool(data.concurrent) return ast.DropStmt(v_objects, v_removeType, v_behavior, v_missing_ok, v_concurrent) cdef create_TruncateStmt(structs.TruncateStmt* data, offset_to_index): cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) cdef object v_restart_seqs = bool(data.restart_seqs) cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) return ast.TruncateStmt(v_relations, v_restart_seqs, v_behavior) cdef create_CommentStmt(structs.CommentStmt* data, offset_to_index): cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None cdef object v_comment = data.comment.decode("utf-8") if data.comment is not NULL else None return ast.CommentStmt(v_objtype, v_object, v_comment) cdef create_SecLabelStmt(structs.SecLabelStmt* data, offset_to_index): cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None cdef object v_provider = data.provider.decode("utf-8") if data.provider is not NULL else None cdef object v_label = data.label.decode("utf-8") if data.label is not NULL else None return ast.SecLabelStmt(v_objtype, v_object, v_provider, v_label) cdef create_DeclareCursorStmt(structs.DeclareCursorStmt* data, offset_to_index): cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None cdef object v_options = data.options cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None return ast.DeclareCursorStmt(v_portalname, v_options, v_query) cdef create_ClosePortalStmt(structs.ClosePortalStmt* data, offset_to_index): cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None return ast.ClosePortalStmt(v_portalname) cdef create_FetchStmt(structs.FetchStmt* data, offset_to_index): cdef object v_direction = getattr(enums, 'FetchDirection')(data.direction) cdef object v_howMany = data.howMany cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None cdef object v_ismove = bool(data.ismove) return ast.FetchStmt(v_direction, v_howMany, v_portalname, v_ismove) cdef create_IndexStmt(structs.IndexStmt* data, offset_to_index): cdef object v_idxname = data.idxname.decode("utf-8") if data.idxname is not NULL else None cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None cdef object v_tableSpace = data.tableSpace.decode("utf-8") if data.tableSpace is not NULL else None cdef tuple v_indexParams = _pg_list_to_tuple(data.indexParams, offset_to_index) cdef tuple v_indexIncludingParams = _pg_list_to_tuple(data.indexIncludingParams, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef tuple v_excludeOpNames = _pg_list_to_tuple(data.excludeOpNames, offset_to_index) cdef object v_idxcomment = data.idxcomment.decode("utf-8") if data.idxcomment is not NULL else None cdef object v_oldNumber = data.oldNumber cdef object v_oldCreateSubid = data.oldCreateSubid cdef object v_oldFirstRelfilelocatorSubid = data.oldFirstRelfilelocatorSubid cdef object v_unique = bool(data.unique) cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) cdef object v_primary = bool(data.primary) cdef object v_isconstraint = bool(data.isconstraint) cdef object v_deferrable = bool(data.deferrable) cdef object v_initdeferred = bool(data.initdeferred) cdef object v_transformed = bool(data.transformed) cdef object v_concurrent = bool(data.concurrent) cdef object v_if_not_exists = bool(data.if_not_exists) cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) return ast.IndexStmt(v_idxname, v_relation, v_accessMethod, v_tableSpace, v_indexParams, v_indexIncludingParams, v_options, v_whereClause, v_excludeOpNames, v_idxcomment, v_oldNumber, v_oldCreateSubid, v_oldFirstRelfilelocatorSubid, v_unique, v_nulls_not_distinct, v_primary, v_isconstraint, v_deferrable, v_initdeferred, v_transformed, v_concurrent, v_if_not_exists, v_reset_default_tblspc) cdef create_CreateStatsStmt(structs.CreateStatsStmt* data, offset_to_index): cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) cdef object v_stxcomment = data.stxcomment.decode("utf-8") if data.stxcomment is not NULL else None cdef object v_transformed = bool(data.transformed) cdef object v_if_not_exists = bool(data.if_not_exists) return ast.CreateStatsStmt(v_defnames, v_stat_types, v_exprs, v_relations, v_stxcomment, v_transformed, v_if_not_exists) cdef create_StatsElem(structs.StatsElem* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None return ast.StatsElem(v_name, v_expr) cdef create_AlterStatsStmt(structs.AlterStatsStmt* data, offset_to_index): cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None cdef object v_missing_ok = bool(data.missing_ok) return ast.AlterStatsStmt(v_defnames, v_stxstattarget, v_missing_ok) cdef create_CreateFunctionStmt(structs.CreateFunctionStmt* data, offset_to_index): cdef object v_is_procedure = bool(data.is_procedure) cdef object v_replace = bool(data.replace) cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) cdef tuple v_parameters = _pg_list_to_tuple(data.parameters, offset_to_index) cdef object v_returnType = create(data.returnType, offset_to_index) if data.returnType is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_sql_body = create(data.sql_body, offset_to_index) if data.sql_body is not NULL else None return ast.CreateFunctionStmt(v_is_procedure, v_replace, v_funcname, v_parameters, v_returnType, v_options, v_sql_body) cdef create_FunctionParameter(structs.FunctionParameter* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None cdef object v_mode = getattr(enums, 'FunctionParameterMode')(chr(data.mode)) cdef object v_defexpr = create(data.defexpr, offset_to_index) if data.defexpr is not NULL else None return ast.FunctionParameter(v_name, v_argType, v_mode, v_defexpr) cdef create_AlterFunctionStmt(structs.AlterFunctionStmt* data, offset_to_index): cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) return ast.AlterFunctionStmt(v_objtype, v_func, v_actions) cdef create_DoStmt(structs.DoStmt* data, offset_to_index): cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) return ast.DoStmt(v_args) cdef create_InlineCodeBlock(structs.InlineCodeBlock* data, offset_to_index): cdef object v_source_text = data.source_text.decode("utf-8") if data.source_text is not NULL else None cdef object v_langIsTrusted = bool(data.langIsTrusted) cdef object v_atomic = bool(data.atomic) return ast.InlineCodeBlock(v_source_text, v_langIsTrusted, v_atomic) cdef create_CallStmt(structs.CallStmt* data, offset_to_index): cdef object v_funccall = create(data.funccall, offset_to_index) if data.funccall is not NULL else None cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None cdef tuple v_outargs = _pg_list_to_tuple(data.outargs, offset_to_index) return ast.CallStmt(v_funccall, v_funcexpr, v_outargs) cdef create_CallContext(structs.CallContext* data, offset_to_index): cdef object v_atomic = bool(data.atomic) return ast.CallContext(v_atomic) cdef create_RenameStmt(structs.RenameStmt* data, offset_to_index): cdef object v_renameType = getattr(enums, 'ObjectType')(data.renameType) cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None cdef object v_newname = data.newname.decode("utf-8") if data.newname is not NULL else None cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) cdef object v_missing_ok = bool(data.missing_ok) return ast.RenameStmt(v_renameType, v_relationType, v_relation, v_object, v_subname, v_newname, v_behavior, v_missing_ok) cdef create_AlterObjectDependsStmt(structs.AlterObjectDependsStmt* data, offset_to_index): cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None cdef object v_extname = create(data.extname, offset_to_index) if data.extname is not NULL else None cdef object v_remove = bool(data.remove) return ast.AlterObjectDependsStmt(v_objectType, v_relation, v_object, v_extname, v_remove) cdef create_AlterObjectSchemaStmt(structs.AlterObjectSchemaStmt* data, offset_to_index): cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None cdef object v_newschema = data.newschema.decode("utf-8") if data.newschema is not NULL else None cdef object v_missing_ok = bool(data.missing_ok) return ast.AlterObjectSchemaStmt(v_objectType, v_relation, v_object, v_newschema, v_missing_ok) cdef create_AlterOwnerStmt(structs.AlterOwnerStmt* data, offset_to_index): cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None return ast.AlterOwnerStmt(v_objectType, v_relation, v_object, v_newowner) cdef create_AlterOperatorStmt(structs.AlterOperatorStmt* data, offset_to_index): cdef object v_opername = create(data.opername, offset_to_index) if data.opername is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterOperatorStmt(v_opername, v_options) cdef create_AlterTypeStmt(structs.AlterTypeStmt* data, offset_to_index): cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterTypeStmt(v_typeName, v_options) cdef create_RuleStmt(structs.RuleStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef object v_event = getattr(enums, 'CmdType')(data.event) cdef object v_instead = bool(data.instead) cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) cdef object v_replace = bool(data.replace) return ast.RuleStmt(v_relation, v_rulename, v_whereClause, v_event, v_instead, v_actions, v_replace) cdef create_NotifyStmt(structs.NotifyStmt* data, offset_to_index): cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None cdef object v_payload = data.payload.decode("utf-8") if data.payload is not NULL else None return ast.NotifyStmt(v_conditionname, v_payload) cdef create_ListenStmt(structs.ListenStmt* data, offset_to_index): cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None return ast.ListenStmt(v_conditionname) cdef create_UnlistenStmt(structs.UnlistenStmt* data, offset_to_index): cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None return ast.UnlistenStmt(v_conditionname) cdef create_TransactionStmt(structs.TransactionStmt* data, offset_to_index): cdef object v_kind = getattr(enums, 'TransactionStmtKind')(data.kind) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_savepoint_name = data.savepoint_name.decode("utf-8") if data.savepoint_name is not NULL else None cdef object v_gid = data.gid.decode("utf-8") if data.gid is not NULL else None cdef object v_chain = bool(data.chain) cdef object v_location = offset_to_index(data.location) return ast.TransactionStmt(v_kind, v_options, v_savepoint_name, v_gid, v_chain, v_location) cdef create_CompositeTypeStmt(structs.CompositeTypeStmt* data, offset_to_index): cdef object v_typevar = create(data.typevar, offset_to_index) if data.typevar is not NULL else None cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) return ast.CompositeTypeStmt(v_typevar, v_coldeflist) cdef create_CreateEnumStmt(structs.CreateEnumStmt* data, offset_to_index): cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) cdef tuple v_vals = _pg_list_to_tuple(data.vals, offset_to_index) return ast.CreateEnumStmt(v_typeName, v_vals) cdef create_CreateRangeStmt(structs.CreateRangeStmt* data, offset_to_index): cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) return ast.CreateRangeStmt(v_typeName, v_params) cdef create_AlterEnumStmt(structs.AlterEnumStmt* data, offset_to_index): cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None cdef object v_newVal = data.newVal.decode("utf-8") if data.newVal is not NULL else None cdef object v_newValNeighbor = data.newValNeighbor.decode("utf-8") if data.newValNeighbor is not NULL else None cdef object v_newValIsAfter = bool(data.newValIsAfter) cdef object v_skipIfNewValExists = bool(data.skipIfNewValExists) return ast.AlterEnumStmt(v_typeName, v_oldVal, v_newVal, v_newValNeighbor, v_newValIsAfter, v_skipIfNewValExists) cdef create_ViewStmt(structs.ViewStmt* data, offset_to_index): cdef object v_view = create(data.view, offset_to_index) if data.view is not NULL else None cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None cdef object v_replace = bool(data.replace) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_withCheckOption = getattr(enums, 'ViewCheckOption')(data.withCheckOption) return ast.ViewStmt(v_view, v_aliases, v_query, v_replace, v_options, v_withCheckOption) cdef create_LoadStmt(structs.LoadStmt* data, offset_to_index): cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None return ast.LoadStmt(v_filename) cdef create_CreatedbStmt(structs.CreatedbStmt* data, offset_to_index): cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreatedbStmt(v_dbname, v_options) cdef create_AlterDatabaseStmt(structs.AlterDatabaseStmt* data, offset_to_index): cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterDatabaseStmt(v_dbname, v_options) cdef create_AlterDatabaseRefreshCollStmt(structs.AlterDatabaseRefreshCollStmt* data, offset_to_index): cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None return ast.AlterDatabaseRefreshCollStmt(v_dbname) cdef create_AlterDatabaseSetStmt(structs.AlterDatabaseSetStmt* data, offset_to_index): cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None return ast.AlterDatabaseSetStmt(v_dbname, v_setstmt) cdef create_DropdbStmt(structs.DropdbStmt* data, offset_to_index): cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None cdef object v_missing_ok = bool(data.missing_ok) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.DropdbStmt(v_dbname, v_missing_ok, v_options) cdef create_AlterSystemStmt(structs.AlterSystemStmt* data, offset_to_index): cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None return ast.AlterSystemStmt(v_setstmt) cdef create_ClusterStmt(structs.ClusterStmt* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) return ast.ClusterStmt(v_relation, v_indexname, v_params) cdef create_VacuumStmt(structs.VacuumStmt* data, offset_to_index): cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) cdef object v_is_vacuumcmd = bool(data.is_vacuumcmd) return ast.VacuumStmt(v_options, v_rels, v_is_vacuumcmd) cdef create_VacuumRelation(structs.VacuumRelation* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef tuple v_va_cols = _pg_list_to_tuple(data.va_cols, offset_to_index) return ast.VacuumRelation(v_relation, v_va_cols) cdef create_ExplainStmt(structs.ExplainStmt* data, offset_to_index): cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.ExplainStmt(v_query, v_options) cdef create_CreateTableAsStmt(structs.CreateTableAsStmt* data, offset_to_index): cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) cdef object v_is_select_into = bool(data.is_select_into) cdef object v_if_not_exists = bool(data.if_not_exists) return ast.CreateTableAsStmt(v_query, v_into, v_objtype, v_is_select_into, v_if_not_exists) cdef create_RefreshMatViewStmt(structs.RefreshMatViewStmt* data, offset_to_index): cdef object v_concurrent = bool(data.concurrent) cdef object v_skipData = bool(data.skipData) cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None return ast.RefreshMatViewStmt(v_concurrent, v_skipData, v_relation) cdef create_CheckPointStmt(structs.CheckPointStmt* data, offset_to_index): return ast.CheckPointStmt() cdef create_DiscardStmt(structs.DiscardStmt* data, offset_to_index): cdef object v_target = getattr(enums, 'DiscardMode')(data.target) return ast.DiscardStmt(v_target) cdef create_LockStmt(structs.LockStmt* data, offset_to_index): cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) cdef object v_mode = data.mode cdef object v_nowait = bool(data.nowait) return ast.LockStmt(v_relations, v_mode, v_nowait) cdef create_ConstraintsSetStmt(structs.ConstraintsSetStmt* data, offset_to_index): cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) cdef object v_deferred = bool(data.deferred) return ast.ConstraintsSetStmt(v_constraints, v_deferred) cdef create_ReindexStmt(structs.ReindexStmt* data, offset_to_index): cdef object v_kind = getattr(enums, 'ReindexObjectType')(data.kind) cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) return ast.ReindexStmt(v_kind, v_relation, v_name, v_params) cdef create_CreateConversionStmt(structs.CreateConversionStmt* data, offset_to_index): cdef tuple v_conversion_name = _pg_list_to_tuple(data.conversion_name, offset_to_index) cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None cdef object v_to_encoding_name = data.to_encoding_name.decode("utf-8") if data.to_encoding_name is not NULL else None cdef tuple v_func_name = _pg_list_to_tuple(data.func_name, offset_to_index) cdef object v_def_ = bool(data.def_) return ast.CreateConversionStmt(v_conversion_name, v_for_encoding_name, v_to_encoding_name, v_func_name, v_def_) cdef create_CreateCastStmt(structs.CreateCastStmt* data, offset_to_index): cdef object v_sourcetype = create(data.sourcetype, offset_to_index) if data.sourcetype is not NULL else None cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None cdef object v_context = getattr(enums, 'CoercionContext')(data.context) cdef object v_inout = bool(data.inout) return ast.CreateCastStmt(v_sourcetype, v_targettype, v_func, v_context, v_inout) cdef create_CreateTransformStmt(structs.CreateTransformStmt* data, offset_to_index): cdef object v_replace = bool(data.replace) cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None cdef object v_lang = data.lang.decode("utf-8") if data.lang is not NULL else None cdef object v_fromsql = create(data.fromsql, offset_to_index) if data.fromsql is not NULL else None cdef object v_tosql = create(data.tosql, offset_to_index) if data.tosql is not NULL else None return ast.CreateTransformStmt(v_replace, v_type_name, v_lang, v_fromsql, v_tosql) cdef create_PrepareStmt(structs.PrepareStmt* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None return ast.PrepareStmt(v_name, v_argtypes, v_query) cdef create_ExecuteStmt(structs.ExecuteStmt* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) return ast.ExecuteStmt(v_name, v_params) cdef create_DeallocateStmt(structs.DeallocateStmt* data, offset_to_index): cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_isall = bool(data.isall) cdef object v_location = offset_to_index(data.location) return ast.DeallocateStmt(v_name, v_isall, v_location) cdef create_DropOwnedStmt(structs.DropOwnedStmt* data, offset_to_index): cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) return ast.DropOwnedStmt(v_roles, v_behavior) cdef create_ReassignOwnedStmt(structs.ReassignOwnedStmt* data, offset_to_index): cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) cdef object v_newrole = create(data.newrole, offset_to_index) if data.newrole is not NULL else None return ast.ReassignOwnedStmt(v_roles, v_newrole) cdef create_AlterTSDictionaryStmt(structs.AlterTSDictionaryStmt* data, offset_to_index): cdef tuple v_dictname = _pg_list_to_tuple(data.dictname, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterTSDictionaryStmt(v_dictname, v_options) cdef create_AlterTSConfigurationStmt(structs.AlterTSConfigurationStmt* data, offset_to_index): cdef object v_kind = getattr(enums, 'AlterTSConfigType')(data.kind) cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) cdef tuple v_tokentype = _pg_list_to_tuple(data.tokentype, offset_to_index) cdef tuple v_dicts = _pg_list_to_tuple(data.dicts, offset_to_index) cdef object v_override = bool(data.override) cdef object v_replace = bool(data.replace) cdef object v_missing_ok = bool(data.missing_ok) return ast.AlterTSConfigurationStmt(v_kind, v_cfgname, v_tokentype, v_dicts, v_override, v_replace, v_missing_ok) cdef create_PublicationTable(structs.PublicationTable* data, offset_to_index): cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) return ast.PublicationTable(v_relation, v_whereClause, v_columns) cdef create_PublicationObjSpec(structs.PublicationObjSpec* data, offset_to_index): cdef object v_pubobjtype = getattr(enums, 'PublicationObjSpecType')(data.pubobjtype) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_pubtable = create(data.pubtable, offset_to_index) if data.pubtable is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.PublicationObjSpec(v_pubobjtype, v_name, v_pubtable, v_location) cdef create_CreatePublicationStmt(structs.CreatePublicationStmt* data, offset_to_index): cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) cdef object v_for_all_tables = bool(data.for_all_tables) return ast.CreatePublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables) cdef create_AlterPublicationStmt(structs.AlterPublicationStmt* data, offset_to_index): cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) cdef object v_for_all_tables = bool(data.for_all_tables) cdef object v_action = getattr(enums, 'AlterPublicationAction')(data.action) return ast.AlterPublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables, v_action) cdef create_CreateSubscriptionStmt(structs.CreateSubscriptionStmt* data, offset_to_index): cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.CreateSubscriptionStmt(v_subname, v_conninfo, v_publication, v_options) cdef create_AlterSubscriptionStmt(structs.AlterSubscriptionStmt* data, offset_to_index): cdef object v_kind = getattr(enums, 'AlterSubscriptionType')(data.kind) cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) return ast.AlterSubscriptionStmt(v_kind, v_subname, v_conninfo, v_publication, v_options) cdef create_DropSubscriptionStmt(structs.DropSubscriptionStmt* data, offset_to_index): cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None cdef object v_missing_ok = bool(data.missing_ok) cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) return ast.DropSubscriptionStmt(v_subname, v_missing_ok, v_behavior) cdef create_Alias(structs.Alias* data, offset_to_index): cdef object v_aliasname = data.aliasname.decode("utf-8") if data.aliasname is not NULL else None cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) return ast.Alias(v_aliasname, v_colnames) cdef create_RangeVar(structs.RangeVar* data, offset_to_index): cdef object v_catalogname = data.catalogname.decode("utf-8") if data.catalogname is not NULL else None cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None cdef object v_inh = bool(data.inh) cdef object v_relpersistence = chr(data.relpersistence) cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.RangeVar(v_catalogname, v_schemaname, v_relname, v_inh, v_relpersistence, v_alias, v_location) cdef create_TableFunc(structs.TableFunc* data, offset_to_index): cdef object v_functype = getattr(enums, 'TableFuncType')(data.functype) cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) cdef tuple v_ns_names = _pg_list_to_tuple(data.ns_names, offset_to_index) cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) cdef tuple v_colexprs = _pg_list_to_tuple(data.colexprs, offset_to_index) cdef tuple v_coldefexprs = _pg_list_to_tuple(data.coldefexprs, offset_to_index) cdef tuple v_colvalexprs = _pg_list_to_tuple(data.colvalexprs, offset_to_index) cdef tuple v_passingvalexprs = _pg_list_to_tuple(data.passingvalexprs, offset_to_index) cdef set v_notnulls = _pg_bitmapset_to_set(data.notnulls) cdef object v_plan = create(data.plan, offset_to_index) if data.plan is not NULL else None cdef object v_ordinalitycol = data.ordinalitycol cdef object v_location = offset_to_index(data.location) return ast.TableFunc(v_functype, v_ns_uris, v_ns_names, v_docexpr, v_rowexpr, v_colnames, v_coltypes, v_coltypmods, v_colcollations, v_colexprs, v_coldefexprs, v_colvalexprs, v_passingvalexprs, v_notnulls, v_plan, v_ordinalitycol, v_location) cdef create_IntoClause(structs.IntoClause* data, offset_to_index): cdef object v_rel = create(data.rel, offset_to_index) if data.rel is not NULL else None cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) cdef object v_onCommit = getattr(enums, 'OnCommitAction')(data.onCommit) cdef object v_tableSpaceName = data.tableSpaceName.decode("utf-8") if data.tableSpaceName is not NULL else None cdef object v_viewQuery = create(data.viewQuery, offset_to_index) if data.viewQuery is not NULL else None cdef object v_skipData = bool(data.skipData) return ast.IntoClause(v_rel, v_colNames, v_accessMethod, v_options, v_onCommit, v_tableSpaceName, v_viewQuery, v_skipData) cdef create_Var(structs.Var* data, offset_to_index): cdef object v_varno = data.varno cdef object v_varattno = data.varattno cdef object v_vartypmod = data.vartypmod cdef set v_varnullingrels = _pg_bitmapset_to_set(data.varnullingrels) cdef object v_varlevelsup = data.varlevelsup cdef object v_location = offset_to_index(data.location) return ast.Var(v_varno, v_varattno, v_vartypmod, v_varnullingrels, v_varlevelsup, v_location) cdef create_Param(structs.Param* data, offset_to_index): cdef object v_paramkind = getattr(enums, 'ParamKind')(data.paramkind) cdef object v_paramid = data.paramid cdef object v_paramtypmod = data.paramtypmod cdef object v_location = offset_to_index(data.location) return ast.Param(v_paramkind, v_paramid, v_paramtypmod, v_location) cdef create_Aggref(structs.Aggref* data, offset_to_index): cdef tuple v_aggargtypes = _pg_list_to_tuple(data.aggargtypes, offset_to_index) cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef tuple v_aggorder = _pg_list_to_tuple(data.aggorder, offset_to_index) cdef tuple v_aggdistinct = _pg_list_to_tuple(data.aggdistinct, offset_to_index) cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None cdef object v_aggstar = bool(data.aggstar) cdef object v_aggvariadic = bool(data.aggvariadic) cdef object v_aggkind = chr(data.aggkind) cdef object v_agglevelsup = data.agglevelsup cdef object v_aggsplit = getattr(enums, 'AggSplit')(data.aggsplit) cdef object v_aggno = data.aggno cdef object v_aggtransno = data.aggtransno cdef object v_location = offset_to_index(data.location) return ast.Aggref(v_aggargtypes, v_aggdirectargs, v_args, v_aggorder, v_aggdistinct, v_aggfilter, v_aggstar, v_aggvariadic, v_aggkind, v_agglevelsup, v_aggsplit, v_aggno, v_aggtransno, v_location) cdef create_GroupingFunc(structs.GroupingFunc* data, offset_to_index): cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) cdef object v_agglevelsup = data.agglevelsup cdef object v_location = offset_to_index(data.location) return ast.GroupingFunc(v_args, v_refs, v_agglevelsup, v_location) cdef create_WindowFunc(structs.WindowFunc* data, offset_to_index): cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None cdef tuple v_runCondition = _pg_list_to_tuple(data.runCondition, offset_to_index) cdef object v_winref = data.winref cdef object v_winstar = bool(data.winstar) cdef object v_winagg = bool(data.winagg) cdef object v_location = offset_to_index(data.location) return ast.WindowFunc(v_args, v_aggfilter, v_runCondition, v_winref, v_winstar, v_winagg, v_location) cdef create_WindowFuncRunCondition(structs.WindowFuncRunCondition* data, offset_to_index): cdef object v_wfunc_left = bool(data.wfunc_left) cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None return ast.WindowFuncRunCondition(v_wfunc_left, v_arg) cdef create_MergeSupportFunc(structs.MergeSupportFunc* data, offset_to_index): cdef object v_location = offset_to_index(data.location) return ast.MergeSupportFunc(v_location) cdef create_SubscriptingRef(structs.SubscriptingRef* data, offset_to_index): cdef object v_reftypmod = data.reftypmod cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) cdef tuple v_reflowerindexpr = _pg_list_to_tuple(data.reflowerindexpr, offset_to_index) cdef object v_refexpr = create(data.refexpr, offset_to_index) if data.refexpr is not NULL else None cdef object v_refassgnexpr = create(data.refassgnexpr, offset_to_index) if data.refassgnexpr is not NULL else None return ast.SubscriptingRef(v_reftypmod, v_refupperindexpr, v_reflowerindexpr, v_refexpr, v_refassgnexpr) cdef create_FuncExpr(structs.FuncExpr* data, offset_to_index): cdef object v_funcretset = bool(data.funcretset) cdef object v_funcvariadic = bool(data.funcvariadic) cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.FuncExpr(v_funcretset, v_funcvariadic, v_funcformat, v_args, v_location) cdef create_NamedArgExpr(structs.NamedArgExpr* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef object v_argnumber = data.argnumber cdef object v_location = offset_to_index(data.location) return ast.NamedArgExpr(v_arg, v_name, v_argnumber, v_location) cdef create_OpExpr(structs.OpExpr* data, offset_to_index): cdef object v_opretset = bool(data.opretset) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.OpExpr(v_opretset, v_args, v_location) cdef create_ScalarArrayOpExpr(structs.ScalarArrayOpExpr* data, offset_to_index): cdef object v_useOr = bool(data.useOr) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.ScalarArrayOpExpr(v_useOr, v_args, v_location) cdef create_BoolExpr(structs.BoolExpr* data, offset_to_index): cdef object v_boolop = getattr(enums, 'BoolExprType')(data.boolop) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.BoolExpr(v_boolop, v_args, v_location) cdef create_SubLink(structs.SubLink* data, offset_to_index): cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) cdef object v_subLinkId = data.subLinkId cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None cdef tuple v_operName = _pg_list_to_tuple(data.operName, offset_to_index) cdef object v_subselect = create(data.subselect, offset_to_index) if data.subselect is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.SubLink(v_subLinkType, v_subLinkId, v_testexpr, v_operName, v_subselect, v_location) cdef create_SubPlan(structs.SubPlan* data, offset_to_index): cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None cdef tuple v_paramIds = _pg_list_to_tuple(data.paramIds, offset_to_index) cdef object v_plan_id = data.plan_id cdef object v_plan_name = data.plan_name.decode("utf-8") if data.plan_name is not NULL else None cdef object v_firstColTypmod = data.firstColTypmod cdef object v_useHashTable = bool(data.useHashTable) cdef object v_unknownEqFalse = bool(data.unknownEqFalse) cdef object v_parallel_safe = bool(data.parallel_safe) cdef tuple v_setParam = _pg_list_to_tuple(data.setParam, offset_to_index) cdef tuple v_parParam = _pg_list_to_tuple(data.parParam, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_startup_cost = data.startup_cost cdef object v_per_call_cost = data.per_call_cost return ast.SubPlan(v_subLinkType, v_testexpr, v_paramIds, v_plan_id, v_plan_name, v_firstColTypmod, v_useHashTable, v_unknownEqFalse, v_parallel_safe, v_setParam, v_parParam, v_args, v_startup_cost, v_per_call_cost) cdef create_AlternativeSubPlan(structs.AlternativeSubPlan* data, offset_to_index): cdef tuple v_subplans = _pg_list_to_tuple(data.subplans, offset_to_index) return ast.AlternativeSubPlan(v_subplans) cdef create_FieldSelect(structs.FieldSelect* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_fieldnum = data.fieldnum cdef object v_resulttypmod = data.resulttypmod return ast.FieldSelect(v_arg, v_fieldnum, v_resulttypmod) cdef create_FieldStore(structs.FieldStore* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) cdef tuple v_fieldnums = _pg_list_to_tuple(data.fieldnums, offset_to_index) return ast.FieldStore(v_arg, v_newvals, v_fieldnums) cdef create_RelabelType(structs.RelabelType* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_resulttypmod = data.resulttypmod cdef object v_relabelformat = getattr(enums, 'CoercionForm')(data.relabelformat) cdef object v_location = offset_to_index(data.location) return ast.RelabelType(v_arg, v_resulttypmod, v_relabelformat, v_location) cdef create_CoerceViaIO(structs.CoerceViaIO* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) cdef object v_location = offset_to_index(data.location) return ast.CoerceViaIO(v_arg, v_coerceformat, v_location) cdef create_ArrayCoerceExpr(structs.ArrayCoerceExpr* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None cdef object v_resulttypmod = data.resulttypmod cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) cdef object v_location = offset_to_index(data.location) return ast.ArrayCoerceExpr(v_arg, v_elemexpr, v_resulttypmod, v_coerceformat, v_location) cdef create_ConvertRowtypeExpr(structs.ConvertRowtypeExpr* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) cdef object v_location = offset_to_index(data.location) return ast.ConvertRowtypeExpr(v_arg, v_convertformat, v_location) cdef create_CollateExpr(structs.CollateExpr* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.CollateExpr(v_arg, v_location) cdef create_CaseExpr(structs.CaseExpr* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_defresult = create(data.defresult, offset_to_index) if data.defresult is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.CaseExpr(v_arg, v_args, v_defresult, v_location) cdef create_CaseWhen(structs.CaseWhen* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None cdef object v_location = offset_to_index(data.location) return ast.CaseWhen(v_expr, v_result, v_location) cdef create_CaseTestExpr(structs.CaseTestExpr* data, offset_to_index): cdef object v_typeMod = data.typeMod return ast.CaseTestExpr(v_typeMod) cdef create_ArrayExpr(structs.ArrayExpr* data, offset_to_index): cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) cdef object v_multidims = bool(data.multidims) cdef object v_location = offset_to_index(data.location) return ast.ArrayExpr(v_elements, v_multidims, v_location) cdef create_RowExpr(structs.RowExpr* data, offset_to_index): cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.RowExpr(v_args, v_row_format, v_colnames, v_location) cdef create_RowCompareExpr(structs.RowCompareExpr* data, offset_to_index): cdef object v_rctype = getattr(enums, 'RowCompareType')(data.rctype) cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) cdef tuple v_opfamilies = _pg_list_to_tuple(data.opfamilies, offset_to_index) cdef tuple v_inputcollids = _pg_list_to_tuple(data.inputcollids, offset_to_index) cdef tuple v_largs = _pg_list_to_tuple(data.largs, offset_to_index) cdef tuple v_rargs = _pg_list_to_tuple(data.rargs, offset_to_index) return ast.RowCompareExpr(v_rctype, v_opnos, v_opfamilies, v_inputcollids, v_largs, v_rargs) cdef create_CoalesceExpr(structs.CoalesceExpr* data, offset_to_index): cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.CoalesceExpr(v_args, v_location) cdef create_MinMaxExpr(structs.MinMaxExpr* data, offset_to_index): cdef object v_op = getattr(enums, 'MinMaxOp')(data.op) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_location = offset_to_index(data.location) return ast.MinMaxExpr(v_op, v_args, v_location) cdef create_SQLValueFunction(structs.SQLValueFunction* data, offset_to_index): cdef object v_op = getattr(enums, 'SQLValueFunctionOp')(data.op) cdef object v_typmod = data.typmod cdef object v_location = offset_to_index(data.location) return ast.SQLValueFunction(v_op, v_typmod, v_location) cdef create_XmlExpr(structs.XmlExpr* data, offset_to_index): cdef object v_op = getattr(enums, 'XmlExprOp')(data.op) cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None cdef tuple v_named_args = _pg_list_to_tuple(data.named_args, offset_to_index) cdef tuple v_arg_names = _pg_list_to_tuple(data.arg_names, offset_to_index) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) cdef object v_indent = bool(data.indent) cdef object v_typmod = data.typmod cdef object v_location = offset_to_index(data.location) return ast.XmlExpr(v_op, v_name, v_named_args, v_arg_names, v_args, v_xmloption, v_indent, v_typmod, v_location) cdef create_JsonFormat(structs.JsonFormat* data, offset_to_index): cdef object v_format_type = getattr(enums, 'JsonFormatType')(data.format_type) cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) cdef object v_location = offset_to_index(data.location) return ast.JsonFormat(v_format_type, v_encoding, v_location) cdef create_JsonReturning(structs.JsonReturning* data, offset_to_index): cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None cdef object v_typmod = data.typmod return ast.JsonReturning(v_format, v_typmod) cdef create_JsonValueExpr(structs.JsonValueExpr* data, offset_to_index): cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None return ast.JsonValueExpr(v_raw_expr, v_formatted_expr, v_format) cdef create_JsonConstructorExpr(structs.JsonConstructorExpr* data, offset_to_index): cdef object v_type = getattr(enums, 'JsonConstructorType')(data.type) cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None cdef object v_coercion = create(data.coercion, offset_to_index) if data.coercion is not NULL else None cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None cdef object v_absent_on_null = bool(data.absent_on_null) cdef object v_unique = bool(data.unique) cdef object v_location = offset_to_index(data.location) return ast.JsonConstructorExpr(v_type, v_args, v_func, v_coercion, v_returning, v_absent_on_null, v_unique, v_location) cdef create_JsonIsPredicate(structs.JsonIsPredicate* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None cdef object v_item_type = getattr(enums, 'JsonValueType')(data.item_type) cdef object v_unique_keys = bool(data.unique_keys) cdef object v_location = offset_to_index(data.location) return ast.JsonIsPredicate(v_expr, v_format, v_item_type, v_unique_keys, v_location) cdef create_JsonBehavior(structs.JsonBehavior* data, offset_to_index): cdef object v_btype = getattr(enums, 'JsonBehaviorType')(data.btype) cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_coerce = bool(data.coerce) cdef object v_location = offset_to_index(data.location) return ast.JsonBehavior(v_btype, v_expr, v_coerce, v_location) cdef create_JsonExpr(structs.JsonExpr* data, offset_to_index): cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None cdef object v_path_spec = create(data.path_spec, offset_to_index) if data.path_spec is not NULL else None cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None cdef tuple v_passing_names = _pg_list_to_tuple(data.passing_names, offset_to_index) cdef tuple v_passing_values = _pg_list_to_tuple(data.passing_values, offset_to_index) cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None cdef object v_use_io_coercion = bool(data.use_io_coercion) cdef object v_use_json_coercion = bool(data.use_json_coercion) cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) cdef object v_omit_quotes = bool(data.omit_quotes) cdef object v_location = offset_to_index(data.location) return ast.JsonExpr(v_op, v_column_name, v_formatted_expr, v_format, v_path_spec, v_returning, v_passing_names, v_passing_values, v_on_empty, v_on_error, v_use_io_coercion, v_use_json_coercion, v_wrapper, v_omit_quotes, v_location) cdef create_NullTest(structs.NullTest* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) cdef object v_argisrow = bool(data.argisrow) cdef object v_location = offset_to_index(data.location) return ast.NullTest(v_arg, v_nulltesttype, v_argisrow, v_location) cdef create_BooleanTest(structs.BooleanTest* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) cdef object v_location = offset_to_index(data.location) return ast.BooleanTest(v_arg, v_booltesttype, v_location) cdef create_MergeAction(structs.MergeAction* data, offset_to_index): cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) cdef object v_override = getattr(enums, 'OverridingKind')(data.override) cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) cdef tuple v_updateColnos = _pg_list_to_tuple(data.updateColnos, offset_to_index) return ast.MergeAction(v_matchKind, v_commandType, v_override, v_qual, v_targetList, v_updateColnos) cdef create_CoerceToDomain(structs.CoerceToDomain* data, offset_to_index): cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None cdef object v_resulttypmod = data.resulttypmod cdef object v_coercionformat = getattr(enums, 'CoercionForm')(data.coercionformat) cdef object v_location = offset_to_index(data.location) return ast.CoerceToDomain(v_arg, v_resulttypmod, v_coercionformat, v_location) cdef create_CoerceToDomainValue(structs.CoerceToDomainValue* data, offset_to_index): cdef object v_typeMod = data.typeMod cdef object v_location = offset_to_index(data.location) return ast.CoerceToDomainValue(v_typeMod, v_location) cdef create_SetToDefault(structs.SetToDefault* data, offset_to_index): cdef object v_typeMod = data.typeMod cdef object v_location = offset_to_index(data.location) return ast.SetToDefault(v_typeMod, v_location) cdef create_CurrentOfExpr(structs.CurrentOfExpr* data, offset_to_index): cdef object v_cvarno = data.cvarno cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None cdef object v_cursor_param = data.cursor_param return ast.CurrentOfExpr(v_cvarno, v_cursor_name, v_cursor_param) cdef create_InferenceElem(structs.InferenceElem* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None return ast.InferenceElem(v_expr) cdef create_TargetEntry(structs.TargetEntry* data, offset_to_index): cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None cdef object v_resno = data.resno cdef object v_resname = data.resname.decode("utf-8") if data.resname is not NULL else None cdef object v_ressortgroupref = data.ressortgroupref cdef object v_resorigcol = data.resorigcol cdef object v_resjunk = bool(data.resjunk) return ast.TargetEntry(v_expr, v_resno, v_resname, v_ressortgroupref, v_resorigcol, v_resjunk) cdef create_RangeTblRef(structs.RangeTblRef* data, offset_to_index): cdef object v_rtindex = data.rtindex return ast.RangeTblRef(v_rtindex) cdef create_JoinExpr(structs.JoinExpr* data, offset_to_index): cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) cdef object v_isNatural = bool(data.isNatural) cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None cdef object v_rtindex = data.rtindex return ast.JoinExpr(v_jointype, v_isNatural, v_larg, v_rarg, v_usingClause, v_join_using_alias, v_quals, v_alias, v_rtindex) cdef create_FromExpr(structs.FromExpr* data, offset_to_index): cdef tuple v_fromlist = _pg_list_to_tuple(data.fromlist, offset_to_index) cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None return ast.FromExpr(v_fromlist, v_quals) cdef create_OnConflictExpr(structs.OnConflictExpr* data, offset_to_index): cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) cdef object v_arbiterWhere = create(data.arbiterWhere, offset_to_index) if data.arbiterWhere is not NULL else None cdef tuple v_onConflictSet = _pg_list_to_tuple(data.onConflictSet, offset_to_index) cdef object v_onConflictWhere = create(data.onConflictWhere, offset_to_index) if data.onConflictWhere is not NULL else None cdef object v_exclRelIndex = data.exclRelIndex cdef tuple v_exclRelTlist = _pg_list_to_tuple(data.exclRelTlist, offset_to_index) return ast.OnConflictExpr(v_action, v_arbiterElems, v_arbiterWhere, v_onConflictSet, v_onConflictWhere, v_exclRelIndex, v_exclRelTlist) cdef create_Integer(structs.Integer* data, offset_to_index): cdef object v_ival = data.ival return ast.Integer(v_ival) cdef create_Float(structs.Float* data, offset_to_index): cdef object v_fval = data.fval.decode("utf-8") if data.fval is not NULL else None return ast.Float(v_fval) cdef create_Boolean(structs.Boolean* data, offset_to_index): cdef object v_boolval = bool(data.boolval) return ast.Boolean(v_boolval) cdef create_String(structs.String* data, offset_to_index): cdef object v_sval = data.sval.decode("utf-8") if data.sval is not NULL else None return ast.String(v_sval) cdef create_BitString(structs.BitString* data, offset_to_index): cdef object v_bsval = data.bsval.decode("utf-8") if data.bsval is not NULL else None return ast.BitString(v_bsval) cdef create_A_Const(structs.A_Const* data, offset_to_index): cdef object v_isnull = bool(data.isnull) cdef object v_val if data.isnull: v_val = None elif data.val.boolval.type == structs.T_Boolean: v_val = ast.Boolean(data.val.boolval.boolval) elif data.val.ival.type == structs.T_Integer: v_val = ast.Integer(data.val.ival.ival) elif data.val.fval.type == structs.T_Float: v_val = ast.Float(data.val.fval.fval.decode("utf-8")) elif data.val.bsval.type == structs.T_BitString: v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) elif data.val.sval.type == structs.T_String: v_val = ast.String(data.val.sval.sval.decode("utf-8")) else: v_val = data.val.node return ast.A_Const(v_isnull, v_val) cdef create(void* data, offset_to_index): if data is NULL: return None cdef tuple t cdef int i cdef str s cdef int tag = structs.nodeTag(data) if tag == structs.T_List: return _pg_list_to_tuple( data, offset_to_index) elif tag == structs.T_Alias: return create_Alias( data, offset_to_index) elif tag == structs.T_RangeVar: return create_RangeVar( data, offset_to_index) elif tag == structs.T_TableFunc: return create_TableFunc( data, offset_to_index) elif tag == structs.T_IntoClause: return create_IntoClause( data, offset_to_index) elif tag == structs.T_Var: return create_Var( data, offset_to_index) elif tag == structs.T_Param: return create_Param( data, offset_to_index) elif tag == structs.T_Aggref: return create_Aggref( data, offset_to_index) elif tag == structs.T_GroupingFunc: return create_GroupingFunc( data, offset_to_index) elif tag == structs.T_WindowFunc: return create_WindowFunc( data, offset_to_index) elif tag == structs.T_WindowFuncRunCondition: return create_WindowFuncRunCondition( data, offset_to_index) elif tag == structs.T_MergeSupportFunc: return create_MergeSupportFunc( data, offset_to_index) elif tag == structs.T_SubscriptingRef: return create_SubscriptingRef( data, offset_to_index) elif tag == structs.T_FuncExpr: return create_FuncExpr( data, offset_to_index) elif tag == structs.T_NamedArgExpr: return create_NamedArgExpr( data, offset_to_index) elif tag == structs.T_OpExpr: return create_OpExpr( data, offset_to_index) elif tag == structs.T_ScalarArrayOpExpr: return create_ScalarArrayOpExpr( data, offset_to_index) elif tag == structs.T_BoolExpr: return create_BoolExpr( data, offset_to_index) elif tag == structs.T_SubLink: return create_SubLink( data, offset_to_index) elif tag == structs.T_SubPlan: return create_SubPlan( data, offset_to_index) elif tag == structs.T_AlternativeSubPlan: return create_AlternativeSubPlan( data, offset_to_index) elif tag == structs.T_FieldSelect: return create_FieldSelect( data, offset_to_index) elif tag == structs.T_FieldStore: return create_FieldStore( data, offset_to_index) elif tag == structs.T_RelabelType: return create_RelabelType( data, offset_to_index) elif tag == structs.T_CoerceViaIO: return create_CoerceViaIO( data, offset_to_index) elif tag == structs.T_ArrayCoerceExpr: return create_ArrayCoerceExpr( data, offset_to_index) elif tag == structs.T_ConvertRowtypeExpr: return create_ConvertRowtypeExpr( data, offset_to_index) elif tag == structs.T_CollateExpr: return create_CollateExpr( data, offset_to_index) elif tag == structs.T_CaseExpr: return create_CaseExpr( data, offset_to_index) elif tag == structs.T_CaseWhen: return create_CaseWhen( data, offset_to_index) elif tag == structs.T_CaseTestExpr: return create_CaseTestExpr( data, offset_to_index) elif tag == structs.T_ArrayExpr: return create_ArrayExpr( data, offset_to_index) elif tag == structs.T_RowExpr: return create_RowExpr( data, offset_to_index) elif tag == structs.T_RowCompareExpr: return create_RowCompareExpr( data, offset_to_index) elif tag == structs.T_CoalesceExpr: return create_CoalesceExpr( data, offset_to_index) elif tag == structs.T_MinMaxExpr: return create_MinMaxExpr( data, offset_to_index) elif tag == structs.T_SQLValueFunction: return create_SQLValueFunction( data, offset_to_index) elif tag == structs.T_XmlExpr: return create_XmlExpr( data, offset_to_index) elif tag == structs.T_JsonFormat: return create_JsonFormat( data, offset_to_index) elif tag == structs.T_JsonReturning: return create_JsonReturning( data, offset_to_index) elif tag == structs.T_JsonValueExpr: return create_JsonValueExpr( data, offset_to_index) elif tag == structs.T_JsonConstructorExpr: return create_JsonConstructorExpr( data, offset_to_index) elif tag == structs.T_JsonIsPredicate: return create_JsonIsPredicate( data, offset_to_index) elif tag == structs.T_JsonBehavior: return create_JsonBehavior( data, offset_to_index) elif tag == structs.T_JsonExpr: return create_JsonExpr( data, offset_to_index) elif tag == structs.T_NullTest: return create_NullTest( data, offset_to_index) elif tag == structs.T_BooleanTest: return create_BooleanTest( data, offset_to_index) elif tag == structs.T_MergeAction: return create_MergeAction( data, offset_to_index) elif tag == structs.T_CoerceToDomain: return create_CoerceToDomain( data, offset_to_index) elif tag == structs.T_CoerceToDomainValue: return create_CoerceToDomainValue( data, offset_to_index) elif tag == structs.T_SetToDefault: return create_SetToDefault( data, offset_to_index) elif tag == structs.T_CurrentOfExpr: return create_CurrentOfExpr( data, offset_to_index) elif tag == structs.T_InferenceElem: return create_InferenceElem( data, offset_to_index) elif tag == structs.T_TargetEntry: return create_TargetEntry( data, offset_to_index) elif tag == structs.T_RangeTblRef: return create_RangeTblRef( data, offset_to_index) elif tag == structs.T_JoinExpr: return create_JoinExpr( data, offset_to_index) elif tag == structs.T_FromExpr: return create_FromExpr( data, offset_to_index) elif tag == structs.T_OnConflictExpr: return create_OnConflictExpr( data, offset_to_index) elif tag == structs.T_Query: return create_Query( data, offset_to_index) elif tag == structs.T_TypeName: return create_TypeName( data, offset_to_index) elif tag == structs.T_ColumnRef: return create_ColumnRef( data, offset_to_index) elif tag == structs.T_ParamRef: return create_ParamRef( data, offset_to_index) elif tag == structs.T_A_Expr: return create_A_Expr( data, offset_to_index) elif tag == structs.T_A_Const: return create_A_Const( data, offset_to_index) elif tag == structs.T_TypeCast: return create_TypeCast( data, offset_to_index) elif tag == structs.T_CollateClause: return create_CollateClause( data, offset_to_index) elif tag == structs.T_RoleSpec: return create_RoleSpec( data, offset_to_index) elif tag == structs.T_FuncCall: return create_FuncCall( data, offset_to_index) elif tag == structs.T_A_Star: return create_A_Star( data, offset_to_index) elif tag == structs.T_A_Indices: return create_A_Indices( data, offset_to_index) elif tag == structs.T_A_Indirection: return create_A_Indirection( data, offset_to_index) elif tag == structs.T_A_ArrayExpr: return create_A_ArrayExpr( data, offset_to_index) elif tag == structs.T_ResTarget: return create_ResTarget( data, offset_to_index) elif tag == structs.T_MultiAssignRef: return create_MultiAssignRef( data, offset_to_index) elif tag == structs.T_SortBy: return create_SortBy( data, offset_to_index) elif tag == structs.T_WindowDef: return create_WindowDef( data, offset_to_index) elif tag == structs.T_RangeSubselect: return create_RangeSubselect( data, offset_to_index) elif tag == structs.T_RangeFunction: return create_RangeFunction( data, offset_to_index) elif tag == structs.T_RangeTableFunc: return create_RangeTableFunc( data, offset_to_index) elif tag == structs.T_RangeTableFuncCol: return create_RangeTableFuncCol( data, offset_to_index) elif tag == structs.T_RangeTableSample: return create_RangeTableSample( data, offset_to_index) elif tag == structs.T_ColumnDef: return create_ColumnDef( data, offset_to_index) elif tag == structs.T_TableLikeClause: return create_TableLikeClause( data, offset_to_index) elif tag == structs.T_IndexElem: return create_IndexElem( data, offset_to_index) elif tag == structs.T_DefElem: return create_DefElem( data, offset_to_index) elif tag == structs.T_LockingClause: return create_LockingClause( data, offset_to_index) elif tag == structs.T_XmlSerialize: return create_XmlSerialize( data, offset_to_index) elif tag == structs.T_PartitionElem: return create_PartitionElem( data, offset_to_index) elif tag == structs.T_PartitionSpec: return create_PartitionSpec( data, offset_to_index) elif tag == structs.T_PartitionBoundSpec: return create_PartitionBoundSpec( data, offset_to_index) elif tag == structs.T_PartitionRangeDatum: return create_PartitionRangeDatum( data, offset_to_index) elif tag == structs.T_SinglePartitionSpec: return create_SinglePartitionSpec( data, offset_to_index) elif tag == structs.T_PartitionCmd: return create_PartitionCmd( data, offset_to_index) elif tag == structs.T_RangeTblEntry: return create_RangeTblEntry( data, offset_to_index) elif tag == structs.T_RTEPermissionInfo: return create_RTEPermissionInfo( data, offset_to_index) elif tag == structs.T_RangeTblFunction: return create_RangeTblFunction( data, offset_to_index) elif tag == structs.T_TableSampleClause: return create_TableSampleClause( data, offset_to_index) elif tag == structs.T_WithCheckOption: return create_WithCheckOption( data, offset_to_index) elif tag == structs.T_SortGroupClause: return create_SortGroupClause( data, offset_to_index) elif tag == structs.T_GroupingSet: return create_GroupingSet( data, offset_to_index) elif tag == structs.T_WindowClause: return create_WindowClause( data, offset_to_index) elif tag == structs.T_RowMarkClause: return create_RowMarkClause( data, offset_to_index) elif tag == structs.T_WithClause: return create_WithClause( data, offset_to_index) elif tag == structs.T_InferClause: return create_InferClause( data, offset_to_index) elif tag == structs.T_OnConflictClause: return create_OnConflictClause( data, offset_to_index) elif tag == structs.T_CTESearchClause: return create_CTESearchClause( data, offset_to_index) elif tag == structs.T_CTECycleClause: return create_CTECycleClause( data, offset_to_index) elif tag == structs.T_CommonTableExpr: return create_CommonTableExpr( data, offset_to_index) elif tag == structs.T_MergeWhenClause: return create_MergeWhenClause( data, offset_to_index) elif tag == structs.T_TriggerTransition: return create_TriggerTransition( data, offset_to_index) elif tag == structs.T_JsonOutput: return create_JsonOutput( data, offset_to_index) elif tag == structs.T_JsonArgument: return create_JsonArgument( data, offset_to_index) elif tag == structs.T_JsonFuncExpr: return create_JsonFuncExpr( data, offset_to_index) elif tag == structs.T_JsonTablePathSpec: return create_JsonTablePathSpec( data, offset_to_index) elif tag == structs.T_JsonTable: return create_JsonTable( data, offset_to_index) elif tag == structs.T_JsonTableColumn: return create_JsonTableColumn( data, offset_to_index) elif tag == structs.T_JsonKeyValue: return create_JsonKeyValue( data, offset_to_index) elif tag == structs.T_JsonParseExpr: return create_JsonParseExpr( data, offset_to_index) elif tag == structs.T_JsonScalarExpr: return create_JsonScalarExpr( data, offset_to_index) elif tag == structs.T_JsonSerializeExpr: return create_JsonSerializeExpr( data, offset_to_index) elif tag == structs.T_JsonObjectConstructor: return create_JsonObjectConstructor( data, offset_to_index) elif tag == structs.T_JsonArrayConstructor: return create_JsonArrayConstructor( data, offset_to_index) elif tag == structs.T_JsonArrayQueryConstructor: return create_JsonArrayQueryConstructor( data, offset_to_index) elif tag == structs.T_JsonAggConstructor: return create_JsonAggConstructor( data, offset_to_index) elif tag == structs.T_JsonObjectAgg: return create_JsonObjectAgg( data, offset_to_index) elif tag == structs.T_JsonArrayAgg: return create_JsonArrayAgg( data, offset_to_index) elif tag == structs.T_RawStmt: return create_RawStmt( data, offset_to_index) elif tag == structs.T_InsertStmt: return create_InsertStmt( data, offset_to_index) elif tag == structs.T_DeleteStmt: return create_DeleteStmt( data, offset_to_index) elif tag == structs.T_UpdateStmt: return create_UpdateStmt( data, offset_to_index) elif tag == structs.T_MergeStmt: return create_MergeStmt( data, offset_to_index) elif tag == structs.T_SelectStmt: return create_SelectStmt( data, offset_to_index) elif tag == structs.T_SetOperationStmt: return create_SetOperationStmt( data, offset_to_index) elif tag == structs.T_ReturnStmt: return create_ReturnStmt( data, offset_to_index) elif tag == structs.T_PLAssignStmt: return create_PLAssignStmt( data, offset_to_index) elif tag == structs.T_CreateSchemaStmt: return create_CreateSchemaStmt( data, offset_to_index) elif tag == structs.T_AlterTableStmt: return create_AlterTableStmt( data, offset_to_index) elif tag == structs.T_ReplicaIdentityStmt: return create_ReplicaIdentityStmt( data, offset_to_index) elif tag == structs.T_AlterTableCmd: return create_AlterTableCmd( data, offset_to_index) elif tag == structs.T_AlterCollationStmt: return create_AlterCollationStmt( data, offset_to_index) elif tag == structs.T_AlterDomainStmt: return create_AlterDomainStmt( data, offset_to_index) elif tag == structs.T_GrantStmt: return create_GrantStmt( data, offset_to_index) elif tag == structs.T_ObjectWithArgs: return create_ObjectWithArgs( data, offset_to_index) elif tag == structs.T_AccessPriv: return create_AccessPriv( data, offset_to_index) elif tag == structs.T_GrantRoleStmt: return create_GrantRoleStmt( data, offset_to_index) elif tag == structs.T_AlterDefaultPrivilegesStmt: return create_AlterDefaultPrivilegesStmt( data, offset_to_index) elif tag == structs.T_CopyStmt: return create_CopyStmt( data, offset_to_index) elif tag == structs.T_VariableSetStmt: return create_VariableSetStmt( data, offset_to_index) elif tag == structs.T_VariableShowStmt: return create_VariableShowStmt( data, offset_to_index) elif tag == structs.T_CreateStmt: return create_CreateStmt( data, offset_to_index) elif tag == structs.T_Constraint: return create_Constraint( data, offset_to_index) elif tag == structs.T_CreateTableSpaceStmt: return create_CreateTableSpaceStmt( data, offset_to_index) elif tag == structs.T_DropTableSpaceStmt: return create_DropTableSpaceStmt( data, offset_to_index) elif tag == structs.T_AlterTableSpaceOptionsStmt: return create_AlterTableSpaceOptionsStmt( data, offset_to_index) elif tag == structs.T_AlterTableMoveAllStmt: return create_AlterTableMoveAllStmt( data, offset_to_index) elif tag == structs.T_CreateExtensionStmt: return create_CreateExtensionStmt( data, offset_to_index) elif tag == structs.T_AlterExtensionStmt: return create_AlterExtensionStmt( data, offset_to_index) elif tag == structs.T_AlterExtensionContentsStmt: return create_AlterExtensionContentsStmt( data, offset_to_index) elif tag == structs.T_CreateFdwStmt: return create_CreateFdwStmt( data, offset_to_index) elif tag == structs.T_AlterFdwStmt: return create_AlterFdwStmt( data, offset_to_index) elif tag == structs.T_CreateForeignServerStmt: return create_CreateForeignServerStmt( data, offset_to_index) elif tag == structs.T_AlterForeignServerStmt: return create_AlterForeignServerStmt( data, offset_to_index) elif tag == structs.T_CreateForeignTableStmt: return create_CreateForeignTableStmt( data, offset_to_index) elif tag == structs.T_CreateUserMappingStmt: return create_CreateUserMappingStmt( data, offset_to_index) elif tag == structs.T_AlterUserMappingStmt: return create_AlterUserMappingStmt( data, offset_to_index) elif tag == structs.T_DropUserMappingStmt: return create_DropUserMappingStmt( data, offset_to_index) elif tag == structs.T_ImportForeignSchemaStmt: return create_ImportForeignSchemaStmt( data, offset_to_index) elif tag == structs.T_CreatePolicyStmt: return create_CreatePolicyStmt( data, offset_to_index) elif tag == structs.T_AlterPolicyStmt: return create_AlterPolicyStmt( data, offset_to_index) elif tag == structs.T_CreateAmStmt: return create_CreateAmStmt( data, offset_to_index) elif tag == structs.T_CreateTrigStmt: return create_CreateTrigStmt( data, offset_to_index) elif tag == structs.T_CreateEventTrigStmt: return create_CreateEventTrigStmt( data, offset_to_index) elif tag == structs.T_AlterEventTrigStmt: return create_AlterEventTrigStmt( data, offset_to_index) elif tag == structs.T_CreatePLangStmt: return create_CreatePLangStmt( data, offset_to_index) elif tag == structs.T_CreateRoleStmt: return create_CreateRoleStmt( data, offset_to_index) elif tag == structs.T_AlterRoleStmt: return create_AlterRoleStmt( data, offset_to_index) elif tag == structs.T_AlterRoleSetStmt: return create_AlterRoleSetStmt( data, offset_to_index) elif tag == structs.T_DropRoleStmt: return create_DropRoleStmt( data, offset_to_index) elif tag == structs.T_CreateSeqStmt: return create_CreateSeqStmt( data, offset_to_index) elif tag == structs.T_AlterSeqStmt: return create_AlterSeqStmt( data, offset_to_index) elif tag == structs.T_DefineStmt: return create_DefineStmt( data, offset_to_index) elif tag == structs.T_CreateDomainStmt: return create_CreateDomainStmt( data, offset_to_index) elif tag == structs.T_CreateOpClassStmt: return create_CreateOpClassStmt( data, offset_to_index) elif tag == structs.T_CreateOpClassItem: return create_CreateOpClassItem( data, offset_to_index) elif tag == structs.T_CreateOpFamilyStmt: return create_CreateOpFamilyStmt( data, offset_to_index) elif tag == structs.T_AlterOpFamilyStmt: return create_AlterOpFamilyStmt( data, offset_to_index) elif tag == structs.T_DropStmt: return create_DropStmt( data, offset_to_index) elif tag == structs.T_TruncateStmt: return create_TruncateStmt( data, offset_to_index) elif tag == structs.T_CommentStmt: return create_CommentStmt( data, offset_to_index) elif tag == structs.T_SecLabelStmt: return create_SecLabelStmt( data, offset_to_index) elif tag == structs.T_DeclareCursorStmt: return create_DeclareCursorStmt( data, offset_to_index) elif tag == structs.T_ClosePortalStmt: return create_ClosePortalStmt( data, offset_to_index) elif tag == structs.T_FetchStmt: return create_FetchStmt( data, offset_to_index) elif tag == structs.T_IndexStmt: return create_IndexStmt( data, offset_to_index) elif tag == structs.T_CreateStatsStmt: return create_CreateStatsStmt( data, offset_to_index) elif tag == structs.T_StatsElem: return create_StatsElem( data, offset_to_index) elif tag == structs.T_AlterStatsStmt: return create_AlterStatsStmt( data, offset_to_index) elif tag == structs.T_CreateFunctionStmt: return create_CreateFunctionStmt( data, offset_to_index) elif tag == structs.T_FunctionParameter: return create_FunctionParameter( data, offset_to_index) elif tag == structs.T_AlterFunctionStmt: return create_AlterFunctionStmt( data, offset_to_index) elif tag == structs.T_DoStmt: return create_DoStmt( data, offset_to_index) elif tag == structs.T_InlineCodeBlock: return create_InlineCodeBlock( data, offset_to_index) elif tag == structs.T_CallStmt: return create_CallStmt( data, offset_to_index) elif tag == structs.T_CallContext: return create_CallContext( data, offset_to_index) elif tag == structs.T_RenameStmt: return create_RenameStmt( data, offset_to_index) elif tag == structs.T_AlterObjectDependsStmt: return create_AlterObjectDependsStmt( data, offset_to_index) elif tag == structs.T_AlterObjectSchemaStmt: return create_AlterObjectSchemaStmt( data, offset_to_index) elif tag == structs.T_AlterOwnerStmt: return create_AlterOwnerStmt( data, offset_to_index) elif tag == structs.T_AlterOperatorStmt: return create_AlterOperatorStmt( data, offset_to_index) elif tag == structs.T_AlterTypeStmt: return create_AlterTypeStmt( data, offset_to_index) elif tag == structs.T_RuleStmt: return create_RuleStmt( data, offset_to_index) elif tag == structs.T_NotifyStmt: return create_NotifyStmt( data, offset_to_index) elif tag == structs.T_ListenStmt: return create_ListenStmt( data, offset_to_index) elif tag == structs.T_UnlistenStmt: return create_UnlistenStmt( data, offset_to_index) elif tag == structs.T_TransactionStmt: return create_TransactionStmt( data, offset_to_index) elif tag == structs.T_CompositeTypeStmt: return create_CompositeTypeStmt( data, offset_to_index) elif tag == structs.T_CreateEnumStmt: return create_CreateEnumStmt( data, offset_to_index) elif tag == structs.T_CreateRangeStmt: return create_CreateRangeStmt( data, offset_to_index) elif tag == structs.T_AlterEnumStmt: return create_AlterEnumStmt( data, offset_to_index) elif tag == structs.T_ViewStmt: return create_ViewStmt( data, offset_to_index) elif tag == structs.T_LoadStmt: return create_LoadStmt( data, offset_to_index) elif tag == structs.T_CreatedbStmt: return create_CreatedbStmt( data, offset_to_index) elif tag == structs.T_AlterDatabaseStmt: return create_AlterDatabaseStmt( data, offset_to_index) elif tag == structs.T_AlterDatabaseRefreshCollStmt: return create_AlterDatabaseRefreshCollStmt( data, offset_to_index) elif tag == structs.T_AlterDatabaseSetStmt: return create_AlterDatabaseSetStmt( data, offset_to_index) elif tag == structs.T_DropdbStmt: return create_DropdbStmt( data, offset_to_index) elif tag == structs.T_AlterSystemStmt: return create_AlterSystemStmt( data, offset_to_index) elif tag == structs.T_ClusterStmt: return create_ClusterStmt( data, offset_to_index) elif tag == structs.T_VacuumStmt: return create_VacuumStmt( data, offset_to_index) elif tag == structs.T_VacuumRelation: return create_VacuumRelation( data, offset_to_index) elif tag == structs.T_ExplainStmt: return create_ExplainStmt( data, offset_to_index) elif tag == structs.T_CreateTableAsStmt: return create_CreateTableAsStmt( data, offset_to_index) elif tag == structs.T_RefreshMatViewStmt: return create_RefreshMatViewStmt( data, offset_to_index) elif tag == structs.T_CheckPointStmt: return create_CheckPointStmt( data, offset_to_index) elif tag == structs.T_DiscardStmt: return create_DiscardStmt( data, offset_to_index) elif tag == structs.T_LockStmt: return create_LockStmt( data, offset_to_index) elif tag == structs.T_ConstraintsSetStmt: return create_ConstraintsSetStmt( data, offset_to_index) elif tag == structs.T_ReindexStmt: return create_ReindexStmt( data, offset_to_index) elif tag == structs.T_CreateConversionStmt: return create_CreateConversionStmt( data, offset_to_index) elif tag == structs.T_CreateCastStmt: return create_CreateCastStmt( data, offset_to_index) elif tag == structs.T_CreateTransformStmt: return create_CreateTransformStmt( data, offset_to_index) elif tag == structs.T_PrepareStmt: return create_PrepareStmt( data, offset_to_index) elif tag == structs.T_ExecuteStmt: return create_ExecuteStmt( data, offset_to_index) elif tag == structs.T_DeallocateStmt: return create_DeallocateStmt( data, offset_to_index) elif tag == structs.T_DropOwnedStmt: return create_DropOwnedStmt( data, offset_to_index) elif tag == structs.T_ReassignOwnedStmt: return create_ReassignOwnedStmt( data, offset_to_index) elif tag == structs.T_AlterTSDictionaryStmt: return create_AlterTSDictionaryStmt( data, offset_to_index) elif tag == structs.T_AlterTSConfigurationStmt: return create_AlterTSConfigurationStmt( data, offset_to_index) elif tag == structs.T_PublicationTable: return create_PublicationTable( data, offset_to_index) elif tag == structs.T_PublicationObjSpec: return create_PublicationObjSpec( data, offset_to_index) elif tag == structs.T_CreatePublicationStmt: return create_CreatePublicationStmt( data, offset_to_index) elif tag == structs.T_AlterPublicationStmt: return create_AlterPublicationStmt( data, offset_to_index) elif tag == structs.T_CreateSubscriptionStmt: return create_CreateSubscriptionStmt( data, offset_to_index) elif tag == structs.T_AlterSubscriptionStmt: return create_AlterSubscriptionStmt( data, offset_to_index) elif tag == structs.T_DropSubscriptionStmt: return create_DropSubscriptionStmt( data, offset_to_index) elif tag == structs.T_Integer: return create_Integer( data, offset_to_index) elif tag == structs.T_Float: return create_Float( data, offset_to_index) elif tag == structs.T_Boolean: return create_Boolean( data, offset_to_index) elif tag == structs.T_String: return create_String( data, offset_to_index) elif tag == structs.T_BitString: return create_BitString( data, offset_to_index) raise ValueError("Unhandled tag: %s" % tag) pglast-7.7/pglast/enums/000077500000000000000000000000001477366773500153335ustar00rootroot00000000000000pglast-7.7/pglast/enums/__init__.py000066400000000000000000000013541477366773500174470ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Enums used by the nodes # :Created: gio 03 ago 2017 17:08:26 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2024 Lele Gaifax # # include/catalog from .pg_am import * # noqa from .pg_attribute import * # noqa from .pg_class import * # noqa from .pg_trigger import * # noqa # include/nodes from .lockoptions import * # noqa from .nodes import * # noqa from .parsenodes import * # noqa from .primnodes import * # noqa # include/storage from .lockdefs import * # noqa # include/utils from .xml import * # noqa pglast-7.7/pglast/enums/lockdefs.py000066400000000000000000000012621477366773500175000ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from lockdefs.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass # #define-ed constants NoLock = 0 AccessShareLock = 1 RowShareLock = 2 RowExclusiveLock = 3 ShareUpdateExclusiveLock = 4 ShareLock = 5 ShareRowExclusiveLock = 6 ExclusiveLock = 7 AccessExclusiveLock = 8 MaxLockMode = 8 pglast-7.7/pglast/enums/lockoptions.py000066400000000000000000000015751477366773500202610ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from lockoptions.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass class LockClauseStrength(IntEnum): LCS_NONE = 0 LCS_FORKEYSHARE = auto() LCS_FORSHARE = auto() LCS_FORNOKEYUPDATE = auto() LCS_FORUPDATE = auto() class LockTupleMode(IntEnum): LockTupleKeyShare = 0 LockTupleShare = auto() LockTupleNoKeyExclusive = auto() LockTupleExclusive = auto() class LockWaitPolicy(IntEnum): LockWaitBlock = 0 LockWaitSkip = auto() LockWaitError = auto() pglast-7.7/pglast/enums/nodes.py000066400000000000000000000335151477366773500170240ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from nodes.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass class AggSplit(IntEnum): AGGSPLIT_SIMPLE = 0 AGGSPLIT_INITIAL_SERIAL = 0x02 | 0x04 AGGSPLIT_FINAL_DESERIAL = 0x01 | 0x08 class AggStrategy(IntEnum): AGG_PLAIN = 0 AGG_SORTED = auto() AGG_HASHED = auto() AGG_MIXED = auto() class CmdType(IntEnum): CMD_UNKNOWN = 0 CMD_SELECT = auto() CMD_UPDATE = auto() CMD_INSERT = auto() CMD_DELETE = auto() CMD_MERGE = auto() CMD_UTILITY = auto() CMD_NOTHING = auto() class JoinType(IntEnum): JOIN_INNER = 0 JOIN_LEFT = auto() JOIN_FULL = auto() JOIN_RIGHT = auto() JOIN_SEMI = auto() JOIN_ANTI = auto() JOIN_RIGHT_ANTI = auto() JOIN_UNIQUE_OUTER = auto() JOIN_UNIQUE_INNER = auto() class LimitOption(IntEnum): LIMIT_OPTION_DEFAULT = 0 LIMIT_OPTION_COUNT = auto() LIMIT_OPTION_WITH_TIES = auto() class NodeTag(IntEnum): T_Invalid = 0 T_List = 1 T_Alias = 2 T_RangeVar = 3 T_TableFunc = 4 T_IntoClause = 5 T_Var = 6 T_Const = 7 T_Param = 8 T_Aggref = 9 T_GroupingFunc = 10 T_WindowFunc = 11 T_WindowFuncRunCondition = 12 T_MergeSupportFunc = 13 T_SubscriptingRef = 14 T_FuncExpr = 15 T_NamedArgExpr = 16 T_OpExpr = 17 T_DistinctExpr = 18 T_NullIfExpr = 19 T_ScalarArrayOpExpr = 20 T_BoolExpr = 21 T_SubLink = 22 T_SubPlan = 23 T_AlternativeSubPlan = 24 T_FieldSelect = 25 T_FieldStore = 26 T_RelabelType = 27 T_CoerceViaIO = 28 T_ArrayCoerceExpr = 29 T_ConvertRowtypeExpr = 30 T_CollateExpr = 31 T_CaseExpr = 32 T_CaseWhen = 33 T_CaseTestExpr = 34 T_ArrayExpr = 35 T_RowExpr = 36 T_RowCompareExpr = 37 T_CoalesceExpr = 38 T_MinMaxExpr = 39 T_SQLValueFunction = 40 T_XmlExpr = 41 T_JsonFormat = 42 T_JsonReturning = 43 T_JsonValueExpr = 44 T_JsonConstructorExpr = 45 T_JsonIsPredicate = 46 T_JsonBehavior = 47 T_JsonExpr = 48 T_JsonTablePath = 49 T_JsonTablePathScan = 50 T_JsonTableSiblingJoin = 51 T_NullTest = 52 T_BooleanTest = 53 T_MergeAction = 54 T_CoerceToDomain = 55 T_CoerceToDomainValue = 56 T_SetToDefault = 57 T_CurrentOfExpr = 58 T_NextValueExpr = 59 T_InferenceElem = 60 T_TargetEntry = 61 T_RangeTblRef = 62 T_JoinExpr = 63 T_FromExpr = 64 T_OnConflictExpr = 65 T_Query = 66 T_TypeName = 67 T_ColumnRef = 68 T_ParamRef = 69 T_A_Expr = 70 T_A_Const = 71 T_TypeCast = 72 T_CollateClause = 73 T_RoleSpec = 74 T_FuncCall = 75 T_A_Star = 76 T_A_Indices = 77 T_A_Indirection = 78 T_A_ArrayExpr = 79 T_ResTarget = 80 T_MultiAssignRef = 81 T_SortBy = 82 T_WindowDef = 83 T_RangeSubselect = 84 T_RangeFunction = 85 T_RangeTableFunc = 86 T_RangeTableFuncCol = 87 T_RangeTableSample = 88 T_ColumnDef = 89 T_TableLikeClause = 90 T_IndexElem = 91 T_DefElem = 92 T_LockingClause = 93 T_XmlSerialize = 94 T_PartitionElem = 95 T_PartitionSpec = 96 T_PartitionBoundSpec = 97 T_PartitionRangeDatum = 98 T_SinglePartitionSpec = 99 T_PartitionCmd = 100 T_RangeTblEntry = 101 T_RTEPermissionInfo = 102 T_RangeTblFunction = 103 T_TableSampleClause = 104 T_WithCheckOption = 105 T_SortGroupClause = 106 T_GroupingSet = 107 T_WindowClause = 108 T_RowMarkClause = 109 T_WithClause = 110 T_InferClause = 111 T_OnConflictClause = 112 T_CTESearchClause = 113 T_CTECycleClause = 114 T_CommonTableExpr = 115 T_MergeWhenClause = 116 T_TriggerTransition = 117 T_JsonOutput = 118 T_JsonArgument = 119 T_JsonFuncExpr = 120 T_JsonTablePathSpec = 121 T_JsonTable = 122 T_JsonTableColumn = 123 T_JsonKeyValue = 124 T_JsonParseExpr = 125 T_JsonScalarExpr = 126 T_JsonSerializeExpr = 127 T_JsonObjectConstructor = 128 T_JsonArrayConstructor = 129 T_JsonArrayQueryConstructor = 130 T_JsonAggConstructor = 131 T_JsonObjectAgg = 132 T_JsonArrayAgg = 133 T_RawStmt = 134 T_InsertStmt = 135 T_DeleteStmt = 136 T_UpdateStmt = 137 T_MergeStmt = 138 T_SelectStmt = 139 T_SetOperationStmt = 140 T_ReturnStmt = 141 T_PLAssignStmt = 142 T_CreateSchemaStmt = 143 T_AlterTableStmt = 144 T_ReplicaIdentityStmt = 145 T_AlterTableCmd = 146 T_AlterCollationStmt = 147 T_AlterDomainStmt = 148 T_GrantStmt = 149 T_ObjectWithArgs = 150 T_AccessPriv = 151 T_GrantRoleStmt = 152 T_AlterDefaultPrivilegesStmt = 153 T_CopyStmt = 154 T_VariableSetStmt = 155 T_VariableShowStmt = 156 T_CreateStmt = 157 T_Constraint = 158 T_CreateTableSpaceStmt = 159 T_DropTableSpaceStmt = 160 T_AlterTableSpaceOptionsStmt = 161 T_AlterTableMoveAllStmt = 162 T_CreateExtensionStmt = 163 T_AlterExtensionStmt = 164 T_AlterExtensionContentsStmt = 165 T_CreateFdwStmt = 166 T_AlterFdwStmt = 167 T_CreateForeignServerStmt = 168 T_AlterForeignServerStmt = 169 T_CreateForeignTableStmt = 170 T_CreateUserMappingStmt = 171 T_AlterUserMappingStmt = 172 T_DropUserMappingStmt = 173 T_ImportForeignSchemaStmt = 174 T_CreatePolicyStmt = 175 T_AlterPolicyStmt = 176 T_CreateAmStmt = 177 T_CreateTrigStmt = 178 T_CreateEventTrigStmt = 179 T_AlterEventTrigStmt = 180 T_CreatePLangStmt = 181 T_CreateRoleStmt = 182 T_AlterRoleStmt = 183 T_AlterRoleSetStmt = 184 T_DropRoleStmt = 185 T_CreateSeqStmt = 186 T_AlterSeqStmt = 187 T_DefineStmt = 188 T_CreateDomainStmt = 189 T_CreateOpClassStmt = 190 T_CreateOpClassItem = 191 T_CreateOpFamilyStmt = 192 T_AlterOpFamilyStmt = 193 T_DropStmt = 194 T_TruncateStmt = 195 T_CommentStmt = 196 T_SecLabelStmt = 197 T_DeclareCursorStmt = 198 T_ClosePortalStmt = 199 T_FetchStmt = 200 T_IndexStmt = 201 T_CreateStatsStmt = 202 T_StatsElem = 203 T_AlterStatsStmt = 204 T_CreateFunctionStmt = 205 T_FunctionParameter = 206 T_AlterFunctionStmt = 207 T_DoStmt = 208 T_InlineCodeBlock = 209 T_CallStmt = 210 T_CallContext = 211 T_RenameStmt = 212 T_AlterObjectDependsStmt = 213 T_AlterObjectSchemaStmt = 214 T_AlterOwnerStmt = 215 T_AlterOperatorStmt = 216 T_AlterTypeStmt = 217 T_RuleStmt = 218 T_NotifyStmt = 219 T_ListenStmt = 220 T_UnlistenStmt = 221 T_TransactionStmt = 222 T_CompositeTypeStmt = 223 T_CreateEnumStmt = 224 T_CreateRangeStmt = 225 T_AlterEnumStmt = 226 T_ViewStmt = 227 T_LoadStmt = 228 T_CreatedbStmt = 229 T_AlterDatabaseStmt = 230 T_AlterDatabaseRefreshCollStmt = 231 T_AlterDatabaseSetStmt = 232 T_DropdbStmt = 233 T_AlterSystemStmt = 234 T_ClusterStmt = 235 T_VacuumStmt = 236 T_VacuumRelation = 237 T_ExplainStmt = 238 T_CreateTableAsStmt = 239 T_RefreshMatViewStmt = 240 T_CheckPointStmt = 241 T_DiscardStmt = 242 T_LockStmt = 243 T_ConstraintsSetStmt = 244 T_ReindexStmt = 245 T_CreateConversionStmt = 246 T_CreateCastStmt = 247 T_CreateTransformStmt = 248 T_PrepareStmt = 249 T_ExecuteStmt = 250 T_DeallocateStmt = 251 T_DropOwnedStmt = 252 T_ReassignOwnedStmt = 253 T_AlterTSDictionaryStmt = 254 T_AlterTSConfigurationStmt = 255 T_PublicationTable = 256 T_PublicationObjSpec = 257 T_CreatePublicationStmt = 258 T_AlterPublicationStmt = 259 T_CreateSubscriptionStmt = 260 T_AlterSubscriptionStmt = 261 T_DropSubscriptionStmt = 262 T_PlannerGlobal = 263 T_PlannerInfo = 264 T_RelOptInfo = 265 T_IndexOptInfo = 266 T_ForeignKeyOptInfo = 267 T_StatisticExtInfo = 268 T_JoinDomain = 269 T_EquivalenceClass = 270 T_EquivalenceMember = 271 T_PathKey = 272 T_GroupByOrdering = 273 T_PathTarget = 274 T_ParamPathInfo = 275 T_Path = 276 T_IndexPath = 277 T_IndexClause = 278 T_BitmapHeapPath = 279 T_BitmapAndPath = 280 T_BitmapOrPath = 281 T_TidPath = 282 T_TidRangePath = 283 T_SubqueryScanPath = 284 T_ForeignPath = 285 T_CustomPath = 286 T_AppendPath = 287 T_MergeAppendPath = 288 T_GroupResultPath = 289 T_MaterialPath = 290 T_MemoizePath = 291 T_UniquePath = 292 T_GatherPath = 293 T_GatherMergePath = 294 T_NestPath = 295 T_MergePath = 296 T_HashPath = 297 T_ProjectionPath = 298 T_ProjectSetPath = 299 T_SortPath = 300 T_IncrementalSortPath = 301 T_GroupPath = 302 T_UpperUniquePath = 303 T_AggPath = 304 T_GroupingSetData = 305 T_RollupData = 306 T_GroupingSetsPath = 307 T_MinMaxAggPath = 308 T_WindowAggPath = 309 T_SetOpPath = 310 T_RecursiveUnionPath = 311 T_LockRowsPath = 312 T_ModifyTablePath = 313 T_LimitPath = 314 T_RestrictInfo = 315 T_PlaceHolderVar = 316 T_SpecialJoinInfo = 317 T_OuterJoinClauseInfo = 318 T_AppendRelInfo = 319 T_RowIdentityVarInfo = 320 T_PlaceHolderInfo = 321 T_MinMaxAggInfo = 322 T_PlannerParamItem = 323 T_AggInfo = 324 T_AggTransInfo = 325 T_PlannedStmt = 326 T_Result = 327 T_ProjectSet = 328 T_ModifyTable = 329 T_Append = 330 T_MergeAppend = 331 T_RecursiveUnion = 332 T_BitmapAnd = 333 T_BitmapOr = 334 T_SeqScan = 335 T_SampleScan = 336 T_IndexScan = 337 T_IndexOnlyScan = 338 T_BitmapIndexScan = 339 T_BitmapHeapScan = 340 T_TidScan = 341 T_TidRangeScan = 342 T_SubqueryScan = 343 T_FunctionScan = 344 T_ValuesScan = 345 T_TableFuncScan = 346 T_CteScan = 347 T_NamedTuplestoreScan = 348 T_WorkTableScan = 349 T_ForeignScan = 350 T_CustomScan = 351 T_NestLoop = 352 T_NestLoopParam = 353 T_MergeJoin = 354 T_HashJoin = 355 T_Material = 356 T_Memoize = 357 T_Sort = 358 T_IncrementalSort = 359 T_Group = 360 T_Agg = 361 T_WindowAgg = 362 T_Unique = 363 T_Gather = 364 T_GatherMerge = 365 T_Hash = 366 T_SetOp = 367 T_LockRows = 368 T_Limit = 369 T_PlanRowMark = 370 T_PartitionPruneInfo = 371 T_PartitionedRelPruneInfo = 372 T_PartitionPruneStepOp = 373 T_PartitionPruneStepCombine = 374 T_PlanInvalItem = 375 T_ExprState = 376 T_IndexInfo = 377 T_ExprContext = 378 T_ReturnSetInfo = 379 T_ProjectionInfo = 380 T_JunkFilter = 381 T_OnConflictSetState = 382 T_MergeActionState = 383 T_ResultRelInfo = 384 T_EState = 385 T_WindowFuncExprState = 386 T_SetExprState = 387 T_SubPlanState = 388 T_DomainConstraintState = 389 T_ResultState = 390 T_ProjectSetState = 391 T_ModifyTableState = 392 T_AppendState = 393 T_MergeAppendState = 394 T_RecursiveUnionState = 395 T_BitmapAndState = 396 T_BitmapOrState = 397 T_ScanState = 398 T_SeqScanState = 399 T_SampleScanState = 400 T_IndexScanState = 401 T_IndexOnlyScanState = 402 T_BitmapIndexScanState = 403 T_BitmapHeapScanState = 404 T_TidScanState = 405 T_TidRangeScanState = 406 T_SubqueryScanState = 407 T_FunctionScanState = 408 T_ValuesScanState = 409 T_TableFuncScanState = 410 T_CteScanState = 411 T_NamedTuplestoreScanState = 412 T_WorkTableScanState = 413 T_ForeignScanState = 414 T_CustomScanState = 415 T_JoinState = 416 T_NestLoopState = 417 T_MergeJoinState = 418 T_HashJoinState = 419 T_MaterialState = 420 T_MemoizeState = 421 T_SortState = 422 T_IncrementalSortState = 423 T_GroupState = 424 T_AggState = 425 T_WindowAggState = 426 T_UniqueState = 427 T_GatherState = 428 T_GatherMergeState = 429 T_HashState = 430 T_SetOpState = 431 T_LockRowsState = 432 T_LimitState = 433 T_IndexAmRoutine = 434 T_TableAmRoutine = 435 T_TsmRoutine = 436 T_EventTriggerData = 437 T_TriggerData = 438 T_TupleTableSlot = 439 T_FdwRoutine = 440 T_Bitmapset = 441 T_ExtensibleNode = 442 T_ErrorSaveContext = 443 T_IdentifySystemCmd = 444 T_BaseBackupCmd = 445 T_CreateReplicationSlotCmd = 446 T_DropReplicationSlotCmd = 447 T_AlterReplicationSlotCmd = 448 T_StartReplicationCmd = 449 T_ReadReplicationSlotCmd = 450 T_TimeLineHistoryCmd = 451 T_UploadManifestCmd = 452 T_SupportRequestSimplify = 453 T_SupportRequestSelectivity = 454 T_SupportRequestCost = 455 T_SupportRequestRows = 456 T_SupportRequestIndexCondition = 457 T_SupportRequestWFuncMonotonic = 458 T_SupportRequestOptimizeWindowClause = 459 T_Integer = 460 T_Float = 461 T_Boolean = 462 T_String = 463 T_BitString = 464 T_ForeignKeyCacheInfo = 465 T_IntList = 466 T_OidList = 467 T_XidList = 468 T_AllocSetContext = 469 T_GenerationContext = 470 T_SlabContext = 471 T_BumpContext = 472 T_TIDBitmap = 473 T_WindowObjectData = 474 class OnConflictAction(IntEnum): ONCONFLICT_NONE = 0 ONCONFLICT_NOTHING = auto() ONCONFLICT_UPDATE = auto() class SetOpCmd(IntEnum): SETOPCMD_INTERSECT = 0 SETOPCMD_INTERSECT_ALL = auto() SETOPCMD_EXCEPT = auto() SETOPCMD_EXCEPT_ALL = auto() class SetOpStrategy(IntEnum): SETOP_SORTED = 0 SETOP_HASHED = auto() # #define-ed constants AGGSPLITOP_COMBINE = 0x01 AGGSPLITOP_SKIPFINAL = 0x02 AGGSPLITOP_SERIALIZE = 0x04 AGGSPLITOP_DESERIALIZE = 0x08 pglast-7.7/pglast/enums/parsenodes.py000066400000000000000000000300241477366773500200470ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from parsenodes.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass class A_Expr_Kind(IntEnum): AEXPR_OP = 0 AEXPR_OP_ANY = auto() AEXPR_OP_ALL = auto() AEXPR_DISTINCT = auto() AEXPR_NOT_DISTINCT = auto() AEXPR_NULLIF = auto() AEXPR_IN = auto() AEXPR_LIKE = auto() AEXPR_ILIKE = auto() AEXPR_SIMILAR = auto() AEXPR_BETWEEN = auto() AEXPR_NOT_BETWEEN = auto() AEXPR_BETWEEN_SYM = auto() AEXPR_NOT_BETWEEN_SYM = auto() class AlterPublicationAction(IntEnum): AP_AddObjects = 0 AP_DropObjects = auto() AP_SetObjects = auto() class AlterSubscriptionType(IntEnum): ALTER_SUBSCRIPTION_OPTIONS = 0 ALTER_SUBSCRIPTION_CONNECTION = auto() ALTER_SUBSCRIPTION_SET_PUBLICATION = auto() ALTER_SUBSCRIPTION_ADD_PUBLICATION = auto() ALTER_SUBSCRIPTION_DROP_PUBLICATION = auto() ALTER_SUBSCRIPTION_REFRESH = auto() ALTER_SUBSCRIPTION_ENABLED = auto() ALTER_SUBSCRIPTION_SKIP = auto() class AlterTSConfigType(IntEnum): ALTER_TSCONFIG_ADD_MAPPING = 0 ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN = auto() ALTER_TSCONFIG_REPLACE_DICT = auto() ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN = auto() ALTER_TSCONFIG_DROP_MAPPING = auto() class AlterTableType(IntEnum): AT_AddColumn = 0 AT_AddColumnToView = auto() AT_ColumnDefault = auto() AT_CookedColumnDefault = auto() AT_DropNotNull = auto() AT_SetNotNull = auto() AT_SetExpression = auto() AT_DropExpression = auto() AT_CheckNotNull = auto() AT_SetStatistics = auto() AT_SetOptions = auto() AT_ResetOptions = auto() AT_SetStorage = auto() AT_SetCompression = auto() AT_DropColumn = auto() AT_AddIndex = auto() AT_ReAddIndex = auto() AT_AddConstraint = auto() AT_ReAddConstraint = auto() AT_ReAddDomainConstraint = auto() AT_AlterConstraint = auto() AT_ValidateConstraint = auto() AT_AddIndexConstraint = auto() AT_DropConstraint = auto() AT_ReAddComment = auto() AT_AlterColumnType = auto() AT_AlterColumnGenericOptions = auto() AT_ChangeOwner = auto() AT_ClusterOn = auto() AT_DropCluster = auto() AT_SetLogged = auto() AT_SetUnLogged = auto() AT_DropOids = auto() AT_SetAccessMethod = auto() AT_SetTableSpace = auto() AT_SetRelOptions = auto() AT_ResetRelOptions = auto() AT_ReplaceRelOptions = auto() AT_EnableTrig = auto() AT_EnableAlwaysTrig = auto() AT_EnableReplicaTrig = auto() AT_DisableTrig = auto() AT_EnableTrigAll = auto() AT_DisableTrigAll = auto() AT_EnableTrigUser = auto() AT_DisableTrigUser = auto() AT_EnableRule = auto() AT_EnableAlwaysRule = auto() AT_EnableReplicaRule = auto() AT_DisableRule = auto() AT_AddInherit = auto() AT_DropInherit = auto() AT_AddOf = auto() AT_DropOf = auto() AT_ReplicaIdentity = auto() AT_EnableRowSecurity = auto() AT_DisableRowSecurity = auto() AT_ForceRowSecurity = auto() AT_NoForceRowSecurity = auto() AT_GenericOptions = auto() AT_AttachPartition = auto() AT_DetachPartition = auto() AT_DetachPartitionFinalize = auto() AT_AddIdentity = auto() AT_SetIdentity = auto() AT_DropIdentity = auto() AT_ReAddStatistics = auto() class CTEMaterialize(IntEnum): CTEMaterializeDefault = 0 CTEMaterializeAlways = auto() CTEMaterializeNever = auto() class ConstrType(IntEnum): CONSTR_NULL = 0 CONSTR_NOTNULL = auto() CONSTR_DEFAULT = auto() CONSTR_IDENTITY = auto() CONSTR_GENERATED = auto() CONSTR_CHECK = auto() CONSTR_PRIMARY = auto() CONSTR_UNIQUE = auto() CONSTR_EXCLUSION = auto() CONSTR_FOREIGN = auto() CONSTR_ATTR_DEFERRABLE = auto() CONSTR_ATTR_NOT_DEFERRABLE = auto() CONSTR_ATTR_DEFERRED = auto() CONSTR_ATTR_IMMEDIATE = auto() class DefElemAction(IntEnum): DEFELEM_UNSPEC = 0 DEFELEM_SET = auto() DEFELEM_ADD = auto() DEFELEM_DROP = auto() class DiscardMode(IntEnum): DISCARD_ALL = 0 DISCARD_PLANS = auto() DISCARD_SEQUENCES = auto() DISCARD_TEMP = auto() class DropBehavior(IntEnum): DROP_RESTRICT = 0 DROP_CASCADE = auto() class FetchDirection(IntEnum): FETCH_FORWARD = 0 FETCH_BACKWARD = auto() FETCH_ABSOLUTE = auto() FETCH_RELATIVE = auto() class FunctionParameterMode(StrEnum): FUNC_PARAM_IN = 'i' FUNC_PARAM_OUT = 'o' FUNC_PARAM_INOUT = 'b' FUNC_PARAM_VARIADIC = 'v' FUNC_PARAM_TABLE = 't' FUNC_PARAM_DEFAULT = 'd' class GrantTargetType(IntEnum): ACL_TARGET_OBJECT = 0 ACL_TARGET_ALL_IN_SCHEMA = auto() ACL_TARGET_DEFAULTS = auto() class GroupingSetKind(IntEnum): GROUPING_SET_EMPTY = 0 GROUPING_SET_SIMPLE = auto() GROUPING_SET_ROLLUP = auto() GROUPING_SET_CUBE = auto() GROUPING_SET_SETS = auto() class ImportForeignSchemaType(IntEnum): FDW_IMPORT_SCHEMA_ALL = 0 FDW_IMPORT_SCHEMA_LIMIT_TO = auto() FDW_IMPORT_SCHEMA_EXCEPT = auto() class JsonQuotes(IntEnum): JS_QUOTES_UNSPEC = 0 JS_QUOTES_KEEP = auto() JS_QUOTES_OMIT = auto() class JsonTableColumnType(IntEnum): JTC_FOR_ORDINALITY = 0 JTC_REGULAR = auto() JTC_EXISTS = auto() JTC_FORMATTED = auto() JTC_NESTED = auto() class ObjectType(IntEnum): OBJECT_ACCESS_METHOD = 0 OBJECT_AGGREGATE = auto() OBJECT_AMOP = auto() OBJECT_AMPROC = auto() OBJECT_ATTRIBUTE = auto() OBJECT_CAST = auto() OBJECT_COLUMN = auto() OBJECT_COLLATION = auto() OBJECT_CONVERSION = auto() OBJECT_DATABASE = auto() OBJECT_DEFAULT = auto() OBJECT_DEFACL = auto() OBJECT_DOMAIN = auto() OBJECT_DOMCONSTRAINT = auto() OBJECT_EVENT_TRIGGER = auto() OBJECT_EXTENSION = auto() OBJECT_FDW = auto() OBJECT_FOREIGN_SERVER = auto() OBJECT_FOREIGN_TABLE = auto() OBJECT_FUNCTION = auto() OBJECT_INDEX = auto() OBJECT_LANGUAGE = auto() OBJECT_LARGEOBJECT = auto() OBJECT_MATVIEW = auto() OBJECT_OPCLASS = auto() OBJECT_OPERATOR = auto() OBJECT_OPFAMILY = auto() OBJECT_PARAMETER_ACL = auto() OBJECT_POLICY = auto() OBJECT_PROCEDURE = auto() OBJECT_PUBLICATION = auto() OBJECT_PUBLICATION_NAMESPACE = auto() OBJECT_PUBLICATION_REL = auto() OBJECT_ROLE = auto() OBJECT_ROUTINE = auto() OBJECT_RULE = auto() OBJECT_SCHEMA = auto() OBJECT_SEQUENCE = auto() OBJECT_SUBSCRIPTION = auto() OBJECT_STATISTIC_EXT = auto() OBJECT_TABCONSTRAINT = auto() OBJECT_TABLE = auto() OBJECT_TABLESPACE = auto() OBJECT_TRANSFORM = auto() OBJECT_TRIGGER = auto() OBJECT_TSCONFIGURATION = auto() OBJECT_TSDICTIONARY = auto() OBJECT_TSPARSER = auto() OBJECT_TSTEMPLATE = auto() OBJECT_TYPE = auto() OBJECT_USER_MAPPING = auto() OBJECT_VIEW = auto() class PartitionRangeDatumKind(IntEnum): PARTITION_RANGE_DATUM_MINVALUE = -1 PARTITION_RANGE_DATUM_VALUE = 0 PARTITION_RANGE_DATUM_MAXVALUE = 1 class PartitionStrategy(StrEnum): PARTITION_STRATEGY_LIST = 'l' PARTITION_STRATEGY_RANGE = 'r' PARTITION_STRATEGY_HASH = 'h' class PublicationObjSpecType(IntEnum): PUBLICATIONOBJ_TABLE = 0 PUBLICATIONOBJ_TABLES_IN_SCHEMA = auto() PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA = auto() PUBLICATIONOBJ_CONTINUATION = auto() class QuerySource(IntEnum): QSRC_ORIGINAL = 0 QSRC_PARSER = auto() QSRC_INSTEAD_RULE = auto() QSRC_QUAL_INSTEAD_RULE = auto() QSRC_NON_INSTEAD_RULE = auto() class RTEKind(IntEnum): RTE_RELATION = 0 RTE_SUBQUERY = auto() RTE_JOIN = auto() RTE_FUNCTION = auto() RTE_TABLEFUNC = auto() RTE_VALUES = auto() RTE_CTE = auto() RTE_NAMEDTUPLESTORE = auto() RTE_RESULT = auto() class ReindexObjectType(IntEnum): REINDEX_OBJECT_INDEX = 0 REINDEX_OBJECT_TABLE = auto() REINDEX_OBJECT_SCHEMA = auto() REINDEX_OBJECT_SYSTEM = auto() REINDEX_OBJECT_DATABASE = auto() class RoleSpecType(IntEnum): ROLESPEC_CSTRING = 0 ROLESPEC_CURRENT_ROLE = auto() ROLESPEC_CURRENT_USER = auto() ROLESPEC_SESSION_USER = auto() ROLESPEC_PUBLIC = auto() class RoleStmtType(IntEnum): ROLESTMT_ROLE = 0 ROLESTMT_USER = auto() ROLESTMT_GROUP = auto() class SetOperation(IntEnum): SETOP_NONE = 0 SETOP_UNION = auto() SETOP_INTERSECT = auto() SETOP_EXCEPT = auto() class SetQuantifier(IntEnum): SET_QUANTIFIER_DEFAULT = 0 SET_QUANTIFIER_ALL = auto() SET_QUANTIFIER_DISTINCT = auto() class SortByDir(IntEnum): SORTBY_DEFAULT = 0 SORTBY_ASC = auto() SORTBY_DESC = auto() SORTBY_USING = auto() class SortByNulls(IntEnum): SORTBY_NULLS_DEFAULT = 0 SORTBY_NULLS_FIRST = auto() SORTBY_NULLS_LAST = auto() class TableLikeOption(IntFlag): CREATE_TABLE_LIKE_COMMENTS = 1 << 0 CREATE_TABLE_LIKE_COMPRESSION = 1 << 1 CREATE_TABLE_LIKE_CONSTRAINTS = 1 << 2 CREATE_TABLE_LIKE_DEFAULTS = 1 << 3 CREATE_TABLE_LIKE_GENERATED = 1 << 4 CREATE_TABLE_LIKE_IDENTITY = 1 << 5 CREATE_TABLE_LIKE_INDEXES = 1 << 6 CREATE_TABLE_LIKE_STATISTICS = 1 << 7 CREATE_TABLE_LIKE_STORAGE = 1 << 8 CREATE_TABLE_LIKE_ALL = 0x7FFFFFFF class TransactionStmtKind(IntEnum): TRANS_STMT_BEGIN = 0 TRANS_STMT_START = auto() TRANS_STMT_COMMIT = auto() TRANS_STMT_ROLLBACK = auto() TRANS_STMT_SAVEPOINT = auto() TRANS_STMT_RELEASE = auto() TRANS_STMT_ROLLBACK_TO = auto() TRANS_STMT_PREPARE = auto() TRANS_STMT_COMMIT_PREPARED = auto() TRANS_STMT_ROLLBACK_PREPARED = auto() class VariableSetKind(IntEnum): VAR_SET_VALUE = 0 VAR_SET_DEFAULT = auto() VAR_SET_CURRENT = auto() VAR_SET_MULTI = auto() VAR_RESET = auto() VAR_RESET_ALL = auto() class ViewCheckOption(IntEnum): NO_CHECK_OPTION = 0 LOCAL_CHECK_OPTION = auto() CASCADED_CHECK_OPTION = auto() class WCOKind(IntEnum): WCO_VIEW_CHECK = 0 WCO_RLS_INSERT_CHECK = auto() WCO_RLS_UPDATE_CHECK = auto() WCO_RLS_CONFLICT_CHECK = auto() WCO_RLS_MERGE_UPDATE_CHECK = auto() WCO_RLS_MERGE_DELETE_CHECK = auto() # #define-ed constants ACL_INSERT = 1<<0 ACL_SELECT = 1<<1 ACL_UPDATE = 1<<2 ACL_DELETE = 1<<3 ACL_TRUNCATE = 1<<4 ACL_REFERENCES = 1<<5 ACL_TRIGGER = 1<<6 ACL_EXECUTE = 1<<7 ACL_USAGE = 1<<8 ACL_CREATE = 1<<9 ACL_CREATE_TEMP = 1<<10 ACL_CONNECT = 1<<11 ACL_SET = 1<<12 ACL_ALTER_SYSTEM = 1<<13 ACL_MAINTAIN = 1<<14 N_ACL_RIGHTS = 15 ACL_NO_RIGHTS = 0 FRAMEOPTION_NONDEFAULT = 0x00001 FRAMEOPTION_RANGE = 0x00002 FRAMEOPTION_ROWS = 0x00004 FRAMEOPTION_GROUPS = 0x00008 FRAMEOPTION_BETWEEN = 0x00010 FRAMEOPTION_START_UNBOUNDED_PRECEDING = 0x00020 FRAMEOPTION_END_UNBOUNDED_PRECEDING = 0x00040 FRAMEOPTION_START_UNBOUNDED_FOLLOWING = 0x00080 FRAMEOPTION_END_UNBOUNDED_FOLLOWING = 0x00100 FRAMEOPTION_START_CURRENT_ROW = 0x00200 FRAMEOPTION_END_CURRENT_ROW = 0x00400 FRAMEOPTION_START_OFFSET_PRECEDING = 0x00800 FRAMEOPTION_END_OFFSET_PRECEDING = 0x01000 FRAMEOPTION_START_OFFSET_FOLLOWING = 0x02000 FRAMEOPTION_END_OFFSET_FOLLOWING = 0x04000 FRAMEOPTION_EXCLUDE_CURRENT_ROW = 0x08000 FRAMEOPTION_EXCLUDE_GROUP = 0x10000 FRAMEOPTION_EXCLUDE_TIES = 0x20000 FKCONSTR_ACTION_NOACTION = 'a' FKCONSTR_ACTION_RESTRICT = 'r' FKCONSTR_ACTION_CASCADE = 'c' FKCONSTR_ACTION_SETNULL = 'n' FKCONSTR_ACTION_SETDEFAULT = 'd' FKCONSTR_MATCH_FULL = 'f' FKCONSTR_MATCH_PARTIAL = 'p' FKCONSTR_MATCH_SIMPLE = 's' OPCLASS_ITEM_OPERATOR = 1 OPCLASS_ITEM_FUNCTION = 2 OPCLASS_ITEM_STORAGETYPE = 3 CURSOR_OPT_BINARY = 0x0001 CURSOR_OPT_SCROLL = 0x0002 CURSOR_OPT_NO_SCROLL = 0x0004 CURSOR_OPT_INSENSITIVE = 0x0008 CURSOR_OPT_ASENSITIVE = 0x0010 CURSOR_OPT_HOLD = 0x0020 CURSOR_OPT_FAST_PLAN = 0x0100 CURSOR_OPT_GENERIC_PLAN = 0x0200 CURSOR_OPT_CUSTOM_PLAN = 0x0400 CURSOR_OPT_PARALLEL_OK = 0x0800 pglast-7.7/pglast/enums/pg_am.py000066400000000000000000000010111477366773500167610ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from pg_am.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass # #define-ed constants AMTYPE_INDEX = 'i' AMTYPE_TABLE = 't' pglast-7.7/pglast/enums/pg_attribute.py000066400000000000000000000011201477366773500203700ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from pg_attribute.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass # #define-ed constants ATTRIBUTE_IDENTITY_ALWAYS = 'a' ATTRIBUTE_IDENTITY_BY_DEFAULT = 'd' ATTRIBUTE_GENERATED_STORED = 's' pglast-7.7/pglast/enums/pg_class.py000066400000000000000000000017001477366773500174760ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from pg_class.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass # #define-ed constants RELKIND_RELATION = 'r' RELKIND_INDEX = 'i' RELKIND_SEQUENCE = 'S' RELKIND_TOASTVALUE = 't' RELKIND_VIEW = 'v' RELKIND_MATVIEW = 'm' RELKIND_COMPOSITE_TYPE = 'c' RELKIND_FOREIGN_TABLE = 'f' RELKIND_PARTITIONED_TABLE = 'p' RELKIND_PARTITIONED_INDEX = 'I' RELPERSISTENCE_PERMANENT = 'p' RELPERSISTENCE_UNLOGGED = 'u' RELPERSISTENCE_TEMP = 't' REPLICA_IDENTITY_DEFAULT = 'd' REPLICA_IDENTITY_NOTHING = 'n' REPLICA_IDENTITY_FULL = 'f' REPLICA_IDENTITY_INDEX = 'i' pglast-7.7/pglast/enums/pg_trigger.py000066400000000000000000000013541477366773500200410ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from pg_trigger.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass # #define-ed constants TRIGGER_TYPE_ROW = 1 << 0 TRIGGER_TYPE_BEFORE = 1 << 1 TRIGGER_TYPE_INSERT = 1 << 2 TRIGGER_TYPE_DELETE = 1 << 3 TRIGGER_TYPE_UPDATE = 1 << 4 TRIGGER_TYPE_TRUNCATE = 1 << 5 TRIGGER_TYPE_INSTEAD = 1 << 6 TRIGGER_TYPE_STATEMENT = 0 TRIGGER_TYPE_AFTER = 0 pglast-7.7/pglast/enums/primnodes.py000066400000000000000000000103071477366773500177060ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from primnodes.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass class BoolExprType(IntEnum): AND_EXPR = 0 OR_EXPR = auto() NOT_EXPR = auto() class BoolTestType(IntEnum): IS_TRUE = 0 IS_NOT_TRUE = auto() IS_FALSE = auto() IS_NOT_FALSE = auto() IS_UNKNOWN = auto() IS_NOT_UNKNOWN = auto() class CoercionContext(IntEnum): COERCION_IMPLICIT = 0 COERCION_ASSIGNMENT = auto() COERCION_PLPGSQL = auto() COERCION_EXPLICIT = auto() class CoercionForm(IntEnum): COERCE_EXPLICIT_CALL = 0 COERCE_EXPLICIT_CAST = auto() COERCE_IMPLICIT_CAST = auto() COERCE_SQL_SYNTAX = auto() class JsonBehaviorType(IntEnum): JSON_BEHAVIOR_NULL = 0 JSON_BEHAVIOR_ERROR = auto() JSON_BEHAVIOR_EMPTY = auto() JSON_BEHAVIOR_TRUE = auto() JSON_BEHAVIOR_FALSE = auto() JSON_BEHAVIOR_UNKNOWN = auto() JSON_BEHAVIOR_EMPTY_ARRAY = auto() JSON_BEHAVIOR_EMPTY_OBJECT = auto() JSON_BEHAVIOR_DEFAULT = auto() class JsonConstructorType(IntEnum): JSCTOR_JSON_OBJECT = 1 JSCTOR_JSON_ARRAY = 2 JSCTOR_JSON_OBJECTAGG = 3 JSCTOR_JSON_ARRAYAGG = 4 JSCTOR_JSON_PARSE = 5 JSCTOR_JSON_SCALAR = 6 JSCTOR_JSON_SERIALIZE = 7 class JsonEncoding(IntEnum): JS_ENC_DEFAULT = 0 JS_ENC_UTF8 = auto() JS_ENC_UTF16 = auto() JS_ENC_UTF32 = auto() class JsonExprOp(IntEnum): JSON_EXISTS_OP = 0 JSON_QUERY_OP = auto() JSON_VALUE_OP = auto() JSON_TABLE_OP = auto() class JsonFormatType(IntEnum): JS_FORMAT_DEFAULT = 0 JS_FORMAT_JSON = auto() JS_FORMAT_JSONB = auto() class JsonValueType(IntEnum): JS_TYPE_ANY = 0 JS_TYPE_OBJECT = auto() JS_TYPE_ARRAY = auto() JS_TYPE_SCALAR = auto() class JsonWrapper(IntEnum): JSW_UNSPEC = 0 JSW_NONE = auto() JSW_CONDITIONAL = auto() JSW_UNCONDITIONAL = auto() class MergeMatchKind(IntEnum): MERGE_WHEN_MATCHED = 0 MERGE_WHEN_NOT_MATCHED_BY_SOURCE = auto() MERGE_WHEN_NOT_MATCHED_BY_TARGET = auto() class MinMaxOp(IntEnum): IS_GREATEST = 0 IS_LEAST = auto() class NullTestType(IntEnum): IS_NULL = 0 IS_NOT_NULL = auto() class OnCommitAction(IntEnum): ONCOMMIT_NOOP = 0 ONCOMMIT_PRESERVE_ROWS = auto() ONCOMMIT_DELETE_ROWS = auto() ONCOMMIT_DROP = auto() class OverridingKind(IntEnum): OVERRIDING_NOT_SET = 0 OVERRIDING_USER_VALUE = auto() OVERRIDING_SYSTEM_VALUE = auto() class ParamKind(IntEnum): PARAM_EXTERN = 0 PARAM_EXEC = auto() PARAM_SUBLINK = auto() PARAM_MULTIEXPR = auto() class RowCompareType(IntEnum): ROWCOMPARE_LT = 1 ROWCOMPARE_LE = 2 ROWCOMPARE_EQ = 3 ROWCOMPARE_GE = 4 ROWCOMPARE_GT = 5 ROWCOMPARE_NE = 6 class SQLValueFunctionOp(IntEnum): SVFOP_CURRENT_DATE = 0 SVFOP_CURRENT_TIME = auto() SVFOP_CURRENT_TIME_N = auto() SVFOP_CURRENT_TIMESTAMP = auto() SVFOP_CURRENT_TIMESTAMP_N = auto() SVFOP_LOCALTIME = auto() SVFOP_LOCALTIME_N = auto() SVFOP_LOCALTIMESTAMP = auto() SVFOP_LOCALTIMESTAMP_N = auto() SVFOP_CURRENT_ROLE = auto() SVFOP_CURRENT_USER = auto() SVFOP_USER = auto() SVFOP_SESSION_USER = auto() SVFOP_CURRENT_CATALOG = auto() SVFOP_CURRENT_SCHEMA = auto() class SubLinkType(IntEnum): EXISTS_SUBLINK = 0 ALL_SUBLINK = auto() ANY_SUBLINK = auto() ROWCOMPARE_SUBLINK = auto() EXPR_SUBLINK = auto() MULTIEXPR_SUBLINK = auto() ARRAY_SUBLINK = auto() CTE_SUBLINK = auto() class TableFuncType(IntEnum): TFT_XMLTABLE = 0 TFT_JSON_TABLE = auto() class XmlExprOp(IntEnum): IS_XMLCONCAT = 0 IS_XMLELEMENT = auto() IS_XMLFOREST = auto() IS_XMLPARSE = auto() IS_XMLPI = auto() IS_XMLROOT = auto() IS_XMLSERIALIZE = auto() IS_DOCUMENT = auto() class XmlOptionType(IntEnum): XMLOPTION_DOCUMENT = 0 XMLOPTION_CONTENT = auto() pglast-7.7/pglast/enums/xml.py000066400000000000000000000015211477366773500165040ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from xml.h @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass class PgXmlStrictness(IntEnum): PG_XML_STRICTNESS_LEGACY = 0 PG_XML_STRICTNESS_WELLFORMED = auto() PG_XML_STRICTNESS_ALL = auto() class XmlBinaryType(IntEnum): XMLBINARY_BASE64 = 0 XMLBINARY_HEX = auto() class XmlStandaloneType(IntEnum): XML_STANDALONE_YES = 0 XML_STANDALONE_NO = auto() XML_STANDALONE_NO_VALUE = auto() XML_STANDALONE_OMITTED = auto() pglast-7.7/pglast/error.py000066400000000000000000000005241477366773500157100ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Top level error exception class # :Created: mer 02 ago 2017 15:35:39 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2024 Lele Gaifax # class Error(Exception): "Top level error exception." pglast-7.7/pglast/keywords.py000066400000000000000000000162011477366773500164250ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from kwlist.h @ 17.4 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2025 Lele Gaifax # COL_NAME_KEYWORDS = {'between', 'bigint', 'bit', 'boolean', 'char', 'character', 'coalesce', 'dec', 'decimal', 'exists', 'extract', 'float', 'greatest', 'grouping', 'inout', 'int', 'integer', 'interval', 'json', 'json_array', 'json_arrayagg', 'json_exists', 'json_object', 'json_objectagg', 'json_query', 'json_scalar', 'json_serialize', 'json_table', 'json_value', 'least', 'merge_action', 'national', 'nchar', 'none', 'normalize', 'nullif', 'numeric', 'out', 'overlay', 'position', 'precision', 'real', 'row', 'setof', 'smallint', 'substring', 'time', 'timestamp', 'treat', 'trim', 'values', 'varchar', 'xmlattributes', 'xmlconcat', 'xmlelement', 'xmlexists', 'xmlforest', 'xmlnamespaces', 'xmlparse', 'xmlpi', 'xmlroot', 'xmlserialize', 'xmltable'} RESERVED_KEYWORDS = {'all', 'analyse', 'analyze', 'and', 'any', 'array', 'as', 'asc', 'asymmetric', 'both', 'case', 'cast', 'check', 'collate', 'column', 'constraint', 'create', 'current_catalog', 'current_date', 'current_role', 'current_time', 'current_timestamp', 'current_user', 'default', 'deferrable', 'desc', 'distinct', 'do', 'else', 'end', 'except', 'false', 'fetch', 'for', 'foreign', 'from', 'grant', 'group', 'having', 'in', 'initially', 'intersect', 'into', 'lateral', 'leading', 'limit', 'localtime', 'localtimestamp', 'not', 'null', 'offset', 'on', 'only', 'or', 'order', 'placing', 'primary', 'references', 'returning', 'select', 'session_user', 'some', 'symmetric', 'system_user', 'table', 'then', 'to', 'trailing', 'true', 'union', 'unique', 'user', 'using', 'variadic', 'when', 'where', 'window', 'with'} TYPE_FUNC_NAME_KEYWORDS = {'authorization', 'binary', 'collation', 'concurrently', 'cross', 'current_schema', 'freeze', 'full', 'ilike', 'inner', 'is', 'isnull', 'join', 'left', 'like', 'natural', 'notnull', 'outer', 'overlaps', 'right', 'similar', 'tablesample', 'verbose'} UNRESERVED_KEYWORDS = {'abort', 'absent', 'absolute', 'access', 'action', 'add', 'admin', 'after', 'aggregate', 'also', 'alter', 'always', 'asensitive', 'assertion', 'assignment', 'at', 'atomic', 'attach', 'attribute', 'backward', 'before', 'begin', 'breadth', 'by', 'cache', 'call', 'called', 'cascade', 'cascaded', 'catalog', 'chain', 'characteristics', 'checkpoint', 'class', 'close', 'cluster', 'columns', 'comment', 'comments', 'commit', 'committed', 'compression', 'conditional', 'configuration', 'conflict', 'connection', 'constraints', 'content', 'continue', 'conversion', 'copy', 'cost', 'csv', 'cube', 'current', 'cursor', 'cycle', 'data', 'database', 'day', 'deallocate', 'declare', 'defaults', 'deferred', 'definer', 'delete', 'delimiter', 'delimiters', 'depends', 'depth', 'detach', 'dictionary', 'disable', 'discard', 'document', 'domain', 'double', 'drop', 'each', 'empty', 'enable', 'encoding', 'encrypted', 'enum', 'error', 'escape', 'event', 'exclude', 'excluding', 'exclusive', 'execute', 'explain', 'expression', 'extension', 'external', 'family', 'filter', 'finalize', 'first', 'following', 'force', 'format', 'forward', 'function', 'functions', 'generated', 'global', 'granted', 'groups', 'handler', 'header', 'hold', 'hour', 'identity', 'if', 'immediate', 'immutable', 'implicit', 'import', 'include', 'including', 'increment', 'indent', 'index', 'indexes', 'inherit', 'inherits', 'inline', 'input', 'insensitive', 'insert', 'instead', 'invoker', 'isolation', 'keep', 'key', 'keys', 'label', 'language', 'large', 'last', 'leakproof', 'level', 'listen', 'load', 'local', 'location', 'lock', 'locked', 'logged', 'mapping', 'match', 'matched', 'materialized', 'maxvalue', 'merge', 'method', 'minute', 'minvalue', 'mode', 'month', 'move', 'name', 'names', 'nested', 'new', 'next', 'nfc', 'nfd', 'nfkc', 'nfkd', 'no', 'normalized', 'nothing', 'notify', 'nowait', 'nulls', 'object', 'of', 'off', 'oids', 'old', 'omit', 'operator', 'option', 'options', 'ordinality', 'others', 'over', 'overriding', 'owned', 'owner', 'parallel', 'parameter', 'parser', 'partial', 'partition', 'passing', 'password', 'path', 'plan', 'plans', 'policy', 'preceding', 'prepare', 'prepared', 'preserve', 'prior', 'privileges', 'procedural', 'procedure', 'procedures', 'program', 'publication', 'quote', 'quotes', 'range', 'read', 'reassign', 'recheck', 'recursive', 'ref', 'referencing', 'refresh', 'reindex', 'relative', 'release', 'rename', 'repeatable', 'replace', 'replica', 'reset', 'restart', 'restrict', 'return', 'returns', 'revoke', 'role', 'rollback', 'rollup', 'routine', 'routines', 'rows', 'rule', 'savepoint', 'scalar', 'schema', 'schemas', 'scroll', 'search', 'second', 'security', 'sequence', 'sequences', 'serializable', 'server', 'session', 'set', 'sets', 'share', 'show', 'simple', 'skip', 'snapshot', 'source', 'sql', 'stable', 'standalone', 'start', 'statement', 'statistics', 'stdin', 'stdout', 'storage', 'stored', 'strict', 'string', 'strip', 'subscription', 'support', 'sysid', 'system', 'tables', 'tablespace', 'target', 'temp', 'template', 'temporary', 'text', 'ties', 'transaction', 'transform', 'trigger', 'truncate', 'trusted', 'type', 'types', 'uescape', 'unbounded', 'uncommitted', 'unconditional', 'unencrypted', 'unknown', 'unlisten', 'unlogged', 'until', 'update', 'vacuum', 'valid', 'validate', 'validator', 'value', 'varying', 'version', 'view', 'views', 'volatile', 'whitespace', 'within', 'without', 'work', 'wrapper', 'write', 'xml', 'year', 'yes', 'zone'} pglast-7.7/pglast/parser.c000066400000000000000000152717011477366773500156620ustar00rootroot00000000000000/* Generated by Cython 3.0.12 */ #include "postgres.h" #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #if defined(CYTHON_LIMITED_API) && 0 #ifndef Py_LIMITED_API #if CYTHON_LIMITED_API+0 > 0x03030000 #define Py_LIMITED_API CYTHON_LIMITED_API #else #define Py_LIMITED_API 0x03030000 #endif #endif #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.7+ or Python 3.3+. #else #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API #define __PYX_EXTRA_ABI_MODULE_NAME "limited" #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." #define CYTHON_HEX_VERSION 0x03000CF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #define HAVE_LONG_LONG #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX #if defined(GRAALVM_PYTHON) /* For very preliminary testing purposes. Most variables are set the same as PyPy. The existence of this section does not imply that anything works or is even tested */ #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API #endif #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #endif #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 1 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL 1 #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 #define CYTHON_COMPILING_IN_NOGIL 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_GIL #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif #if PY_VERSION_HEX < 0x030400a1 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif !defined(CYTHON_USE_TP_FINALIZE) #define CYTHON_USE_TP_FINALIZE 1 #endif #if PY_VERSION_HEX < 0x030600B1 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) #endif #if PY_VERSION_HEX < 0x030700A3 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif !defined(CYTHON_USE_EXC_INFO_STACK) #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 1 #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if !defined(CYTHON_VECTORCALL) #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS #if PY_MAJOR_VERSION < 3 #include "longintrepr.h" #endif #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED #if defined(__cplusplus) /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(maybe_unused) #define CYTHON_UNUSED [[maybe_unused]] #endif #endif #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_UNUSED_VAR( const T& ) { } # else # define CYTHON_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #ifndef CYTHON_USE_CPP_STD_MOVE #if defined(__cplusplus) && (\ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) #define CYTHON_USE_CPP_STD_MOVE 1 #else #define CYTHON_USE_CPP_STD_MOVE 0 #endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif #endif #if _MSC_VER < 1300 #ifdef _WIN64 typedef unsigned long long __pyx_uintptr_t; #else typedef unsigned int __pyx_uintptr_t; #endif #else #ifdef _WIN64 typedef unsigned __int64 __pyx_uintptr_t; #else typedef unsigned __int32 __pyx_uintptr_t; #endif #endif #else #include typedef uintptr_t __pyx_uintptr_t; #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 * but leads to warnings with -pedantic, since it is a C++17 feature */ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) #else #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) #endif #if CYTHON_COMPILING_IN_PYPY == 1 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) #else #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_DefaultClassType PyClass_Type #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 PyObject *version_info; PyObject *py_minor_version = NULL; #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; if (minor_version <= 7) { (void)p; result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else if (minor_version <= 10) { result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, fline, lnos, fv, cell); } else { if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } end: Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); if (type) { PyErr_Restore(type, value, traceback); } return result; } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif #ifndef CO_NEWLOCALS #define CO_NEWLOCALS 0x0002 #endif #ifndef CO_VARARGS #define CO_VARARGS 0x0004 #endif #ifndef CO_VARKEYWORDS #define CO_VARKEYWORDS 0x0008 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x0200 #endif #ifndef CO_GENERATOR #define CO_GENERATOR 0x0020 #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif #elif PY_VERSION_HEX >= 0x030B0000 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, PyObject *code, PyObject *c, PyObject* n, PyObject *v, PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 PyUnstable_Code_NewWithPosOnlyArgs #else PyCode_NewWithPosOnlyArgs #endif (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); Py_DECREF(empty_bytes); return result; } #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) #define __Pyx_Py_Is(x, y) Py_Is(x, y) #else #define __Pyx_Py_Is(x, y) ((x) == (y)) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) #else #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) #else #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) #endif #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) #else #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) #endif #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif #ifndef CO_COROUTINE #define CO_COROUTINE 0x80 #endif #ifndef CO_ASYNC_GENERATOR #define CO_ASYNC_GENERATOR 0x200 #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef Py_TPFLAGS_SEQUENCE #define Py_TPFLAGS_SEQUENCE 0 #endif #ifndef Py_TPFLAGS_MAPPING #define Py_TPFLAGS_MAPPING 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #if PY_VERSION_HEX >= 0x030d00A4 # define __Pyx_PyCFunctionFast PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords #else # define __Pyx_PyCFunctionFast _PyCFunctionFast # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords #else #define __Pyx_METH_FASTCALL METH_VARARGS #define __Pyx_PyCFunction_FastCall PyCFunction #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords #endif #if CYTHON_VECTORCALL #define __pyx_vectorcallfunc vectorcallfunc #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) #elif CYTHON_BACKPORT_VECTORCALL typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames); #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) #else #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif #if PY_MAJOR_VERSION >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) #endif #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) #elif !CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) #if __PYX_LIMITED_VERSION_HEX < 0x030900B1 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) #define __Pyx_PyCMethod PyCMethod #endif #ifndef METH_METHOD #define METH_METHOD 0x200 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyThreadState_Current PyThreadState_Get() #elif !CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); if (!result) Py_FatalError("Couldn't find the module state"); return result; } #endif #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) #else #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if PY_MAJOR_VERSION < 3 #if CYTHON_COMPILING_IN_PYPY #if PYPY_VERSION_NUM < 0x07030600 #if defined(__cplusplus) && __cplusplus >= 201402L [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] #elif defined(__GNUC__) || defined(__clang__) __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) #elif defined(_MSC_VER) __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) #endif static CYTHON_INLINE int PyGILState_Check(void) { return 0; } #else // PYPY_VERSION_NUM < 0x07030600 #endif // PYPY_VERSION_NUM < 0x07030600 #else static CYTHON_INLINE int PyGILState_Check(void) { PyThreadState * tstate = _PyThreadState_Current; return tstate && (tstate == PyGILState_GetThisThreadState()); } #endif #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { #if CYTHON_COMPILING_IN_PYPY return PyDict_GetItem(dict, name); #else PyDictEntry *ep; PyDictObject *mp = (PyDictObject*) dict; long hash = ((PyStringObject *) name)->ob_shash; assert(hash != -1); ep = (mp->ma_lookup)(mp, name, hash); if (ep == NULL) { return NULL; } return ep->me_value; #endif } #define __Pyx_PyDict_GetItemStr PyDict_GetItem #endif #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next #endif #if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) #else #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ } #else #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #else #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) #undef PyUnicode_Contains #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) #else #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) #else #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { PyObject *module = PyImport_AddModule(name); Py_XINCREF(module); return module; } #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define __Pyx_Py3Int_Check(op) PyLong_Check(op) #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #else #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) #if !defined(_USE_MATH_DEFINES) #define _USE_MATH_DEFINES #endif #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifdef CYTHON_EXTERN_C #undef __PYX_EXTERN_C #define __PYX_EXTERN_C CYTHON_EXTERN_C #elif defined(__PYX_EXTERN_C) #ifdef _MSC_VER #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") #else #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. #endif #else #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pglast__parser #define __PYX_HAVE_API__pglast__parser /* Early includes */ #include "nodes/bitmapset.h" #include "nodes/nodes.h" #include "nodes/pg_list.h" #include "nodes/value.h" #include #include "nodes/parsenodes.h" #include "nodes/primnodes.h" #include #include #include #include "pg_query.h" #include "src/pg_query_internal.h" #include "protobuf-c/protobuf-c.h" #include "protobuf/pg_query.pb-c.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK #define _PyLong_SIGN_MASK 3 #endif #ifndef _PyLong_NON_SIZE_BITS #define _PyLong_NON_SIZE_BITS 3 #endif #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_SignedDigitCount(x)\ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) #else #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) #define __Pyx_PyLong_CompactValue(x)\ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) typedef sdigit __Pyx_compact_pylong; typedef digit __Pyx_compact_upylong; #endif #if PY_VERSION_HEX >= 0x030C00A5 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) #else #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII #include static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = (char) c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #include static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { "pglast/ast.pyx", "pglast/parser.pyx", "", "env/lib/python3.13/site-packages/Cython/Includes/cpython/type.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ struct __pyx_obj_6pglast_6parser_Displacements; union __pyx_t_6pglast_7structs_ValUnion; typedef union __pyx_t_6pglast_7structs_ValUnion __pyx_t_6pglast_7structs_ValUnion; /* "structs.pxd":68 * * # ValUnion is a private type of the A_Const node, we need to redefine it here * ctypedef union ValUnion: # <<<<<<<<<<<<<< * Node node * Integer ival */ union __pyx_t_6pglast_7structs_ValUnion { Node node; Integer ival; Float fval; Boolean boolval; String sval; BitString bsval; }; /* "pglast/parser.pyx":177 * * * cdef class Displacements: # <<<<<<<<<<<<<< * """ * Helper class used to find the index of Unicode character from its offset in the */ struct __pyx_obj_6pglast_6parser_Displacements { PyObject_HEAD PyObject *displacements; unsigned long max_offset; }; /* #### Code section: utility_code_proto ### */ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, Py_ssize_t); void (*DECREF)(void*, PyObject*, Py_ssize_t); void (*GOTREF)(void*, PyObject*, Py_ssize_t); void (*GIVEREF)(void*, PyObject*, Py_ssize_t); void* (*SetupContext)(const char*, Py_ssize_t, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ } #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() #endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContextNogil() #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_Py_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; Py_XDECREF(tmp);\ } while (0) #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #if PY_VERSION_HEX >= 0x030C00A6 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) #else #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) #endif #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif #endif #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); /* RaiseUnexpectedTypeError.proto */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* IncludeStringH.proto */ #include /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) #elif CYTHON_ASSUME_SAFE_MACROS #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) #else #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) #endif #if CYTHON_AVOID_BORROWED_REFS #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else #define __Pyx_Arg_NewRef_VARARGS(arg) arg #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs to have the same reference counting */ #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #elif PY_MAJOR_VERSION < 3 #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\ PyObject_Format(s, f)) #else #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) #endif /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* unicode_iter.proto */ static CYTHON_INLINE int __Pyx_init_unicode_iteration( PyObject* ustring, Py_ssize_t *length, void** data, int *kind); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 L->ob_item[len] = x; #else PyList_SET_ITEM(list, len, x); #endif __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* IncludeStructmemberH.proto */ #include /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); #endif /* PyObjectCallNoArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); #endif /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 #define __PYX_HAVE_RT_ImportType_proto_3_0_12 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) #else #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) #endif enum __Pyx_ImportType_CheckSize_3_0_12 { __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 }; static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); #endif /* Py3UpdateBases.proto */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); /* FetchCommonType.proto */ #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); #else static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif /* PyMethodNew.proto */ #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); typesModule = PyImport_ImportModule("types"); if (!typesModule) return NULL; methodType = PyObject_GetAttrString(typesModule, "MethodType"); Py_DECREF(typesModule); if (!methodType) return NULL; result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); Py_DECREF(methodType); return result; } #elif PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { CYTHON_UNUSED_VAR(typ); if (!self) return __Pyx_NewRef(func); return PyMethod_New(func, self); } #else #define __Pyx_PyMethod_New PyMethod_New #endif /* PyVectorcallFastCallDict.proto */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CYFUNCTION_COROUTINE 0x08 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #else #define __Pyx_CyFunction_GetClassObj(f)\ ((PyObject*) ((PyCMethodObject *) (f))->mm_class) #endif #define __Pyx_CyFunction_SetClassObj(f, classobj)\ __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { #if CYTHON_COMPILING_IN_LIMITED_API PyObject_HEAD PyObject *func; #elif PY_VERSION_HEX < 0x030900B1 PyCFunctionObject func; #else PyCMethodObject func; #endif #if CYTHON_BACKPORT_VECTORCALL __pyx_vectorcallfunc func_vectorcall; #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif void *defaults; int defaults_pyobjects; size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(PyObject *module); #if CYTHON_METH_FASTCALL static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); #if CYTHON_BACKPORT_VECTORCALL #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) #endif #endif /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* PyObjectCall2Args.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1) static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error); #else #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n) #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ #if !CYTHON_COMPILING_IN_LIMITED_API typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); #endif /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* GCCDiagnostics.proto */ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif static PyObject* __pyx_convert__to_py_Node(Node s); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CmdType(CmdType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_QuerySource(QuerySource value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_bool(bool value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_OverridingKind(OverridingKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_LimitOption(LimitOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ParseLoc(ParseLoc value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_A_Expr_Kind(A_Expr_Kind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RoleSpecType(RoleSpecType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CoercionForm(CoercionForm value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SortByDir(SortByDir value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SortByNulls(SortByNulls value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DefElemAction(DefElemAction value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_LockClauseStrength(LockClauseStrength value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_LockWaitPolicy(LockWaitPolicy value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_XmlOptionType(XmlOptionType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PartitionStrategy(PartitionStrategy value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PartitionRangeDatumKind(PartitionRangeDatumKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RTEKind(RTEKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JoinType(JoinType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_WCOKind(WCOKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GroupingSetKind(GroupingSetKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_OnConflictAction(OnConflictAction value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CTEMaterialize(CTEMaterialize value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MergeMatchKind(MergeMatchKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonExprOp(JsonExprOp value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonWrapper(JsonWrapper value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonQuotes(JsonQuotes value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonTableColumnType(JsonTableColumnType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SetOperation(SetOperation value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ObjectType(ObjectType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterTableType(AlterTableType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DropBehavior(DropBehavior value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GrantTargetType(GrantTargetType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VariableSetKind(VariableSetKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_OnCommitAction(OnCommitAction value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ConstrType(ConstrType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ImportForeignSchemaType(ImportForeignSchemaType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RoleStmtType(RoleStmtType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_FetchDirection(FetchDirection value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_FunctionParameterMode(FunctionParameterMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TransactionStmtKind(TransactionStmtKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ViewCheckOption(ViewCheckOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DiscardMode(DiscardMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ReindexObjectType(ReindexObjectType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CoercionContext(CoercionContext value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterTSConfigType(AlterTSConfigType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PublicationObjSpecType(PublicationObjSpecType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterPublicationAction(AlterPublicationAction value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterSubscriptionType(AlterSubscriptionType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TableFuncType(TableFuncType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ParamKind(ParamKind value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AggSplit(AggSplit value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_BoolExprType(BoolExprType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SubLinkType(SubLinkType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RowCompareType(RowCompareType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MinMaxOp(MinMaxOp value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SQLValueFunctionOp(SQLValueFunctionOp value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_XmlExprOp(XmlExprOp value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonFormatType(JsonFormatType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonEncoding(JsonEncoding value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonConstructorType(JsonConstructorType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonValueType(JsonValueType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonBehaviorType(JsonBehaviorType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NullTestType(NullTestType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_BoolTestType(BoolTestType value); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) #else typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" #define __Pyx_PyType_GetName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* #### Code section: module_declarations ### */ /* Module declarations from "pglast" */ /* Module declarations from "libc.stdint" */ /* Module declarations from "pglast.structs" */ /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.type" */ /* Module declarations from "cpython" */ /* Module declarations from "cpython.object" */ /* Module declarations from "cpython.bytes" */ /* Module declarations from "cpython.list" */ /* Module declarations from "libc" */ /* Module declarations from "libc.limits" */ /* Module declarations from "cpython.ref" */ /* Module declarations from "cpython.tuple" */ /* Module declarations from "pglast.parser" */ static PyObject *__pyx_f_6pglast_6parser__pg_bitmapset_to_set(Bitmapset const *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser__pg_list_to_tuple(List const *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Query(Query *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TypeName(TypeName *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ColumnRef(ColumnRef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ParamRef(ParamRef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_A_Expr(A_Expr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TypeCast(TypeCast *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CollateClause(CollateClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RoleSpec(RoleSpec *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FuncCall(FuncCall *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_A_Star(A_Star *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_A_Indices(A_Indices *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_A_Indirection(A_Indirection *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_A_ArrayExpr(A_ArrayExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ResTarget(ResTarget *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_MultiAssignRef(MultiAssignRef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SortBy(SortBy *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_WindowDef(WindowDef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeSubselect(RangeSubselect *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeFunction(RangeFunction *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeTableFunc(RangeTableFunc *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeTableFuncCol(RangeTableFuncCol *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeTableSample(RangeTableSample *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ColumnDef(ColumnDef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TableLikeClause(TableLikeClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_IndexElem(IndexElem *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DefElem(DefElem *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_LockingClause(LockingClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_XmlSerialize(XmlSerialize *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PartitionElem(PartitionElem *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PartitionSpec(PartitionSpec *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PartitionBoundSpec(PartitionBoundSpec *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PartitionRangeDatum(PartitionRangeDatum *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SinglePartitionSpec(SinglePartitionSpec *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PartitionCmd(PartitionCmd *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeTblEntry(RangeTblEntry *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RTEPermissionInfo(RTEPermissionInfo *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeTblFunction(RangeTblFunction *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TableSampleClause(TableSampleClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_WithCheckOption(WithCheckOption *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SortGroupClause(SortGroupClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_GroupingSet(GroupingSet *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_WindowClause(WindowClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RowMarkClause(RowMarkClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_WithClause(WithClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_InferClause(InferClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_OnConflictClause(OnConflictClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CTESearchClause(CTESearchClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CTECycleClause(CTECycleClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CommonTableExpr(CommonTableExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_MergeWhenClause(MergeWhenClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TriggerTransition(TriggerTransition *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonOutput(JsonOutput *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonArgument(JsonArgument *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonFuncExpr(JsonFuncExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonTablePathSpec(JsonTablePathSpec *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonTable(JsonTable *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonTableColumn(JsonTableColumn *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonKeyValue(JsonKeyValue *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonParseExpr(JsonParseExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonScalarExpr(JsonScalarExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonSerializeExpr(JsonSerializeExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonObjectConstructor(JsonObjectConstructor *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonArrayConstructor(JsonArrayConstructor *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonArrayQueryConstructor(JsonArrayQueryConstructor *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonAggConstructor(JsonAggConstructor *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonObjectAgg(JsonObjectAgg *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonArrayAgg(JsonArrayAgg *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RawStmt(RawStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_InsertStmt(InsertStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DeleteStmt(DeleteStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_UpdateStmt(UpdateStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_MergeStmt(MergeStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SelectStmt(SelectStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SetOperationStmt(SetOperationStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ReturnStmt(ReturnStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PLAssignStmt(PLAssignStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateSchemaStmt(CreateSchemaStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableStmt(AlterTableStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ReplicaIdentityStmt(ReplicaIdentityStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableCmd(AlterTableCmd *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterCollationStmt(AlterCollationStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterDomainStmt(AlterDomainStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_GrantStmt(GrantStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ObjectWithArgs(ObjectWithArgs *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AccessPriv(AccessPriv *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_GrantRoleStmt(GrantRoleStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CopyStmt(CopyStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_VariableSetStmt(VariableSetStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_VariableShowStmt(VariableShowStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateStmt(CreateStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Constraint(Constraint *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateTableSpaceStmt(CreateTableSpaceStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropTableSpaceStmt(DropTableSpaceStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableMoveAllStmt(AlterTableMoveAllStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateExtensionStmt(CreateExtensionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterExtensionStmt(AlterExtensionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterExtensionContentsStmt(AlterExtensionContentsStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateFdwStmt(CreateFdwStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterFdwStmt(AlterFdwStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateForeignServerStmt(CreateForeignServerStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterForeignServerStmt(AlterForeignServerStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateForeignTableStmt(CreateForeignTableStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateUserMappingStmt(CreateUserMappingStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterUserMappingStmt(AlterUserMappingStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropUserMappingStmt(DropUserMappingStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ImportForeignSchemaStmt(ImportForeignSchemaStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreatePolicyStmt(CreatePolicyStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterPolicyStmt(AlterPolicyStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateAmStmt(CreateAmStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateTrigStmt(CreateTrigStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateEventTrigStmt(CreateEventTrigStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterEventTrigStmt(AlterEventTrigStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreatePLangStmt(CreatePLangStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateRoleStmt(CreateRoleStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterRoleStmt(AlterRoleStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterRoleSetStmt(AlterRoleSetStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropRoleStmt(DropRoleStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateSeqStmt(CreateSeqStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterSeqStmt(AlterSeqStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DefineStmt(DefineStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateDomainStmt(CreateDomainStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateOpClassStmt(CreateOpClassStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateOpClassItem(CreateOpClassItem *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateOpFamilyStmt(CreateOpFamilyStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterOpFamilyStmt(AlterOpFamilyStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropStmt(DropStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TruncateStmt(TruncateStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CommentStmt(CommentStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SecLabelStmt(SecLabelStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DeclareCursorStmt(DeclareCursorStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ClosePortalStmt(ClosePortalStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FetchStmt(FetchStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_IndexStmt(IndexStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateStatsStmt(CreateStatsStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_StatsElem(StatsElem *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterStatsStmt(AlterStatsStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateFunctionStmt(CreateFunctionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FunctionParameter(FunctionParameter *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterFunctionStmt(AlterFunctionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DoStmt(DoStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_InlineCodeBlock(InlineCodeBlock *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CallStmt(CallStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CallContext(CallContext *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RenameStmt(RenameStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterObjectDependsStmt(AlterObjectDependsStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterObjectSchemaStmt(AlterObjectSchemaStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterOwnerStmt(AlterOwnerStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterOperatorStmt(AlterOperatorStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTypeStmt(AlterTypeStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RuleStmt(RuleStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_NotifyStmt(NotifyStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ListenStmt(ListenStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_UnlistenStmt(UnlistenStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TransactionStmt(TransactionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CompositeTypeStmt(CompositeTypeStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateEnumStmt(CreateEnumStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateRangeStmt(CreateRangeStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterEnumStmt(AlterEnumStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ViewStmt(ViewStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_LoadStmt(LoadStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreatedbStmt(CreatedbStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterDatabaseStmt(AlterDatabaseStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterDatabaseRefreshCollStmt(AlterDatabaseRefreshCollStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterDatabaseSetStmt(AlterDatabaseSetStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropdbStmt(DropdbStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterSystemStmt(AlterSystemStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ClusterStmt(ClusterStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_VacuumStmt(VacuumStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_VacuumRelation(VacuumRelation *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ExplainStmt(ExplainStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateTableAsStmt(CreateTableAsStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RefreshMatViewStmt(RefreshMatViewStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CheckPointStmt(CheckPointStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DiscardStmt(DiscardStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_LockStmt(LockStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ConstraintsSetStmt(ConstraintsSetStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ReindexStmt(ReindexStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateConversionStmt(CreateConversionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateCastStmt(CreateCastStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateTransformStmt(CreateTransformStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PrepareStmt(PrepareStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ExecuteStmt(ExecuteStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DeallocateStmt(DeallocateStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropOwnedStmt(DropOwnedStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ReassignOwnedStmt(ReassignOwnedStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTSDictionaryStmt(AlterTSDictionaryStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterTSConfigurationStmt(AlterTSConfigurationStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PublicationTable(PublicationTable *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_PublicationObjSpec(PublicationObjSpec *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreatePublicationStmt(CreatePublicationStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterPublicationStmt(AlterPublicationStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CreateSubscriptionStmt(CreateSubscriptionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlterSubscriptionStmt(AlterSubscriptionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_DropSubscriptionStmt(DropSubscriptionStmt *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Alias(Alias *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeVar(RangeVar *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TableFunc(TableFunc *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_IntoClause(IntoClause *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Var(Var *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Param(Param *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Aggref(Aggref *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_GroupingFunc(GroupingFunc *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_WindowFunc(WindowFunc *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_WindowFuncRunCondition(WindowFuncRunCondition *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_MergeSupportFunc(MergeSupportFunc *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SubscriptingRef(SubscriptingRef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FuncExpr(FuncExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_NamedArgExpr(NamedArgExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_OpExpr(OpExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ScalarArrayOpExpr(ScalarArrayOpExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_BoolExpr(BoolExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SubLink(SubLink *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SubPlan(SubPlan *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_AlternativeSubPlan(AlternativeSubPlan *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FieldSelect(FieldSelect *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FieldStore(FieldStore *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RelabelType(RelabelType *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CoerceViaIO(CoerceViaIO *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ArrayCoerceExpr(ArrayCoerceExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ConvertRowtypeExpr(ConvertRowtypeExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CollateExpr(CollateExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CaseExpr(CaseExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CaseWhen(CaseWhen *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CaseTestExpr(CaseTestExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_ArrayExpr(ArrayExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RowExpr(RowExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RowCompareExpr(RowCompareExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CoalesceExpr(CoalesceExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_MinMaxExpr(MinMaxExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SQLValueFunction(SQLValueFunction *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_XmlExpr(XmlExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonFormat(JsonFormat *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonReturning(JsonReturning *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonValueExpr(JsonValueExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonConstructorExpr(JsonConstructorExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonIsPredicate(JsonIsPredicate *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonBehavior(JsonBehavior *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JsonExpr(JsonExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_NullTest(NullTest *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_BooleanTest(BooleanTest *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_MergeAction(MergeAction *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CoerceToDomain(CoerceToDomain *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CoerceToDomainValue(CoerceToDomainValue *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_SetToDefault(SetToDefault *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_CurrentOfExpr(CurrentOfExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_InferenceElem(InferenceElem *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_TargetEntry(TargetEntry *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_RangeTblRef(RangeTblRef *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_JoinExpr(JoinExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_FromExpr(FromExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_OnConflictExpr(OnConflictExpr *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Integer(Integer *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Float(Float *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_Boolean(Boolean *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_String(String *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_BitString(BitString *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create_A_Const(A_Const *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser_create(void *, PyObject *); /*proto*/ static PyObject *__pyx_f_6pglast_6parser___pyx_unpickle_Displacements__set_state(struct __pyx_obj_6pglast_6parser_Displacements *, PyObject *); /*proto*/ /* #### Code section: typeinfo ### */ /* #### Code section: before_global_var ### */ #define __Pyx_MODULE_NAME "pglast.parser" extern int __pyx_module_is_main_pglast__parser; int __pyx_module_is_main_pglast__parser = 0; /* Implementation of "pglast.parser" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_reversed; /* #### Code section: string_decls ### */ static const char __pyx_k_i[] = "i"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "."; static const char __pyx_k__3[] = ""; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_Var[] = "Var"; static const char __pyx_k__32[] = "?"; static const char __pyx_k_ast[] = "ast"; static const char __pyx_k_chr[] = "chr"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_str[] = "__str__"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mctx[] = "mctx"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_scan[] = "scan"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_stmt[] = "stmt"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_tree[] = "tree"; static const char __pyx_k_type[] = "type"; static const char __pyx_k_utf8[] = "utf8"; static const char __pyx_k_Alias[] = "Alias"; static const char __pyx_k_Error[] = "Error"; static const char __pyx_k_Float[] = "Float"; static const char __pyx_k_Param[] = "Param"; static const char __pyx_k_Query[] = "Query"; static const char __pyx_k_Token[] = "Token"; static const char __pyx_k_enums[] = "enums"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_major[] = "major"; static const char __pyx_k_minor[] = "minor"; static const char __pyx_k_query[] = "query"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_stmts[] = "stmts"; static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_super[] = "super"; static const char __pyx_k_tkind[] = "tkind"; static const char __pyx_k_token[] = "token"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_A_Expr[] = "A_Expr"; static const char __pyx_k_A_Star[] = "A_Star"; static const char __pyx_k_Aggref[] = "Aggref"; static const char __pyx_k_DoStmt[] = "DoStmt"; static const char __pyx_k_OpExpr[] = "OpExpr"; static const char __pyx_k_SortBy[] = "SortBy"; static const char __pyx_k_String[] = "String"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwkind[] = "kwkind"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "name"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_parsed[] = "parsed"; static const char __pyx_k_pglast[] = "pglast"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_A_Const[] = "A_Const"; static const char __pyx_k_Boolean[] = "Boolean"; static const char __pyx_k_CmdType[] = "CmdType"; static const char __pyx_k_DefElem[] = "DefElem"; static const char __pyx_k_Integer[] = "Integer"; static const char __pyx_k_RTEKind[] = "RTEKind"; static const char __pyx_k_RawStmt[] = "RawStmt"; static const char __pyx_k_RowExpr[] = "RowExpr"; static const char __pyx_k_SubLink[] = "SubLink"; static const char __pyx_k_SubPlan[] = "SubPlan"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_WCOKind[] = "WCOKind"; static const char __pyx_k_XmlExpr[] = "XmlExpr"; static const char __pyx_k_cstring[] = "cstring"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_message[] = "message"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_scanned[] = "scanned"; static const char __pyx_k_version[] = "version"; static const char __pyx_k_AggSplit[] = "AggSplit"; static const char __pyx_k_BoolExpr[] = "BoolExpr"; static const char __pyx_k_CallStmt[] = "CallStmt"; static const char __pyx_k_CaseExpr[] = "CaseExpr"; static const char __pyx_k_CaseWhen[] = "CaseWhen"; static const char __pyx_k_CopyStmt[] = "CopyStmt"; static const char __pyx_k_DropStmt[] = "DropStmt"; static const char __pyx_k_FromExpr[] = "FromExpr"; static const char __pyx_k_FuncCall[] = "FuncCall"; static const char __pyx_k_FuncExpr[] = "FuncExpr"; static const char __pyx_k_JoinExpr[] = "JoinExpr"; static const char __pyx_k_JoinType[] = "JoinType"; static const char __pyx_k_JsonExpr[] = "JsonExpr"; static const char __pyx_k_LONG_MAX[] = "LONG_MAX"; static const char __pyx_k_LoadStmt[] = "LoadStmt"; static const char __pyx_k_LockStmt[] = "LockStmt"; static const char __pyx_k_MinMaxOp[] = "MinMaxOp"; static const char __pyx_k_NullTest[] = "NullTest"; static const char __pyx_k_ParamRef[] = "ParamRef"; static const char __pyx_k_RangeVar[] = "RangeVar"; static const char __pyx_k_RoleSpec[] = "RoleSpec"; static const char __pyx_k_RuleStmt[] = "RuleStmt"; static const char __pyx_k_TypeCast[] = "TypeCast"; static const char __pyx_k_TypeName[] = "TypeName"; static const char __pyx_k_ViewStmt[] = "ViewStmt"; static const char __pyx_k_at_index[] = ", at index "; static const char __pyx_k_deparsed[] = "deparsed"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_location[] = "location"; static const char __pyx_k_protobuf[] = "protobuf"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_splitted[] = "splitted"; static const char __pyx_k_A_Indices[] = "A_Indices"; static const char __pyx_k_ArrayExpr[] = "ArrayExpr"; static const char __pyx_k_BitString[] = "BitString"; static const char __pyx_k_ColumnDef[] = "ColumnDef"; static const char __pyx_k_ColumnRef[] = "ColumnRef"; static const char __pyx_k_FetchStmt[] = "FetchStmt"; static const char __pyx_k_GrantStmt[] = "GrantStmt"; static const char __pyx_k_IndexElem[] = "IndexElem"; static const char __pyx_k_IndexStmt[] = "IndexStmt"; static const char __pyx_k_JsonTable[] = "JsonTable"; static const char __pyx_k_MergeStmt[] = "MergeStmt"; static const char __pyx_k_ParamKind[] = "ParamKind"; static const char __pyx_k_ResTarget[] = "ResTarget"; static const char __pyx_k_SortByDir[] = "SortByDir"; static const char __pyx_k_StatsElem[] = "StatsElem"; static const char __pyx_k_TableFunc[] = "TableFunc"; static const char __pyx_k_WindowDef[] = "WindowDef"; static const char __pyx_k_XmlExprOp[] = "XmlExprOp"; static const char __pyx_k_cursorpos[] = "cursorpos"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_parse_sql[] = "parse_sql"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_AccessPriv[] = "AccessPriv"; static const char __pyx_k_ConstrType[] = "ConstrType"; static const char __pyx_k_Constraint[] = "Constraint"; static const char __pyx_k_CreateStmt[] = "CreateStmt"; static const char __pyx_k_DefineStmt[] = "DefineStmt"; static const char __pyx_k_DeleteStmt[] = "DeleteStmt"; static const char __pyx_k_DropdbStmt[] = "DropdbStmt"; static const char __pyx_k_FieldStore[] = "FieldStore"; static const char __pyx_k_InsertStmt[] = "InsertStmt"; static const char __pyx_k_IntoClause[] = "IntoClause"; static const char __pyx_k_JsonExprOp[] = "JsonExprOp"; static const char __pyx_k_JsonFormat[] = "JsonFormat"; static const char __pyx_k_JsonOutput[] = "JsonOutput"; static const char __pyx_k_JsonQuotes[] = "JsonQuotes"; static const char __pyx_k_ListenStmt[] = "ListenStmt"; static const char __pyx_k_MinMaxExpr[] = "MinMaxExpr"; static const char __pyx_k_NotifyStmt[] = "NotifyStmt"; static const char __pyx_k_ObjectType[] = "ObjectType"; static const char __pyx_k_ParseError[] = "ParseError"; static const char __pyx_k_RenameStmt[] = "RenameStmt"; static const char __pyx_k_ReturnStmt[] = "ReturnStmt"; static const char __pyx_k_SelectStmt[] = "SelectStmt"; static const char __pyx_k_UpdateStmt[] = "UpdateStmt"; static const char __pyx_k_VacuumStmt[] = "VacuumStmt"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_WindowFunc[] = "WindowFunc"; static const char __pyx_k_WithClause[] = "WithClause"; static const char __pyx_k_cur_offset[] = "cur_offset"; static const char __pyx_k_namedtuple[] = "namedtuple"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_scan_token[] = "scan_token"; static const char __pyx_k_A_ArrayExpr[] = "A_ArrayExpr"; static const char __pyx_k_A_Expr_Kind[] = "A_Expr_Kind"; static const char __pyx_k_BooleanTest[] = "BooleanTest"; static const char __pyx_k_CallContext[] = "CallContext"; static const char __pyx_k_ClusterStmt[] = "ClusterStmt"; static const char __pyx_k_CoerceViaIO[] = "CoerceViaIO"; static const char __pyx_k_CollateExpr[] = "CollateExpr"; static const char __pyx_k_CommentStmt[] = "CommentStmt"; static const char __pyx_k_DiscardMode[] = "DiscardMode"; static const char __pyx_k_DiscardStmt[] = "DiscardStmt"; static const char __pyx_k_ExecuteStmt[] = "ExecuteStmt"; static const char __pyx_k_ExplainStmt[] = "ExplainStmt"; static const char __pyx_k_FieldSelect[] = "FieldSelect"; static const char __pyx_k_GroupingSet[] = "GroupingSet"; static const char __pyx_k_InferClause[] = "InferClause"; static const char __pyx_k_JsonWrapper[] = "JsonWrapper"; static const char __pyx_k_LimitOption[] = "LimitOption"; static const char __pyx_k_MergeAction[] = "MergeAction"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_PrepareStmt[] = "PrepareStmt"; static const char __pyx_k_QuerySource[] = "QuerySource"; static const char __pyx_k_RangeTblRef[] = "RangeTblRef"; static const char __pyx_k_ReindexStmt[] = "ReindexStmt"; static const char __pyx_k_RelabelType[] = "RelabelType"; static const char __pyx_k_SortByNulls[] = "SortByNulls"; static const char __pyx_k_SubLinkType[] = "SubLinkType"; static const char __pyx_k_TargetEntry[] = "TargetEntry"; static const char __pyx_k_at_position[] = ", at position "; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_fingerprint[] = "fingerprint"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_only_slices[] = "only_slices"; static const char __pyx_k_prev_offset[] = "prev_offset"; static const char __pyx_k_scan_result[] = "scan_result"; static const char __pyx_k_with_parser[] = "with_parser"; static const char __pyx_k_AlterFdwStmt[] = "AlterFdwStmt"; static const char __pyx_k_AlterSeqStmt[] = "AlterSeqStmt"; static const char __pyx_k_BoolExprType[] = "BoolExprType"; static const char __pyx_k_BoolTestType[] = "BoolTestType"; static const char __pyx_k_CaseTestExpr[] = "CaseTestExpr"; static const char __pyx_k_CoalesceExpr[] = "CoalesceExpr"; static const char __pyx_k_CoercionForm[] = "CoercionForm"; static const char __pyx_k_CreateAmStmt[] = "CreateAmStmt"; static const char __pyx_k_CreatedbStmt[] = "CreatedbStmt"; static const char __pyx_k_DeparseError[] = "DeparseError"; static const char __pyx_k_DropBehavior[] = "DropBehavior"; static const char __pyx_k_DropRoleStmt[] = "DropRoleStmt"; static const char __pyx_k_GroupingFunc[] = "GroupingFunc"; static const char __pyx_k_JsonArgument[] = "JsonArgument"; static const char __pyx_k_JsonArrayAgg[] = "JsonArrayAgg"; static const char __pyx_k_JsonBehavior[] = "JsonBehavior"; static const char __pyx_k_JsonEncoding[] = "JsonEncoding"; static const char __pyx_k_JsonFuncExpr[] = "JsonFuncExpr"; static const char __pyx_k_JsonKeyValue[] = "JsonKeyValue"; static const char __pyx_k_NamedArgExpr[] = "NamedArgExpr"; static const char __pyx_k_NullTestType[] = "NullTestType"; static const char __pyx_k_PLAssignStmt[] = "PLAssignStmt"; static const char __pyx_k_PartitionCmd[] = "PartitionCmd"; static const char __pyx_k_RoleSpecType[] = "RoleSpecType"; static const char __pyx_k_RoleStmtType[] = "RoleStmtType"; static const char __pyx_k_SecLabelStmt[] = "SecLabelStmt"; static const char __pyx_k_SetOperation[] = "SetOperation"; static const char __pyx_k_SetToDefault[] = "SetToDefault"; static const char __pyx_k_TruncateStmt[] = "TruncateStmt"; static const char __pyx_k_UnlistenStmt[] = "UnlistenStmt"; static const char __pyx_k_WindowClause[] = "WindowClause"; static const char __pyx_k_XmlSerialize[] = "XmlSerialize"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_stringsource[] = ""; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_A_Indirection[] = "A_Indirection"; static const char __pyx_k_AlterEnumStmt[] = "AlterEnumStmt"; static const char __pyx_k_AlterRoleStmt[] = "AlterRoleStmt"; static const char __pyx_k_AlterTableCmd[] = "AlterTableCmd"; static const char __pyx_k_AlterTypeStmt[] = "AlterTypeStmt"; static const char __pyx_k_CollateClause[] = "CollateClause"; static const char __pyx_k_CreateFdwStmt[] = "CreateFdwStmt"; static const char __pyx_k_CreateSeqStmt[] = "CreateSeqStmt"; static const char __pyx_k_CurrentOfExpr[] = "CurrentOfExpr"; static const char __pyx_k_DefElemAction[] = "DefElemAction"; static const char __pyx_k_Displacements[] = "Displacements"; static const char __pyx_k_DropOwnedStmt[] = "DropOwnedStmt"; static const char __pyx_k_GrantRoleStmt[] = "GrantRoleStmt"; static const char __pyx_k_InferenceElem[] = "InferenceElem"; static const char __pyx_k_JsonObjectAgg[] = "JsonObjectAgg"; static const char __pyx_k_JsonParseExpr[] = "JsonParseExpr"; static const char __pyx_k_JsonReturning[] = "JsonReturning"; static const char __pyx_k_JsonValueExpr[] = "JsonValueExpr"; static const char __pyx_k_JsonValueType[] = "JsonValueType"; static const char __pyx_k_LockingClause[] = "LockingClause"; static const char __pyx_k_PartitionElem[] = "PartitionElem"; static const char __pyx_k_PartitionSpec[] = "PartitionSpec"; static const char __pyx_k_RangeFunction[] = "RangeFunction"; static const char __pyx_k_RangeTblEntry[] = "RangeTblEntry"; static const char __pyx_k_RowMarkClause[] = "RowMarkClause"; static const char __pyx_k_TableFuncType[] = "TableFuncType"; static const char __pyx_k_XmlOptionType[] = "XmlOptionType"; static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_pglast_parser[] = "pglast.parser"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_AlterOwnerStmt[] = "AlterOwnerStmt"; static const char __pyx_k_AlterStatsStmt[] = "AlterStatsStmt"; static const char __pyx_k_AlterTableStmt[] = "AlterTableStmt"; static const char __pyx_k_AlterTableType[] = "AlterTableType"; static const char __pyx_k_CTECycleClause[] = "CTECycleClause"; static const char __pyx_k_CTEMaterialize[] = "CTEMaterialize"; static const char __pyx_k_CheckPointStmt[] = "CheckPointStmt"; static const char __pyx_k_CoerceToDomain[] = "CoerceToDomain"; static const char __pyx_k_CreateCastStmt[] = "CreateCastStmt"; static const char __pyx_k_CreateEnumStmt[] = "CreateEnumStmt"; static const char __pyx_k_CreateRoleStmt[] = "CreateRoleStmt"; static const char __pyx_k_CreateTrigStmt[] = "CreateTrigStmt"; static const char __pyx_k_DeallocateStmt[] = "DeallocateStmt"; static const char __pyx_k_FetchDirection[] = "FetchDirection"; static const char __pyx_k_JsonFormatType[] = "JsonFormatType"; static const char __pyx_k_JsonScalarExpr[] = "JsonScalarExpr"; static const char __pyx_k_LockWaitPolicy[] = "LockWaitPolicy"; static const char __pyx_k_MergeMatchKind[] = "MergeMatchKind"; static const char __pyx_k_MultiAssignRef[] = "MultiAssignRef"; static const char __pyx_k_ObjectWithArgs[] = "ObjectWithArgs"; static const char __pyx_k_OnCommitAction[] = "OnCommitAction"; static const char __pyx_k_OnConflictExpr[] = "OnConflictExpr"; static const char __pyx_k_OverridingKind[] = "OverridingKind"; static const char __pyx_k_RangeSubselect[] = "RangeSubselect"; static const char __pyx_k_RangeTableFunc[] = "RangeTableFunc"; static const char __pyx_k_RowCompareExpr[] = "RowCompareExpr"; static const char __pyx_k_RowCompareType[] = "RowCompareType"; static const char __pyx_k_VacuumRelation[] = "VacuumRelation"; static const char __pyx_k_parse_sql_json[] = "parse_sql_json"; static const char __pyx_k_AlterDomainStmt[] = "AlterDomainStmt"; static const char __pyx_k_AlterPolicyStmt[] = "AlterPolicyStmt"; static const char __pyx_k_AlterSystemStmt[] = "AlterSystemStmt"; static const char __pyx_k_ArrayCoerceExpr[] = "ArrayCoerceExpr"; static const char __pyx_k_CTESearchClause[] = "CTESearchClause"; static const char __pyx_k_ClosePortalStmt[] = "ClosePortalStmt"; static const char __pyx_k_CoercionContext[] = "CoercionContext"; static const char __pyx_k_CommonTableExpr[] = "CommonTableExpr"; static const char __pyx_k_CreatePLangStmt[] = "CreatePLangStmt"; static const char __pyx_k_CreateRangeStmt[] = "CreateRangeStmt"; static const char __pyx_k_CreateStatsStmt[] = "CreateStatsStmt"; static const char __pyx_k_GrantTargetType[] = "GrantTargetType"; static const char __pyx_k_GroupingSetKind[] = "GroupingSetKind"; static const char __pyx_k_InlineCodeBlock[] = "InlineCodeBlock"; static const char __pyx_k_JsonIsPredicate[] = "JsonIsPredicate"; static const char __pyx_k_JsonTableColumn[] = "JsonTableColumn"; static const char __pyx_k_MergeWhenClause[] = "MergeWhenClause"; static const char __pyx_k_SortGroupClause[] = "SortGroupClause"; static const char __pyx_k_SubscriptingRef[] = "SubscriptingRef"; static const char __pyx_k_TableLikeClause[] = "TableLikeClause"; static const char __pyx_k_TransactionStmt[] = "TransactionStmt"; static const char __pyx_k_Unhandled_tag_s[] = "Unhandled tag: %s"; static const char __pyx_k_VariableSetKind[] = "VariableSetKind"; static const char __pyx_k_VariableSetStmt[] = "VariableSetStmt"; static const char __pyx_k_ViewCheckOption[] = "ViewCheckOption"; static const char __pyx_k_WithCheckOption[] = "WithCheckOption"; static const char __pyx_k_offset_to_index[] = "offset_to_index"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_AlterRoleSetStmt[] = "AlterRoleSetStmt"; static const char __pyx_k_CreateDomainStmt[] = "CreateDomainStmt"; static const char __pyx_k_CreatePolicyStmt[] = "CreatePolicyStmt"; static const char __pyx_k_CreateSchemaStmt[] = "CreateSchemaStmt"; static const char __pyx_k_JsonBehaviorType[] = "JsonBehaviorType"; static const char __pyx_k_MergeSupportFunc[] = "MergeSupportFunc"; static const char __pyx_k_OnConflictAction[] = "OnConflictAction"; static const char __pyx_k_OnConflictClause[] = "OnConflictClause"; static const char __pyx_k_ParseError___str[] = "ParseError.__str__"; static const char __pyx_k_PublicationTable[] = "PublicationTable"; static const char __pyx_k_RangeTableSample[] = "RangeTableSample"; static const char __pyx_k_RangeTblFunction[] = "RangeTblFunction"; static const char __pyx_k_SQLValueFunction[] = "SQLValueFunction"; static const char __pyx_k_SetOperationStmt[] = "SetOperationStmt"; static const char __pyx_k_VariableShowStmt[] = "VariableShowStmt"; static const char __pyx_k_deparse_protobuf[] = "deparse_protobuf"; static const char __pyx_k_AlterDatabaseStmt[] = "AlterDatabaseStmt"; static const char __pyx_k_AlterFunctionStmt[] = "AlterFunctionStmt"; static const char __pyx_k_AlterOpFamilyStmt[] = "AlterOpFamilyStmt"; static const char __pyx_k_AlterOperatorStmt[] = "AlterOperatorStmt"; static const char __pyx_k_AlterTSConfigType[] = "AlterTSConfigType"; static const char __pyx_k_CompositeTypeStmt[] = "CompositeTypeStmt"; static const char __pyx_k_CreateOpClassItem[] = "CreateOpClassItem"; static const char __pyx_k_CreateOpClassStmt[] = "CreateOpClassStmt"; static const char __pyx_k_CreateTableAsStmt[] = "CreateTableAsStmt"; static const char __pyx_k_DeclareCursorStmt[] = "DeclareCursorStmt"; static const char __pyx_k_FunctionParameter[] = "FunctionParameter"; static const char __pyx_k_JsonSerializeExpr[] = "JsonSerializeExpr"; static const char __pyx_k_JsonTablePathSpec[] = "JsonTablePathSpec"; static const char __pyx_k_PartitionStrategy[] = "PartitionStrategy"; static const char __pyx_k_RTEPermissionInfo[] = "RTEPermissionInfo"; static const char __pyx_k_RangeTableFuncCol[] = "RangeTableFuncCol"; static const char __pyx_k_ReassignOwnedStmt[] = "ReassignOwnedStmt"; static const char __pyx_k_ReindexObjectType[] = "ReindexObjectType"; static const char __pyx_k_ScalarArrayOpExpr[] = "ScalarArrayOpExpr"; static const char __pyx_k_TableSampleClause[] = "TableSampleClause"; static const char __pyx_k_TriggerTransition[] = "TriggerTransition"; static const char __pyx_k_pglast_parser_pyx[] = "pglast/parser.pyx"; static const char __pyx_k_AlterCollationStmt[] = "AlterCollationStmt"; static const char __pyx_k_AlterEventTrigStmt[] = "AlterEventTrigStmt"; static const char __pyx_k_AlterExtensionStmt[] = "AlterExtensionStmt"; static const char __pyx_k_AlternativeSubPlan[] = "AlternativeSubPlan"; static const char __pyx_k_ConstraintsSetStmt[] = "ConstraintsSetStmt"; static const char __pyx_k_ConvertRowtypeExpr[] = "ConvertRowtypeExpr"; static const char __pyx_k_CreateFunctionStmt[] = "CreateFunctionStmt"; static const char __pyx_k_CreateOpFamilyStmt[] = "CreateOpFamilyStmt"; static const char __pyx_k_DeparseError___str[] = "DeparseError.__str__"; static const char __pyx_k_DropTableSpaceStmt[] = "DropTableSpaceStmt"; static const char __pyx_k_JsonAggConstructor[] = "JsonAggConstructor"; static const char __pyx_k_LockClauseStrength[] = "LockClauseStrength"; static const char __pyx_k_PartitionBoundSpec[] = "PartitionBoundSpec"; static const char __pyx_k_PublicationObjSpec[] = "PublicationObjSpec"; static const char __pyx_k_RefreshMatViewStmt[] = "RefreshMatViewStmt"; static const char __pyx_k_SQLValueFunctionOp[] = "SQLValueFunctionOp"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_parse_plpgsql_json[] = "parse_plpgsql_json"; static const char __pyx_k_parse_sql_protobuf[] = "parse_sql_protobuf"; static const char __pyx_k_CoerceToDomainValue[] = "CoerceToDomainValue"; static const char __pyx_k_CreateEventTrigStmt[] = "CreateEventTrigStmt"; static const char __pyx_k_CreateExtensionStmt[] = "CreateExtensionStmt"; static const char __pyx_k_CreateTransformStmt[] = "CreateTransformStmt"; static const char __pyx_k_DropUserMappingStmt[] = "DropUserMappingStmt"; static const char __pyx_k_JsonConstructorExpr[] = "JsonConstructorExpr"; static const char __pyx_k_JsonConstructorType[] = "JsonConstructorType"; static const char __pyx_k_JsonTableColumnType[] = "JsonTableColumnType"; static const char __pyx_k_PartitionRangeDatum[] = "PartitionRangeDatum"; static const char __pyx_k_ReplicaIdentityStmt[] = "ReplicaIdentityStmt"; static const char __pyx_k_SinglePartitionSpec[] = "SinglePartitionSpec"; static const char __pyx_k_TransactionStmtKind[] = "TransactionStmtKind"; static const char __pyx_k_AlterDatabaseSetStmt[] = "AlterDatabaseSetStmt"; static const char __pyx_k_AlterPublicationStmt[] = "AlterPublicationStmt"; static const char __pyx_k_AlterUserMappingStmt[] = "AlterUserMappingStmt"; static const char __pyx_k_CreateConversionStmt[] = "CreateConversionStmt"; static const char __pyx_k_CreateTableSpaceStmt[] = "CreateTableSpaceStmt"; static const char __pyx_k_DropSubscriptionStmt[] = "DropSubscriptionStmt"; static const char __pyx_k_JsonArrayConstructor[] = "JsonArrayConstructor"; static const char __pyx_k_AlterObjectSchemaStmt[] = "AlterObjectSchemaStmt"; static const char __pyx_k_AlterSubscriptionStmt[] = "AlterSubscriptionStmt"; static const char __pyx_k_AlterSubscriptionType[] = "AlterSubscriptionType"; static const char __pyx_k_AlterTSDictionaryStmt[] = "AlterTSDictionaryStmt"; static const char __pyx_k_AlterTableMoveAllStmt[] = "AlterTableMoveAllStmt"; static const char __pyx_k_CreatePublicationStmt[] = "CreatePublicationStmt"; static const char __pyx_k_CreateUserMappingStmt[] = "CreateUserMappingStmt"; static const char __pyx_k_FunctionParameterMode[] = "FunctionParameterMode"; static const char __pyx_k_JsonObjectConstructor[] = "JsonObjectConstructor"; static const char __pyx_k_AlterForeignServerStmt[] = "AlterForeignServerStmt"; static const char __pyx_k_AlterObjectDependsStmt[] = "AlterObjectDependsStmt"; static const char __pyx_k_AlterPublicationAction[] = "AlterPublicationAction"; static const char __pyx_k_CreateForeignTableStmt[] = "CreateForeignTableStmt"; static const char __pyx_k_CreateSubscriptionStmt[] = "CreateSubscriptionStmt"; static const char __pyx_k_PublicationObjSpecType[] = "PublicationObjSpecType"; static const char __pyx_k_WindowFuncRunCondition[] = "WindowFuncRunCondition"; static const char __pyx_k_get_postgresql_version[] = "get_postgresql_version"; static const char __pyx_k_CreateForeignServerStmt[] = "CreateForeignServerStmt"; static const char __pyx_k_ImportForeignSchemaStmt[] = "ImportForeignSchemaStmt"; static const char __pyx_k_ImportForeignSchemaType[] = "ImportForeignSchemaType"; static const char __pyx_k_PartitionRangeDatumKind[] = "PartitionRangeDatumKind"; static const char __pyx_k_AlterTSConfigurationStmt[] = "AlterTSConfigurationStmt"; static const char __pyx_k_JsonArrayQueryConstructor[] = "JsonArrayQueryConstructor"; static const char __pyx_k_AlterDefaultPrivilegesStmt[] = "AlterDefaultPrivilegesStmt"; static const char __pyx_k_AlterExtensionContentsStmt[] = "AlterExtensionContentsStmt"; static const char __pyx_k_AlterTableSpaceOptionsStmt[] = "AlterTableSpaceOptionsStmt"; static const char __pyx_k_pyx_unpickle_Displacements[] = "__pyx_unpickle_Displacements"; static const char __pyx_k_AlterDatabaseRefreshCollStmt[] = "AlterDatabaseRefreshCollStmt"; static const char __pyx_k_Displacements___reduce_cython[] = "Displacements.__reduce_cython__"; static const char __pyx_k_Displacements___setstate_cython[] = "Displacements.__setstate_cython__"; static const char __pyx_k_Exception_representing_the_error[] = "Exception representing the error state returned by the PG parser."; static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))"; static const char __pyx_k_Exception_representing_the_error_2[] = "Exception representing the error state returned by the PG deparser."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_6pglast_6parser_10ParseError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_12DeparseError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static int __pyx_pf_6pglast_6parser_13Displacements___init__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self, PyObject *__pyx_v_s); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_13Displacements_2__call__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_13Displacements_4__reduce_cython__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_13Displacements_6__setstate_cython__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_get_postgresql_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_2parse_sql(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_4parse_sql_json(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_6parse_sql_protobuf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_8parse_plpgsql_json(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_10fingerprint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_12split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stmts, int __pyx_v_with_parser, int __pyx_v_only_slices); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_14deparse_protobuf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_protobuf); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_16scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query); /* proto */ static PyObject *__pyx_pf_6pglast_6parser_18__pyx_unpickle_Displacements(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_6pglast_6parser_Displacements(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_index = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; PyObject *__pyx_cython_runtime; PyObject *__pyx_empty_tuple; PyObject *__pyx_empty_bytes; PyObject *__pyx_empty_unicode; #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED PyTypeObject *__pyx_FusedFunctionType; #endif #ifdef __Pyx_Generator_USED PyTypeObject *__pyx_GeneratorType; #endif #ifdef __Pyx_IterableCoroutine_USED PyTypeObject *__pyx_IterableCoroutineType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineAwaitType; #endif #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_6pglast_6parser_Displacements; #endif PyTypeObject *__pyx_ptype_6pglast_6parser_Displacements; PyObject *__pyx_n_s_A_ArrayExpr; PyObject *__pyx_n_s_A_Const; PyObject *__pyx_n_s_A_Expr; PyObject *__pyx_n_u_A_Expr_Kind; PyObject *__pyx_n_s_A_Indices; PyObject *__pyx_n_s_A_Indirection; PyObject *__pyx_n_s_A_Star; PyObject *__pyx_n_s_AccessPriv; PyObject *__pyx_n_u_AggSplit; PyObject *__pyx_n_s_Aggref; PyObject *__pyx_n_s_Alias; PyObject *__pyx_n_s_AlterCollationStmt; PyObject *__pyx_n_s_AlterDatabaseRefreshCollStmt; PyObject *__pyx_n_s_AlterDatabaseSetStmt; PyObject *__pyx_n_s_AlterDatabaseStmt; PyObject *__pyx_n_s_AlterDefaultPrivilegesStmt; PyObject *__pyx_n_s_AlterDomainStmt; PyObject *__pyx_n_s_AlterEnumStmt; PyObject *__pyx_n_s_AlterEventTrigStmt; PyObject *__pyx_n_s_AlterExtensionContentsStmt; PyObject *__pyx_n_s_AlterExtensionStmt; PyObject *__pyx_n_s_AlterFdwStmt; PyObject *__pyx_n_s_AlterForeignServerStmt; PyObject *__pyx_n_s_AlterFunctionStmt; PyObject *__pyx_n_s_AlterObjectDependsStmt; PyObject *__pyx_n_s_AlterObjectSchemaStmt; PyObject *__pyx_n_s_AlterOpFamilyStmt; PyObject *__pyx_n_s_AlterOperatorStmt; PyObject *__pyx_n_s_AlterOwnerStmt; PyObject *__pyx_n_s_AlterPolicyStmt; PyObject *__pyx_n_u_AlterPublicationAction; PyObject *__pyx_n_s_AlterPublicationStmt; PyObject *__pyx_n_s_AlterRoleSetStmt; PyObject *__pyx_n_s_AlterRoleStmt; PyObject *__pyx_n_s_AlterSeqStmt; PyObject *__pyx_n_s_AlterStatsStmt; PyObject *__pyx_n_s_AlterSubscriptionStmt; PyObject *__pyx_n_u_AlterSubscriptionType; PyObject *__pyx_n_s_AlterSystemStmt; PyObject *__pyx_n_u_AlterTSConfigType; PyObject *__pyx_n_s_AlterTSConfigurationStmt; PyObject *__pyx_n_s_AlterTSDictionaryStmt; PyObject *__pyx_n_s_AlterTableCmd; PyObject *__pyx_n_s_AlterTableMoveAllStmt; PyObject *__pyx_n_s_AlterTableSpaceOptionsStmt; PyObject *__pyx_n_s_AlterTableStmt; PyObject *__pyx_n_u_AlterTableType; PyObject *__pyx_n_s_AlterTypeStmt; PyObject *__pyx_n_s_AlterUserMappingStmt; PyObject *__pyx_n_s_AlternativeSubPlan; PyObject *__pyx_n_s_ArrayCoerceExpr; PyObject *__pyx_n_s_ArrayExpr; PyObject *__pyx_n_s_BitString; PyObject *__pyx_n_s_BoolExpr; PyObject *__pyx_n_u_BoolExprType; PyObject *__pyx_n_u_BoolTestType; PyObject *__pyx_n_s_Boolean; PyObject *__pyx_n_s_BooleanTest; PyObject *__pyx_n_s_CTECycleClause; PyObject *__pyx_n_u_CTEMaterialize; PyObject *__pyx_n_s_CTESearchClause; PyObject *__pyx_n_s_CallContext; PyObject *__pyx_n_s_CallStmt; PyObject *__pyx_n_s_CaseExpr; PyObject *__pyx_n_s_CaseTestExpr; PyObject *__pyx_n_s_CaseWhen; PyObject *__pyx_n_s_CheckPointStmt; PyObject *__pyx_n_s_ClosePortalStmt; PyObject *__pyx_n_s_ClusterStmt; PyObject *__pyx_n_u_CmdType; PyObject *__pyx_n_s_CoalesceExpr; PyObject *__pyx_n_s_CoerceToDomain; PyObject *__pyx_n_s_CoerceToDomainValue; PyObject *__pyx_n_s_CoerceViaIO; PyObject *__pyx_n_u_CoercionContext; PyObject *__pyx_n_u_CoercionForm; PyObject *__pyx_n_s_CollateClause; PyObject *__pyx_n_s_CollateExpr; PyObject *__pyx_n_s_ColumnDef; PyObject *__pyx_n_s_ColumnRef; PyObject *__pyx_n_s_CommentStmt; PyObject *__pyx_n_s_CommonTableExpr; PyObject *__pyx_n_s_CompositeTypeStmt; PyObject *__pyx_n_u_ConstrType; PyObject *__pyx_n_s_Constraint; PyObject *__pyx_n_s_ConstraintsSetStmt; PyObject *__pyx_n_s_ConvertRowtypeExpr; PyObject *__pyx_n_s_CopyStmt; PyObject *__pyx_n_s_CreateAmStmt; PyObject *__pyx_n_s_CreateCastStmt; PyObject *__pyx_n_s_CreateConversionStmt; PyObject *__pyx_n_s_CreateDomainStmt; PyObject *__pyx_n_s_CreateEnumStmt; PyObject *__pyx_n_s_CreateEventTrigStmt; PyObject *__pyx_n_s_CreateExtensionStmt; PyObject *__pyx_n_s_CreateFdwStmt; PyObject *__pyx_n_s_CreateForeignServerStmt; PyObject *__pyx_n_s_CreateForeignTableStmt; PyObject *__pyx_n_s_CreateFunctionStmt; PyObject *__pyx_n_s_CreateOpClassItem; PyObject *__pyx_n_s_CreateOpClassStmt; PyObject *__pyx_n_s_CreateOpFamilyStmt; PyObject *__pyx_n_s_CreatePLangStmt; PyObject *__pyx_n_s_CreatePolicyStmt; PyObject *__pyx_n_s_CreatePublicationStmt; PyObject *__pyx_n_s_CreateRangeStmt; PyObject *__pyx_n_s_CreateRoleStmt; PyObject *__pyx_n_s_CreateSchemaStmt; PyObject *__pyx_n_s_CreateSeqStmt; PyObject *__pyx_n_s_CreateStatsStmt; PyObject *__pyx_n_s_CreateStmt; PyObject *__pyx_n_s_CreateSubscriptionStmt; PyObject *__pyx_n_s_CreateTableAsStmt; PyObject *__pyx_n_s_CreateTableSpaceStmt; PyObject *__pyx_n_s_CreateTransformStmt; PyObject *__pyx_n_s_CreateTrigStmt; PyObject *__pyx_n_s_CreateUserMappingStmt; PyObject *__pyx_n_s_CreatedbStmt; PyObject *__pyx_n_s_CurrentOfExpr; PyObject *__pyx_n_s_DeallocateStmt; PyObject *__pyx_n_s_DeclareCursorStmt; PyObject *__pyx_n_s_DefElem; PyObject *__pyx_n_u_DefElemAction; PyObject *__pyx_n_s_DefineStmt; PyObject *__pyx_n_s_DeleteStmt; PyObject *__pyx_n_s_DeparseError; PyObject *__pyx_n_s_DeparseError___str; PyObject *__pyx_n_u_DiscardMode; PyObject *__pyx_n_s_DiscardStmt; PyObject *__pyx_n_s_Displacements; PyObject *__pyx_n_s_Displacements___reduce_cython; PyObject *__pyx_n_s_Displacements___setstate_cython; PyObject *__pyx_n_s_DoStmt; PyObject *__pyx_n_u_DropBehavior; PyObject *__pyx_n_s_DropOwnedStmt; PyObject *__pyx_n_s_DropRoleStmt; PyObject *__pyx_n_s_DropStmt; PyObject *__pyx_n_s_DropSubscriptionStmt; PyObject *__pyx_n_s_DropTableSpaceStmt; PyObject *__pyx_n_s_DropUserMappingStmt; PyObject *__pyx_n_s_DropdbStmt; PyObject *__pyx_n_s_Error; PyObject *__pyx_kp_s_Exception_representing_the_error; PyObject *__pyx_kp_s_Exception_representing_the_error_2; PyObject *__pyx_n_s_ExecuteStmt; PyObject *__pyx_n_s_ExplainStmt; PyObject *__pyx_n_u_FetchDirection; PyObject *__pyx_n_s_FetchStmt; PyObject *__pyx_n_s_FieldSelect; PyObject *__pyx_n_s_FieldStore; PyObject *__pyx_n_s_Float; PyObject *__pyx_n_s_FromExpr; PyObject *__pyx_n_s_FuncCall; PyObject *__pyx_n_s_FuncExpr; PyObject *__pyx_n_s_FunctionParameter; PyObject *__pyx_n_u_FunctionParameterMode; PyObject *__pyx_n_s_GrantRoleStmt; PyObject *__pyx_n_s_GrantStmt; PyObject *__pyx_n_u_GrantTargetType; PyObject *__pyx_n_s_GroupingFunc; PyObject *__pyx_n_s_GroupingSet; PyObject *__pyx_n_u_GroupingSetKind; PyObject *__pyx_n_s_ImportForeignSchemaStmt; PyObject *__pyx_n_u_ImportForeignSchemaType; PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0; PyObject *__pyx_n_s_IndexElem; PyObject *__pyx_n_s_IndexStmt; PyObject *__pyx_n_s_InferClause; PyObject *__pyx_n_s_InferenceElem; PyObject *__pyx_n_s_InlineCodeBlock; PyObject *__pyx_n_s_InsertStmt; PyObject *__pyx_n_s_Integer; PyObject *__pyx_n_s_IntoClause; PyObject *__pyx_n_s_JoinExpr; PyObject *__pyx_n_u_JoinType; PyObject *__pyx_n_s_JsonAggConstructor; PyObject *__pyx_n_s_JsonArgument; PyObject *__pyx_n_s_JsonArrayAgg; PyObject *__pyx_n_s_JsonArrayConstructor; PyObject *__pyx_n_s_JsonArrayQueryConstructor; PyObject *__pyx_n_s_JsonBehavior; PyObject *__pyx_n_u_JsonBehaviorType; PyObject *__pyx_n_s_JsonConstructorExpr; PyObject *__pyx_n_u_JsonConstructorType; PyObject *__pyx_n_u_JsonEncoding; PyObject *__pyx_n_s_JsonExpr; PyObject *__pyx_n_u_JsonExprOp; PyObject *__pyx_n_s_JsonFormat; PyObject *__pyx_n_u_JsonFormatType; PyObject *__pyx_n_s_JsonFuncExpr; PyObject *__pyx_n_s_JsonIsPredicate; PyObject *__pyx_n_s_JsonKeyValue; PyObject *__pyx_n_s_JsonObjectAgg; PyObject *__pyx_n_s_JsonObjectConstructor; PyObject *__pyx_n_s_JsonOutput; PyObject *__pyx_n_s_JsonParseExpr; PyObject *__pyx_n_u_JsonQuotes; PyObject *__pyx_n_s_JsonReturning; PyObject *__pyx_n_s_JsonScalarExpr; PyObject *__pyx_n_s_JsonSerializeExpr; PyObject *__pyx_n_s_JsonTable; PyObject *__pyx_n_s_JsonTableColumn; PyObject *__pyx_n_u_JsonTableColumnType; PyObject *__pyx_n_s_JsonTablePathSpec; PyObject *__pyx_n_s_JsonValueExpr; PyObject *__pyx_n_u_JsonValueType; PyObject *__pyx_n_u_JsonWrapper; PyObject *__pyx_n_s_LONG_MAX; PyObject *__pyx_n_u_LimitOption; PyObject *__pyx_n_s_ListenStmt; PyObject *__pyx_n_s_LoadStmt; PyObject *__pyx_n_u_LockClauseStrength; PyObject *__pyx_n_s_LockStmt; PyObject *__pyx_n_u_LockWaitPolicy; PyObject *__pyx_n_s_LockingClause; PyObject *__pyx_n_s_MergeAction; PyObject *__pyx_n_u_MergeMatchKind; PyObject *__pyx_n_s_MergeStmt; PyObject *__pyx_n_s_MergeSupportFunc; PyObject *__pyx_n_s_MergeWhenClause; PyObject *__pyx_n_s_MinMaxExpr; PyObject *__pyx_n_u_MinMaxOp; PyObject *__pyx_n_s_MultiAssignRef; PyObject *__pyx_n_s_NamedArgExpr; PyObject *__pyx_n_s_NotifyStmt; PyObject *__pyx_n_s_NullTest; PyObject *__pyx_n_u_NullTestType; PyObject *__pyx_n_u_ObjectType; PyObject *__pyx_n_s_ObjectWithArgs; PyObject *__pyx_n_u_OnCommitAction; PyObject *__pyx_n_u_OnConflictAction; PyObject *__pyx_n_s_OnConflictClause; PyObject *__pyx_n_s_OnConflictExpr; PyObject *__pyx_n_s_OpExpr; PyObject *__pyx_n_u_OverridingKind; PyObject *__pyx_n_s_PLAssignStmt; PyObject *__pyx_n_s_Param; PyObject *__pyx_n_u_ParamKind; PyObject *__pyx_n_s_ParamRef; PyObject *__pyx_n_s_ParseError; PyObject *__pyx_n_s_ParseError___str; PyObject *__pyx_n_s_PartitionBoundSpec; PyObject *__pyx_n_s_PartitionCmd; PyObject *__pyx_n_s_PartitionElem; PyObject *__pyx_n_s_PartitionRangeDatum; PyObject *__pyx_n_u_PartitionRangeDatumKind; PyObject *__pyx_n_s_PartitionSpec; PyObject *__pyx_n_u_PartitionStrategy; PyObject *__pyx_n_s_PickleError; PyObject *__pyx_n_s_PrepareStmt; PyObject *__pyx_n_s_PublicationObjSpec; PyObject *__pyx_n_u_PublicationObjSpecType; PyObject *__pyx_n_s_PublicationTable; PyObject *__pyx_n_s_Query; PyObject *__pyx_n_u_QuerySource; PyObject *__pyx_n_u_RTEKind; PyObject *__pyx_n_s_RTEPermissionInfo; PyObject *__pyx_n_s_RangeFunction; PyObject *__pyx_n_s_RangeSubselect; PyObject *__pyx_n_s_RangeTableFunc; PyObject *__pyx_n_s_RangeTableFuncCol; PyObject *__pyx_n_s_RangeTableSample; PyObject *__pyx_n_s_RangeTblEntry; PyObject *__pyx_n_s_RangeTblFunction; PyObject *__pyx_n_s_RangeTblRef; PyObject *__pyx_n_s_RangeVar; PyObject *__pyx_n_s_RawStmt; PyObject *__pyx_n_s_ReassignOwnedStmt; PyObject *__pyx_n_s_RefreshMatViewStmt; PyObject *__pyx_n_u_ReindexObjectType; PyObject *__pyx_n_s_ReindexStmt; PyObject *__pyx_n_s_RelabelType; PyObject *__pyx_n_s_RenameStmt; PyObject *__pyx_n_s_ReplicaIdentityStmt; PyObject *__pyx_n_s_ResTarget; PyObject *__pyx_n_s_ReturnStmt; PyObject *__pyx_n_s_RoleSpec; PyObject *__pyx_n_u_RoleSpecType; PyObject *__pyx_n_u_RoleStmtType; PyObject *__pyx_n_s_RowCompareExpr; PyObject *__pyx_n_u_RowCompareType; PyObject *__pyx_n_s_RowExpr; PyObject *__pyx_n_s_RowMarkClause; PyObject *__pyx_n_s_RuleStmt; PyObject *__pyx_n_s_SQLValueFunction; PyObject *__pyx_n_u_SQLValueFunctionOp; PyObject *__pyx_n_s_ScalarArrayOpExpr; PyObject *__pyx_n_s_SecLabelStmt; PyObject *__pyx_n_s_SelectStmt; PyObject *__pyx_n_u_SetOperation; PyObject *__pyx_n_s_SetOperationStmt; PyObject *__pyx_n_s_SetToDefault; PyObject *__pyx_n_s_SinglePartitionSpec; PyObject *__pyx_n_s_SortBy; PyObject *__pyx_n_u_SortByDir; PyObject *__pyx_n_u_SortByNulls; PyObject *__pyx_n_s_SortGroupClause; PyObject *__pyx_n_s_StatsElem; PyObject *__pyx_n_s_String; PyObject *__pyx_n_s_SubLink; PyObject *__pyx_n_u_SubLinkType; PyObject *__pyx_n_s_SubPlan; PyObject *__pyx_n_s_SubscriptingRef; PyObject *__pyx_n_s_TableFunc; PyObject *__pyx_n_u_TableFuncType; PyObject *__pyx_n_s_TableLikeClause; PyObject *__pyx_n_s_TableSampleClause; PyObject *__pyx_n_s_TargetEntry; PyObject *__pyx_n_s_Token; PyObject *__pyx_n_u_Token; PyObject *__pyx_n_s_TransactionStmt; PyObject *__pyx_n_u_TransactionStmtKind; PyObject *__pyx_n_s_TriggerTransition; PyObject *__pyx_n_s_TruncateStmt; PyObject *__pyx_n_s_TypeCast; PyObject *__pyx_n_s_TypeName; PyObject *__pyx_n_u_UNKNOWN; PyObject *__pyx_kp_u_Unhandled_tag_s; PyObject *__pyx_n_s_UnlistenStmt; PyObject *__pyx_n_s_UpdateStmt; PyObject *__pyx_n_s_VacuumRelation; PyObject *__pyx_n_s_VacuumStmt; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s_Var; PyObject *__pyx_n_u_VariableSetKind; PyObject *__pyx_n_s_VariableSetStmt; PyObject *__pyx_n_s_VariableShowStmt; PyObject *__pyx_n_u_ViewCheckOption; PyObject *__pyx_n_s_ViewStmt; PyObject *__pyx_n_u_WCOKind; PyObject *__pyx_n_s_WindowClause; PyObject *__pyx_n_s_WindowDef; PyObject *__pyx_n_s_WindowFunc; PyObject *__pyx_n_s_WindowFuncRunCondition; PyObject *__pyx_n_s_WithCheckOption; PyObject *__pyx_n_s_WithClause; PyObject *__pyx_n_s_XmlExpr; PyObject *__pyx_n_u_XmlExprOp; PyObject *__pyx_n_u_XmlOptionType; PyObject *__pyx_n_s_XmlSerialize; PyObject *__pyx_kp_u__2; PyObject *__pyx_n_s__3; PyObject *__pyx_n_s__32; PyObject *__pyx_n_s_args; PyObject *__pyx_n_s_ast; PyObject *__pyx_n_s_asyncio_coroutines; PyObject *__pyx_kp_u_at_index; PyObject *__pyx_kp_u_at_position; PyObject *__pyx_n_s_chr; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_collections; PyObject *__pyx_n_s_cstring; PyObject *__pyx_n_s_cur_offset; PyObject *__pyx_n_s_cursorpos; PyObject *__pyx_n_s_decode; PyObject *__pyx_n_s_deparse_protobuf; PyObject *__pyx_n_s_deparsed; PyObject *__pyx_n_s_dict; PyObject *__pyx_n_s_dict_2; PyObject *__pyx_kp_u_disable; PyObject *__pyx_n_s_doc; PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_end; PyObject *__pyx_n_u_end; PyObject *__pyx_n_s_enums; PyObject *__pyx_n_s_fingerprint; PyObject *__pyx_kp_u_gc; PyObject *__pyx_n_s_get_postgresql_version; PyObject *__pyx_n_s_getstate; PyObject *__pyx_n_s_i; PyObject *__pyx_n_s_import; PyObject *__pyx_n_s_index; PyObject *__pyx_n_s_init_subclass; PyObject *__pyx_n_s_is_coroutine; PyObject *__pyx_kp_u_isenabled; PyObject *__pyx_n_s_item; PyObject *__pyx_n_u_kind; PyObject *__pyx_n_s_kwkind; PyObject *__pyx_n_s_location; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_major; PyObject *__pyx_n_s_mctx; PyObject *__pyx_n_s_message; PyObject *__pyx_n_s_metaclass; PyObject *__pyx_n_s_minor; PyObject *__pyx_n_s_module; PyObject *__pyx_n_s_mro_entries; PyObject *__pyx_n_s_name; PyObject *__pyx_n_u_name_2; PyObject *__pyx_n_s_namedtuple; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_offset; PyObject *__pyx_n_s_offset_to_index; PyObject *__pyx_n_s_only_slices; PyObject *__pyx_n_s_parse_plpgsql_json; PyObject *__pyx_n_s_parse_sql; PyObject *__pyx_n_s_parse_sql_json; PyObject *__pyx_n_s_parse_sql_protobuf; PyObject *__pyx_n_s_parsed; PyObject *__pyx_n_s_pglast; PyObject *__pyx_n_s_pglast_parser; PyObject *__pyx_kp_s_pglast_parser_pyx; PyObject *__pyx_n_s_pickle; PyObject *__pyx_n_s_prepare; PyObject *__pyx_n_s_prev_offset; PyObject *__pyx_n_s_protobuf; PyObject *__pyx_n_s_pyx_PickleError; PyObject *__pyx_n_s_pyx_checksum; PyObject *__pyx_n_s_pyx_result; PyObject *__pyx_n_s_pyx_state; PyObject *__pyx_n_s_pyx_type; PyObject *__pyx_n_s_pyx_unpickle_Displacements; PyObject *__pyx_n_s_qualname; PyObject *__pyx_n_s_query; PyObject *__pyx_n_s_range; PyObject *__pyx_n_s_reduce; PyObject *__pyx_n_s_reduce_cython; PyObject *__pyx_n_s_reduce_ex; PyObject *__pyx_n_s_result; PyObject *__pyx_n_s_reversed; PyObject *__pyx_n_s_s; PyObject *__pyx_n_s_scan; PyObject *__pyx_n_s_scan_result; PyObject *__pyx_n_s_scan_token; PyObject *__pyx_n_s_scanned; PyObject *__pyx_n_s_self; PyObject *__pyx_n_s_set_name; PyObject *__pyx_n_s_setstate; PyObject *__pyx_n_s_setstate_cython; PyObject *__pyx_n_s_split; PyObject *__pyx_n_s_splitted; PyObject *__pyx_n_s_start; PyObject *__pyx_n_u_start; PyObject *__pyx_n_s_state; PyObject *__pyx_n_s_stmt; PyObject *__pyx_n_s_stmts; PyObject *__pyx_n_s_str; PyObject *__pyx_kp_s_stringsource; PyObject *__pyx_n_s_strip; PyObject *__pyx_n_s_super; PyObject *__pyx_n_s_test; PyObject *__pyx_n_s_tkind; PyObject *__pyx_n_s_token; PyObject *__pyx_n_s_tree; PyObject *__pyx_n_s_type; PyObject *__pyx_n_s_update; PyObject *__pyx_n_s_use_setstate; PyObject *__pyx_n_s_utf8; PyObject *__pyx_kp_u_utf_8; PyObject *__pyx_n_s_version; PyObject *__pyx_n_s_with_parser; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10000; PyObject *__pyx_int_37136258; PyObject *__pyx_int_48433145; PyObject *__pyx_int_124017984; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__4; PyObject *__pyx_tuple__7; PyObject *__pyx_tuple__9; PyObject *__pyx_tuple__11; PyObject *__pyx_tuple__13; PyObject *__pyx_tuple__15; PyObject *__pyx_tuple__17; PyObject *__pyx_tuple__20; PyObject *__pyx_tuple__22; PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; PyObject *__pyx_tuple__27; PyObject *__pyx_tuple__28; PyObject *__pyx_tuple__30; PyObject *__pyx_codeobj__5; PyObject *__pyx_codeobj__6; PyObject *__pyx_codeobj__8; PyObject *__pyx_codeobj__10; PyObject *__pyx_codeobj__12; PyObject *__pyx_codeobj__14; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; PyObject *__pyx_codeobj__19; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__31; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else static __pyx_mstate __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; #endif /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_clear(PyObject *m) { __pyx_mstate *clear_module_state = __pyx_mstate(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); Py_CLEAR(clear_module_state->__pyx_cython_runtime); Py_CLEAR(clear_module_state->__pyx_empty_tuple); Py_CLEAR(clear_module_state->__pyx_empty_bytes); Py_CLEAR(clear_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); Py_CLEAR(clear_module_state->__pyx_ptype_6pglast_6parser_Displacements); Py_CLEAR(clear_module_state->__pyx_type_6pglast_6parser_Displacements); Py_CLEAR(clear_module_state->__pyx_n_s_A_ArrayExpr); Py_CLEAR(clear_module_state->__pyx_n_s_A_Const); Py_CLEAR(clear_module_state->__pyx_n_s_A_Expr); Py_CLEAR(clear_module_state->__pyx_n_u_A_Expr_Kind); Py_CLEAR(clear_module_state->__pyx_n_s_A_Indices); Py_CLEAR(clear_module_state->__pyx_n_s_A_Indirection); Py_CLEAR(clear_module_state->__pyx_n_s_A_Star); Py_CLEAR(clear_module_state->__pyx_n_s_AccessPriv); Py_CLEAR(clear_module_state->__pyx_n_u_AggSplit); Py_CLEAR(clear_module_state->__pyx_n_s_Aggref); Py_CLEAR(clear_module_state->__pyx_n_s_Alias); Py_CLEAR(clear_module_state->__pyx_n_s_AlterCollationStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterDatabaseRefreshCollStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterDatabaseSetStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterDatabaseStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterDefaultPrivilegesStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterDomainStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterEnumStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterEventTrigStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterExtensionContentsStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterExtensionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterFdwStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterForeignServerStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterFunctionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterObjectDependsStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterObjectSchemaStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterOpFamilyStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterOperatorStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterOwnerStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterPolicyStmt); Py_CLEAR(clear_module_state->__pyx_n_u_AlterPublicationAction); Py_CLEAR(clear_module_state->__pyx_n_s_AlterPublicationStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterRoleSetStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterRoleStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterSeqStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterStatsStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterSubscriptionStmt); Py_CLEAR(clear_module_state->__pyx_n_u_AlterSubscriptionType); Py_CLEAR(clear_module_state->__pyx_n_s_AlterSystemStmt); Py_CLEAR(clear_module_state->__pyx_n_u_AlterTSConfigType); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTSConfigurationStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTSDictionaryStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTableCmd); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTableMoveAllStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTableSpaceOptionsStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTableStmt); Py_CLEAR(clear_module_state->__pyx_n_u_AlterTableType); Py_CLEAR(clear_module_state->__pyx_n_s_AlterTypeStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlterUserMappingStmt); Py_CLEAR(clear_module_state->__pyx_n_s_AlternativeSubPlan); Py_CLEAR(clear_module_state->__pyx_n_s_ArrayCoerceExpr); Py_CLEAR(clear_module_state->__pyx_n_s_ArrayExpr); Py_CLEAR(clear_module_state->__pyx_n_s_BitString); Py_CLEAR(clear_module_state->__pyx_n_s_BoolExpr); Py_CLEAR(clear_module_state->__pyx_n_u_BoolExprType); Py_CLEAR(clear_module_state->__pyx_n_u_BoolTestType); Py_CLEAR(clear_module_state->__pyx_n_s_Boolean); Py_CLEAR(clear_module_state->__pyx_n_s_BooleanTest); Py_CLEAR(clear_module_state->__pyx_n_s_CTECycleClause); Py_CLEAR(clear_module_state->__pyx_n_u_CTEMaterialize); Py_CLEAR(clear_module_state->__pyx_n_s_CTESearchClause); Py_CLEAR(clear_module_state->__pyx_n_s_CallContext); Py_CLEAR(clear_module_state->__pyx_n_s_CallStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CaseExpr); Py_CLEAR(clear_module_state->__pyx_n_s_CaseTestExpr); Py_CLEAR(clear_module_state->__pyx_n_s_CaseWhen); Py_CLEAR(clear_module_state->__pyx_n_s_CheckPointStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ClosePortalStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ClusterStmt); Py_CLEAR(clear_module_state->__pyx_n_u_CmdType); Py_CLEAR(clear_module_state->__pyx_n_s_CoalesceExpr); Py_CLEAR(clear_module_state->__pyx_n_s_CoerceToDomain); Py_CLEAR(clear_module_state->__pyx_n_s_CoerceToDomainValue); Py_CLEAR(clear_module_state->__pyx_n_s_CoerceViaIO); Py_CLEAR(clear_module_state->__pyx_n_u_CoercionContext); Py_CLEAR(clear_module_state->__pyx_n_u_CoercionForm); Py_CLEAR(clear_module_state->__pyx_n_s_CollateClause); Py_CLEAR(clear_module_state->__pyx_n_s_CollateExpr); Py_CLEAR(clear_module_state->__pyx_n_s_ColumnDef); Py_CLEAR(clear_module_state->__pyx_n_s_ColumnRef); Py_CLEAR(clear_module_state->__pyx_n_s_CommentStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CommonTableExpr); Py_CLEAR(clear_module_state->__pyx_n_s_CompositeTypeStmt); Py_CLEAR(clear_module_state->__pyx_n_u_ConstrType); Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); Py_CLEAR(clear_module_state->__pyx_n_s_ConstraintsSetStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ConvertRowtypeExpr); Py_CLEAR(clear_module_state->__pyx_n_s_CopyStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateAmStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateCastStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateConversionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateDomainStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateEnumStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateEventTrigStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateExtensionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateFdwStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateForeignServerStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateForeignTableStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateFunctionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateOpClassItem); Py_CLEAR(clear_module_state->__pyx_n_s_CreateOpClassStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateOpFamilyStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreatePLangStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreatePolicyStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreatePublicationStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateRangeStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateRoleStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateSchemaStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateSeqStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateStatsStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateSubscriptionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateTableAsStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateTableSpaceStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateTransformStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateTrigStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreateUserMappingStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CreatedbStmt); Py_CLEAR(clear_module_state->__pyx_n_s_CurrentOfExpr); Py_CLEAR(clear_module_state->__pyx_n_s_DeallocateStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DeclareCursorStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DefElem); Py_CLEAR(clear_module_state->__pyx_n_u_DefElemAction); Py_CLEAR(clear_module_state->__pyx_n_s_DefineStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DeleteStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DeparseError); Py_CLEAR(clear_module_state->__pyx_n_s_DeparseError___str); Py_CLEAR(clear_module_state->__pyx_n_u_DiscardMode); Py_CLEAR(clear_module_state->__pyx_n_s_DiscardStmt); Py_CLEAR(clear_module_state->__pyx_n_s_Displacements); Py_CLEAR(clear_module_state->__pyx_n_s_Displacements___reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_Displacements___setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_DoStmt); Py_CLEAR(clear_module_state->__pyx_n_u_DropBehavior); Py_CLEAR(clear_module_state->__pyx_n_s_DropOwnedStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DropRoleStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DropStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DropSubscriptionStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DropTableSpaceStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DropUserMappingStmt); Py_CLEAR(clear_module_state->__pyx_n_s_DropdbStmt); Py_CLEAR(clear_module_state->__pyx_n_s_Error); Py_CLEAR(clear_module_state->__pyx_kp_s_Exception_representing_the_error); Py_CLEAR(clear_module_state->__pyx_kp_s_Exception_representing_the_error_2); Py_CLEAR(clear_module_state->__pyx_n_s_ExecuteStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ExplainStmt); Py_CLEAR(clear_module_state->__pyx_n_u_FetchDirection); Py_CLEAR(clear_module_state->__pyx_n_s_FetchStmt); Py_CLEAR(clear_module_state->__pyx_n_s_FieldSelect); Py_CLEAR(clear_module_state->__pyx_n_s_FieldStore); Py_CLEAR(clear_module_state->__pyx_n_s_Float); Py_CLEAR(clear_module_state->__pyx_n_s_FromExpr); Py_CLEAR(clear_module_state->__pyx_n_s_FuncCall); Py_CLEAR(clear_module_state->__pyx_n_s_FuncExpr); Py_CLEAR(clear_module_state->__pyx_n_s_FunctionParameter); Py_CLEAR(clear_module_state->__pyx_n_u_FunctionParameterMode); Py_CLEAR(clear_module_state->__pyx_n_s_GrantRoleStmt); Py_CLEAR(clear_module_state->__pyx_n_s_GrantStmt); Py_CLEAR(clear_module_state->__pyx_n_u_GrantTargetType); Py_CLEAR(clear_module_state->__pyx_n_s_GroupingFunc); Py_CLEAR(clear_module_state->__pyx_n_s_GroupingSet); Py_CLEAR(clear_module_state->__pyx_n_u_GroupingSetKind); Py_CLEAR(clear_module_state->__pyx_n_s_ImportForeignSchemaStmt); Py_CLEAR(clear_module_state->__pyx_n_u_ImportForeignSchemaType); Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_CLEAR(clear_module_state->__pyx_n_s_IndexElem); Py_CLEAR(clear_module_state->__pyx_n_s_IndexStmt); Py_CLEAR(clear_module_state->__pyx_n_s_InferClause); Py_CLEAR(clear_module_state->__pyx_n_s_InferenceElem); Py_CLEAR(clear_module_state->__pyx_n_s_InlineCodeBlock); Py_CLEAR(clear_module_state->__pyx_n_s_InsertStmt); Py_CLEAR(clear_module_state->__pyx_n_s_Integer); Py_CLEAR(clear_module_state->__pyx_n_s_IntoClause); Py_CLEAR(clear_module_state->__pyx_n_s_JoinExpr); Py_CLEAR(clear_module_state->__pyx_n_u_JoinType); Py_CLEAR(clear_module_state->__pyx_n_s_JsonAggConstructor); Py_CLEAR(clear_module_state->__pyx_n_s_JsonArgument); Py_CLEAR(clear_module_state->__pyx_n_s_JsonArrayAgg); Py_CLEAR(clear_module_state->__pyx_n_s_JsonArrayConstructor); Py_CLEAR(clear_module_state->__pyx_n_s_JsonArrayQueryConstructor); Py_CLEAR(clear_module_state->__pyx_n_s_JsonBehavior); Py_CLEAR(clear_module_state->__pyx_n_u_JsonBehaviorType); Py_CLEAR(clear_module_state->__pyx_n_s_JsonConstructorExpr); Py_CLEAR(clear_module_state->__pyx_n_u_JsonConstructorType); Py_CLEAR(clear_module_state->__pyx_n_u_JsonEncoding); Py_CLEAR(clear_module_state->__pyx_n_s_JsonExpr); Py_CLEAR(clear_module_state->__pyx_n_u_JsonExprOp); Py_CLEAR(clear_module_state->__pyx_n_s_JsonFormat); Py_CLEAR(clear_module_state->__pyx_n_u_JsonFormatType); Py_CLEAR(clear_module_state->__pyx_n_s_JsonFuncExpr); Py_CLEAR(clear_module_state->__pyx_n_s_JsonIsPredicate); Py_CLEAR(clear_module_state->__pyx_n_s_JsonKeyValue); Py_CLEAR(clear_module_state->__pyx_n_s_JsonObjectAgg); Py_CLEAR(clear_module_state->__pyx_n_s_JsonObjectConstructor); Py_CLEAR(clear_module_state->__pyx_n_s_JsonOutput); Py_CLEAR(clear_module_state->__pyx_n_s_JsonParseExpr); Py_CLEAR(clear_module_state->__pyx_n_u_JsonQuotes); Py_CLEAR(clear_module_state->__pyx_n_s_JsonReturning); Py_CLEAR(clear_module_state->__pyx_n_s_JsonScalarExpr); Py_CLEAR(clear_module_state->__pyx_n_s_JsonSerializeExpr); Py_CLEAR(clear_module_state->__pyx_n_s_JsonTable); Py_CLEAR(clear_module_state->__pyx_n_s_JsonTableColumn); Py_CLEAR(clear_module_state->__pyx_n_u_JsonTableColumnType); Py_CLEAR(clear_module_state->__pyx_n_s_JsonTablePathSpec); Py_CLEAR(clear_module_state->__pyx_n_s_JsonValueExpr); Py_CLEAR(clear_module_state->__pyx_n_u_JsonValueType); Py_CLEAR(clear_module_state->__pyx_n_u_JsonWrapper); Py_CLEAR(clear_module_state->__pyx_n_s_LONG_MAX); Py_CLEAR(clear_module_state->__pyx_n_u_LimitOption); Py_CLEAR(clear_module_state->__pyx_n_s_ListenStmt); Py_CLEAR(clear_module_state->__pyx_n_s_LoadStmt); Py_CLEAR(clear_module_state->__pyx_n_u_LockClauseStrength); Py_CLEAR(clear_module_state->__pyx_n_s_LockStmt); Py_CLEAR(clear_module_state->__pyx_n_u_LockWaitPolicy); Py_CLEAR(clear_module_state->__pyx_n_s_LockingClause); Py_CLEAR(clear_module_state->__pyx_n_s_MergeAction); Py_CLEAR(clear_module_state->__pyx_n_u_MergeMatchKind); Py_CLEAR(clear_module_state->__pyx_n_s_MergeStmt); Py_CLEAR(clear_module_state->__pyx_n_s_MergeSupportFunc); Py_CLEAR(clear_module_state->__pyx_n_s_MergeWhenClause); Py_CLEAR(clear_module_state->__pyx_n_s_MinMaxExpr); Py_CLEAR(clear_module_state->__pyx_n_u_MinMaxOp); Py_CLEAR(clear_module_state->__pyx_n_s_MultiAssignRef); Py_CLEAR(clear_module_state->__pyx_n_s_NamedArgExpr); Py_CLEAR(clear_module_state->__pyx_n_s_NotifyStmt); Py_CLEAR(clear_module_state->__pyx_n_s_NullTest); Py_CLEAR(clear_module_state->__pyx_n_u_NullTestType); Py_CLEAR(clear_module_state->__pyx_n_u_ObjectType); Py_CLEAR(clear_module_state->__pyx_n_s_ObjectWithArgs); Py_CLEAR(clear_module_state->__pyx_n_u_OnCommitAction); Py_CLEAR(clear_module_state->__pyx_n_u_OnConflictAction); Py_CLEAR(clear_module_state->__pyx_n_s_OnConflictClause); Py_CLEAR(clear_module_state->__pyx_n_s_OnConflictExpr); Py_CLEAR(clear_module_state->__pyx_n_s_OpExpr); Py_CLEAR(clear_module_state->__pyx_n_u_OverridingKind); Py_CLEAR(clear_module_state->__pyx_n_s_PLAssignStmt); Py_CLEAR(clear_module_state->__pyx_n_s_Param); Py_CLEAR(clear_module_state->__pyx_n_u_ParamKind); Py_CLEAR(clear_module_state->__pyx_n_s_ParamRef); Py_CLEAR(clear_module_state->__pyx_n_s_ParseError); Py_CLEAR(clear_module_state->__pyx_n_s_ParseError___str); Py_CLEAR(clear_module_state->__pyx_n_s_PartitionBoundSpec); Py_CLEAR(clear_module_state->__pyx_n_s_PartitionCmd); Py_CLEAR(clear_module_state->__pyx_n_s_PartitionElem); Py_CLEAR(clear_module_state->__pyx_n_s_PartitionRangeDatum); Py_CLEAR(clear_module_state->__pyx_n_u_PartitionRangeDatumKind); Py_CLEAR(clear_module_state->__pyx_n_s_PartitionSpec); Py_CLEAR(clear_module_state->__pyx_n_u_PartitionStrategy); Py_CLEAR(clear_module_state->__pyx_n_s_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_PrepareStmt); Py_CLEAR(clear_module_state->__pyx_n_s_PublicationObjSpec); Py_CLEAR(clear_module_state->__pyx_n_u_PublicationObjSpecType); Py_CLEAR(clear_module_state->__pyx_n_s_PublicationTable); Py_CLEAR(clear_module_state->__pyx_n_s_Query); Py_CLEAR(clear_module_state->__pyx_n_u_QuerySource); Py_CLEAR(clear_module_state->__pyx_n_u_RTEKind); Py_CLEAR(clear_module_state->__pyx_n_s_RTEPermissionInfo); Py_CLEAR(clear_module_state->__pyx_n_s_RangeFunction); Py_CLEAR(clear_module_state->__pyx_n_s_RangeSubselect); Py_CLEAR(clear_module_state->__pyx_n_s_RangeTableFunc); Py_CLEAR(clear_module_state->__pyx_n_s_RangeTableFuncCol); Py_CLEAR(clear_module_state->__pyx_n_s_RangeTableSample); Py_CLEAR(clear_module_state->__pyx_n_s_RangeTblEntry); Py_CLEAR(clear_module_state->__pyx_n_s_RangeTblFunction); Py_CLEAR(clear_module_state->__pyx_n_s_RangeTblRef); Py_CLEAR(clear_module_state->__pyx_n_s_RangeVar); Py_CLEAR(clear_module_state->__pyx_n_s_RawStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ReassignOwnedStmt); Py_CLEAR(clear_module_state->__pyx_n_s_RefreshMatViewStmt); Py_CLEAR(clear_module_state->__pyx_n_u_ReindexObjectType); Py_CLEAR(clear_module_state->__pyx_n_s_ReindexStmt); Py_CLEAR(clear_module_state->__pyx_n_s_RelabelType); Py_CLEAR(clear_module_state->__pyx_n_s_RenameStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ReplicaIdentityStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ResTarget); Py_CLEAR(clear_module_state->__pyx_n_s_ReturnStmt); Py_CLEAR(clear_module_state->__pyx_n_s_RoleSpec); Py_CLEAR(clear_module_state->__pyx_n_u_RoleSpecType); Py_CLEAR(clear_module_state->__pyx_n_u_RoleStmtType); Py_CLEAR(clear_module_state->__pyx_n_s_RowCompareExpr); Py_CLEAR(clear_module_state->__pyx_n_u_RowCompareType); Py_CLEAR(clear_module_state->__pyx_n_s_RowExpr); Py_CLEAR(clear_module_state->__pyx_n_s_RowMarkClause); Py_CLEAR(clear_module_state->__pyx_n_s_RuleStmt); Py_CLEAR(clear_module_state->__pyx_n_s_SQLValueFunction); Py_CLEAR(clear_module_state->__pyx_n_u_SQLValueFunctionOp); Py_CLEAR(clear_module_state->__pyx_n_s_ScalarArrayOpExpr); Py_CLEAR(clear_module_state->__pyx_n_s_SecLabelStmt); Py_CLEAR(clear_module_state->__pyx_n_s_SelectStmt); Py_CLEAR(clear_module_state->__pyx_n_u_SetOperation); Py_CLEAR(clear_module_state->__pyx_n_s_SetOperationStmt); Py_CLEAR(clear_module_state->__pyx_n_s_SetToDefault); Py_CLEAR(clear_module_state->__pyx_n_s_SinglePartitionSpec); Py_CLEAR(clear_module_state->__pyx_n_s_SortBy); Py_CLEAR(clear_module_state->__pyx_n_u_SortByDir); Py_CLEAR(clear_module_state->__pyx_n_u_SortByNulls); Py_CLEAR(clear_module_state->__pyx_n_s_SortGroupClause); Py_CLEAR(clear_module_state->__pyx_n_s_StatsElem); Py_CLEAR(clear_module_state->__pyx_n_s_String); Py_CLEAR(clear_module_state->__pyx_n_s_SubLink); Py_CLEAR(clear_module_state->__pyx_n_u_SubLinkType); Py_CLEAR(clear_module_state->__pyx_n_s_SubPlan); Py_CLEAR(clear_module_state->__pyx_n_s_SubscriptingRef); Py_CLEAR(clear_module_state->__pyx_n_s_TableFunc); Py_CLEAR(clear_module_state->__pyx_n_u_TableFuncType); Py_CLEAR(clear_module_state->__pyx_n_s_TableLikeClause); Py_CLEAR(clear_module_state->__pyx_n_s_TableSampleClause); Py_CLEAR(clear_module_state->__pyx_n_s_TargetEntry); Py_CLEAR(clear_module_state->__pyx_n_s_Token); Py_CLEAR(clear_module_state->__pyx_n_u_Token); Py_CLEAR(clear_module_state->__pyx_n_s_TransactionStmt); Py_CLEAR(clear_module_state->__pyx_n_u_TransactionStmtKind); Py_CLEAR(clear_module_state->__pyx_n_s_TriggerTransition); Py_CLEAR(clear_module_state->__pyx_n_s_TruncateStmt); Py_CLEAR(clear_module_state->__pyx_n_s_TypeCast); Py_CLEAR(clear_module_state->__pyx_n_s_TypeName); Py_CLEAR(clear_module_state->__pyx_n_u_UNKNOWN); Py_CLEAR(clear_module_state->__pyx_kp_u_Unhandled_tag_s); Py_CLEAR(clear_module_state->__pyx_n_s_UnlistenStmt); Py_CLEAR(clear_module_state->__pyx_n_s_UpdateStmt); Py_CLEAR(clear_module_state->__pyx_n_s_VacuumRelation); Py_CLEAR(clear_module_state->__pyx_n_s_VacuumStmt); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s_Var); Py_CLEAR(clear_module_state->__pyx_n_u_VariableSetKind); Py_CLEAR(clear_module_state->__pyx_n_s_VariableSetStmt); Py_CLEAR(clear_module_state->__pyx_n_s_VariableShowStmt); Py_CLEAR(clear_module_state->__pyx_n_u_ViewCheckOption); Py_CLEAR(clear_module_state->__pyx_n_s_ViewStmt); Py_CLEAR(clear_module_state->__pyx_n_u_WCOKind); Py_CLEAR(clear_module_state->__pyx_n_s_WindowClause); Py_CLEAR(clear_module_state->__pyx_n_s_WindowDef); Py_CLEAR(clear_module_state->__pyx_n_s_WindowFunc); Py_CLEAR(clear_module_state->__pyx_n_s_WindowFuncRunCondition); Py_CLEAR(clear_module_state->__pyx_n_s_WithCheckOption); Py_CLEAR(clear_module_state->__pyx_n_s_WithClause); Py_CLEAR(clear_module_state->__pyx_n_s_XmlExpr); Py_CLEAR(clear_module_state->__pyx_n_u_XmlExprOp); Py_CLEAR(clear_module_state->__pyx_n_u_XmlOptionType); Py_CLEAR(clear_module_state->__pyx_n_s_XmlSerialize); Py_CLEAR(clear_module_state->__pyx_kp_u__2); Py_CLEAR(clear_module_state->__pyx_n_s__3); Py_CLEAR(clear_module_state->__pyx_n_s__32); Py_CLEAR(clear_module_state->__pyx_n_s_args); Py_CLEAR(clear_module_state->__pyx_n_s_ast); Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); Py_CLEAR(clear_module_state->__pyx_kp_u_at_index); Py_CLEAR(clear_module_state->__pyx_kp_u_at_position); Py_CLEAR(clear_module_state->__pyx_n_s_chr); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_collections); Py_CLEAR(clear_module_state->__pyx_n_s_cstring); Py_CLEAR(clear_module_state->__pyx_n_s_cur_offset); Py_CLEAR(clear_module_state->__pyx_n_s_cursorpos); Py_CLEAR(clear_module_state->__pyx_n_s_decode); Py_CLEAR(clear_module_state->__pyx_n_s_deparse_protobuf); Py_CLEAR(clear_module_state->__pyx_n_s_deparsed); Py_CLEAR(clear_module_state->__pyx_n_s_dict); Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); Py_CLEAR(clear_module_state->__pyx_kp_u_disable); Py_CLEAR(clear_module_state->__pyx_n_s_doc); Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_end); Py_CLEAR(clear_module_state->__pyx_n_u_end); Py_CLEAR(clear_module_state->__pyx_n_s_enums); Py_CLEAR(clear_module_state->__pyx_n_s_fingerprint); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); Py_CLEAR(clear_module_state->__pyx_n_s_get_postgresql_version); Py_CLEAR(clear_module_state->__pyx_n_s_getstate); Py_CLEAR(clear_module_state->__pyx_n_s_i); Py_CLEAR(clear_module_state->__pyx_n_s_import); Py_CLEAR(clear_module_state->__pyx_n_s_index); Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); Py_CLEAR(clear_module_state->__pyx_n_s_item); Py_CLEAR(clear_module_state->__pyx_n_u_kind); Py_CLEAR(clear_module_state->__pyx_n_s_kwkind); Py_CLEAR(clear_module_state->__pyx_n_s_location); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_major); Py_CLEAR(clear_module_state->__pyx_n_s_mctx); Py_CLEAR(clear_module_state->__pyx_n_s_message); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); Py_CLEAR(clear_module_state->__pyx_n_s_minor); Py_CLEAR(clear_module_state->__pyx_n_s_module); Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_u_name_2); Py_CLEAR(clear_module_state->__pyx_n_s_namedtuple); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_offset); Py_CLEAR(clear_module_state->__pyx_n_s_offset_to_index); Py_CLEAR(clear_module_state->__pyx_n_s_only_slices); Py_CLEAR(clear_module_state->__pyx_n_s_parse_plpgsql_json); Py_CLEAR(clear_module_state->__pyx_n_s_parse_sql); Py_CLEAR(clear_module_state->__pyx_n_s_parse_sql_json); Py_CLEAR(clear_module_state->__pyx_n_s_parse_sql_protobuf); Py_CLEAR(clear_module_state->__pyx_n_s_parsed); Py_CLEAR(clear_module_state->__pyx_n_s_pglast); Py_CLEAR(clear_module_state->__pyx_n_s_pglast_parser); Py_CLEAR(clear_module_state->__pyx_kp_s_pglast_parser_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_pickle); Py_CLEAR(clear_module_state->__pyx_n_s_prepare); Py_CLEAR(clear_module_state->__pyx_n_s_prev_offset); Py_CLEAR(clear_module_state->__pyx_n_s_protobuf); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type); Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Displacements); Py_CLEAR(clear_module_state->__pyx_n_s_qualname); Py_CLEAR(clear_module_state->__pyx_n_s_query); Py_CLEAR(clear_module_state->__pyx_n_s_range); Py_CLEAR(clear_module_state->__pyx_n_s_reduce); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); Py_CLEAR(clear_module_state->__pyx_n_s_result); Py_CLEAR(clear_module_state->__pyx_n_s_reversed); Py_CLEAR(clear_module_state->__pyx_n_s_s); Py_CLEAR(clear_module_state->__pyx_n_s_scan); Py_CLEAR(clear_module_state->__pyx_n_s_scan_result); Py_CLEAR(clear_module_state->__pyx_n_s_scan_token); Py_CLEAR(clear_module_state->__pyx_n_s_scanned); Py_CLEAR(clear_module_state->__pyx_n_s_self); Py_CLEAR(clear_module_state->__pyx_n_s_set_name); Py_CLEAR(clear_module_state->__pyx_n_s_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); Py_CLEAR(clear_module_state->__pyx_n_s_split); Py_CLEAR(clear_module_state->__pyx_n_s_splitted); Py_CLEAR(clear_module_state->__pyx_n_s_start); Py_CLEAR(clear_module_state->__pyx_n_u_start); Py_CLEAR(clear_module_state->__pyx_n_s_state); Py_CLEAR(clear_module_state->__pyx_n_s_stmt); Py_CLEAR(clear_module_state->__pyx_n_s_stmts); Py_CLEAR(clear_module_state->__pyx_n_s_str); Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); Py_CLEAR(clear_module_state->__pyx_n_s_strip); Py_CLEAR(clear_module_state->__pyx_n_s_super); Py_CLEAR(clear_module_state->__pyx_n_s_test); Py_CLEAR(clear_module_state->__pyx_n_s_tkind); Py_CLEAR(clear_module_state->__pyx_n_s_token); Py_CLEAR(clear_module_state->__pyx_n_s_tree); Py_CLEAR(clear_module_state->__pyx_n_s_type); Py_CLEAR(clear_module_state->__pyx_n_s_update); Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate); Py_CLEAR(clear_module_state->__pyx_n_s_utf8); Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8); Py_CLEAR(clear_module_state->__pyx_n_s_version); Py_CLEAR(clear_module_state->__pyx_n_s_with_parser); Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_10000); Py_CLEAR(clear_module_state->__pyx_int_37136258); Py_CLEAR(clear_module_state->__pyx_int_48433145); Py_CLEAR(clear_module_state->__pyx_int_124017984); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__4); Py_CLEAR(clear_module_state->__pyx_tuple__7); Py_CLEAR(clear_module_state->__pyx_tuple__9); Py_CLEAR(clear_module_state->__pyx_tuple__11); Py_CLEAR(clear_module_state->__pyx_tuple__13); Py_CLEAR(clear_module_state->__pyx_tuple__15); Py_CLEAR(clear_module_state->__pyx_tuple__17); Py_CLEAR(clear_module_state->__pyx_tuple__20); Py_CLEAR(clear_module_state->__pyx_tuple__22); Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); Py_CLEAR(clear_module_state->__pyx_tuple__27); Py_CLEAR(clear_module_state->__pyx_tuple__28); Py_CLEAR(clear_module_state->__pyx_tuple__30); Py_CLEAR(clear_module_state->__pyx_codeobj__5); Py_CLEAR(clear_module_state->__pyx_codeobj__6); Py_CLEAR(clear_module_state->__pyx_codeobj__8); Py_CLEAR(clear_module_state->__pyx_codeobj__10); Py_CLEAR(clear_module_state->__pyx_codeobj__12); Py_CLEAR(clear_module_state->__pyx_codeobj__14); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); Py_CLEAR(clear_module_state->__pyx_codeobj__19); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__31); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { __pyx_mstate *traverse_module_state = __pyx_mstate(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); Py_VISIT(traverse_module_state->__pyx_empty_tuple); Py_VISIT(traverse_module_state->__pyx_empty_bytes); Py_VISIT(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_6pglast_6parser_Displacements); Py_VISIT(traverse_module_state->__pyx_type_6pglast_6parser_Displacements); Py_VISIT(traverse_module_state->__pyx_n_s_A_ArrayExpr); Py_VISIT(traverse_module_state->__pyx_n_s_A_Const); Py_VISIT(traverse_module_state->__pyx_n_s_A_Expr); Py_VISIT(traverse_module_state->__pyx_n_u_A_Expr_Kind); Py_VISIT(traverse_module_state->__pyx_n_s_A_Indices); Py_VISIT(traverse_module_state->__pyx_n_s_A_Indirection); Py_VISIT(traverse_module_state->__pyx_n_s_A_Star); Py_VISIT(traverse_module_state->__pyx_n_s_AccessPriv); Py_VISIT(traverse_module_state->__pyx_n_u_AggSplit); Py_VISIT(traverse_module_state->__pyx_n_s_Aggref); Py_VISIT(traverse_module_state->__pyx_n_s_Alias); Py_VISIT(traverse_module_state->__pyx_n_s_AlterCollationStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterDatabaseRefreshCollStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterDatabaseSetStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterDatabaseStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterDefaultPrivilegesStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterDomainStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterEnumStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterEventTrigStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterExtensionContentsStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterExtensionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterFdwStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterForeignServerStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterFunctionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterObjectDependsStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterObjectSchemaStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterOpFamilyStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterOperatorStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterOwnerStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterPolicyStmt); Py_VISIT(traverse_module_state->__pyx_n_u_AlterPublicationAction); Py_VISIT(traverse_module_state->__pyx_n_s_AlterPublicationStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterRoleSetStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterRoleStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterSeqStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterStatsStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterSubscriptionStmt); Py_VISIT(traverse_module_state->__pyx_n_u_AlterSubscriptionType); Py_VISIT(traverse_module_state->__pyx_n_s_AlterSystemStmt); Py_VISIT(traverse_module_state->__pyx_n_u_AlterTSConfigType); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTSConfigurationStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTSDictionaryStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTableCmd); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTableMoveAllStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTableSpaceOptionsStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTableStmt); Py_VISIT(traverse_module_state->__pyx_n_u_AlterTableType); Py_VISIT(traverse_module_state->__pyx_n_s_AlterTypeStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlterUserMappingStmt); Py_VISIT(traverse_module_state->__pyx_n_s_AlternativeSubPlan); Py_VISIT(traverse_module_state->__pyx_n_s_ArrayCoerceExpr); Py_VISIT(traverse_module_state->__pyx_n_s_ArrayExpr); Py_VISIT(traverse_module_state->__pyx_n_s_BitString); Py_VISIT(traverse_module_state->__pyx_n_s_BoolExpr); Py_VISIT(traverse_module_state->__pyx_n_u_BoolExprType); Py_VISIT(traverse_module_state->__pyx_n_u_BoolTestType); Py_VISIT(traverse_module_state->__pyx_n_s_Boolean); Py_VISIT(traverse_module_state->__pyx_n_s_BooleanTest); Py_VISIT(traverse_module_state->__pyx_n_s_CTECycleClause); Py_VISIT(traverse_module_state->__pyx_n_u_CTEMaterialize); Py_VISIT(traverse_module_state->__pyx_n_s_CTESearchClause); Py_VISIT(traverse_module_state->__pyx_n_s_CallContext); Py_VISIT(traverse_module_state->__pyx_n_s_CallStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CaseExpr); Py_VISIT(traverse_module_state->__pyx_n_s_CaseTestExpr); Py_VISIT(traverse_module_state->__pyx_n_s_CaseWhen); Py_VISIT(traverse_module_state->__pyx_n_s_CheckPointStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ClosePortalStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ClusterStmt); Py_VISIT(traverse_module_state->__pyx_n_u_CmdType); Py_VISIT(traverse_module_state->__pyx_n_s_CoalesceExpr); Py_VISIT(traverse_module_state->__pyx_n_s_CoerceToDomain); Py_VISIT(traverse_module_state->__pyx_n_s_CoerceToDomainValue); Py_VISIT(traverse_module_state->__pyx_n_s_CoerceViaIO); Py_VISIT(traverse_module_state->__pyx_n_u_CoercionContext); Py_VISIT(traverse_module_state->__pyx_n_u_CoercionForm); Py_VISIT(traverse_module_state->__pyx_n_s_CollateClause); Py_VISIT(traverse_module_state->__pyx_n_s_CollateExpr); Py_VISIT(traverse_module_state->__pyx_n_s_ColumnDef); Py_VISIT(traverse_module_state->__pyx_n_s_ColumnRef); Py_VISIT(traverse_module_state->__pyx_n_s_CommentStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CommonTableExpr); Py_VISIT(traverse_module_state->__pyx_n_s_CompositeTypeStmt); Py_VISIT(traverse_module_state->__pyx_n_u_ConstrType); Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); Py_VISIT(traverse_module_state->__pyx_n_s_ConstraintsSetStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ConvertRowtypeExpr); Py_VISIT(traverse_module_state->__pyx_n_s_CopyStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateAmStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateCastStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateConversionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateDomainStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateEnumStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateEventTrigStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateExtensionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateFdwStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateForeignServerStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateForeignTableStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateFunctionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateOpClassItem); Py_VISIT(traverse_module_state->__pyx_n_s_CreateOpClassStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateOpFamilyStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreatePLangStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreatePolicyStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreatePublicationStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateRangeStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateRoleStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateSchemaStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateSeqStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateStatsStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateSubscriptionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateTableAsStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateTableSpaceStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateTransformStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateTrigStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreateUserMappingStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CreatedbStmt); Py_VISIT(traverse_module_state->__pyx_n_s_CurrentOfExpr); Py_VISIT(traverse_module_state->__pyx_n_s_DeallocateStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DeclareCursorStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DefElem); Py_VISIT(traverse_module_state->__pyx_n_u_DefElemAction); Py_VISIT(traverse_module_state->__pyx_n_s_DefineStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DeleteStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DeparseError); Py_VISIT(traverse_module_state->__pyx_n_s_DeparseError___str); Py_VISIT(traverse_module_state->__pyx_n_u_DiscardMode); Py_VISIT(traverse_module_state->__pyx_n_s_DiscardStmt); Py_VISIT(traverse_module_state->__pyx_n_s_Displacements); Py_VISIT(traverse_module_state->__pyx_n_s_Displacements___reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_Displacements___setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_DoStmt); Py_VISIT(traverse_module_state->__pyx_n_u_DropBehavior); Py_VISIT(traverse_module_state->__pyx_n_s_DropOwnedStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DropRoleStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DropStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DropSubscriptionStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DropTableSpaceStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DropUserMappingStmt); Py_VISIT(traverse_module_state->__pyx_n_s_DropdbStmt); Py_VISIT(traverse_module_state->__pyx_n_s_Error); Py_VISIT(traverse_module_state->__pyx_kp_s_Exception_representing_the_error); Py_VISIT(traverse_module_state->__pyx_kp_s_Exception_representing_the_error_2); Py_VISIT(traverse_module_state->__pyx_n_s_ExecuteStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ExplainStmt); Py_VISIT(traverse_module_state->__pyx_n_u_FetchDirection); Py_VISIT(traverse_module_state->__pyx_n_s_FetchStmt); Py_VISIT(traverse_module_state->__pyx_n_s_FieldSelect); Py_VISIT(traverse_module_state->__pyx_n_s_FieldStore); Py_VISIT(traverse_module_state->__pyx_n_s_Float); Py_VISIT(traverse_module_state->__pyx_n_s_FromExpr); Py_VISIT(traverse_module_state->__pyx_n_s_FuncCall); Py_VISIT(traverse_module_state->__pyx_n_s_FuncExpr); Py_VISIT(traverse_module_state->__pyx_n_s_FunctionParameter); Py_VISIT(traverse_module_state->__pyx_n_u_FunctionParameterMode); Py_VISIT(traverse_module_state->__pyx_n_s_GrantRoleStmt); Py_VISIT(traverse_module_state->__pyx_n_s_GrantStmt); Py_VISIT(traverse_module_state->__pyx_n_u_GrantTargetType); Py_VISIT(traverse_module_state->__pyx_n_s_GroupingFunc); Py_VISIT(traverse_module_state->__pyx_n_s_GroupingSet); Py_VISIT(traverse_module_state->__pyx_n_u_GroupingSetKind); Py_VISIT(traverse_module_state->__pyx_n_s_ImportForeignSchemaStmt); Py_VISIT(traverse_module_state->__pyx_n_u_ImportForeignSchemaType); Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0); Py_VISIT(traverse_module_state->__pyx_n_s_IndexElem); Py_VISIT(traverse_module_state->__pyx_n_s_IndexStmt); Py_VISIT(traverse_module_state->__pyx_n_s_InferClause); Py_VISIT(traverse_module_state->__pyx_n_s_InferenceElem); Py_VISIT(traverse_module_state->__pyx_n_s_InlineCodeBlock); Py_VISIT(traverse_module_state->__pyx_n_s_InsertStmt); Py_VISIT(traverse_module_state->__pyx_n_s_Integer); Py_VISIT(traverse_module_state->__pyx_n_s_IntoClause); Py_VISIT(traverse_module_state->__pyx_n_s_JoinExpr); Py_VISIT(traverse_module_state->__pyx_n_u_JoinType); Py_VISIT(traverse_module_state->__pyx_n_s_JsonAggConstructor); Py_VISIT(traverse_module_state->__pyx_n_s_JsonArgument); Py_VISIT(traverse_module_state->__pyx_n_s_JsonArrayAgg); Py_VISIT(traverse_module_state->__pyx_n_s_JsonArrayConstructor); Py_VISIT(traverse_module_state->__pyx_n_s_JsonArrayQueryConstructor); Py_VISIT(traverse_module_state->__pyx_n_s_JsonBehavior); Py_VISIT(traverse_module_state->__pyx_n_u_JsonBehaviorType); Py_VISIT(traverse_module_state->__pyx_n_s_JsonConstructorExpr); Py_VISIT(traverse_module_state->__pyx_n_u_JsonConstructorType); Py_VISIT(traverse_module_state->__pyx_n_u_JsonEncoding); Py_VISIT(traverse_module_state->__pyx_n_s_JsonExpr); Py_VISIT(traverse_module_state->__pyx_n_u_JsonExprOp); Py_VISIT(traverse_module_state->__pyx_n_s_JsonFormat); Py_VISIT(traverse_module_state->__pyx_n_u_JsonFormatType); Py_VISIT(traverse_module_state->__pyx_n_s_JsonFuncExpr); Py_VISIT(traverse_module_state->__pyx_n_s_JsonIsPredicate); Py_VISIT(traverse_module_state->__pyx_n_s_JsonKeyValue); Py_VISIT(traverse_module_state->__pyx_n_s_JsonObjectAgg); Py_VISIT(traverse_module_state->__pyx_n_s_JsonObjectConstructor); Py_VISIT(traverse_module_state->__pyx_n_s_JsonOutput); Py_VISIT(traverse_module_state->__pyx_n_s_JsonParseExpr); Py_VISIT(traverse_module_state->__pyx_n_u_JsonQuotes); Py_VISIT(traverse_module_state->__pyx_n_s_JsonReturning); Py_VISIT(traverse_module_state->__pyx_n_s_JsonScalarExpr); Py_VISIT(traverse_module_state->__pyx_n_s_JsonSerializeExpr); Py_VISIT(traverse_module_state->__pyx_n_s_JsonTable); Py_VISIT(traverse_module_state->__pyx_n_s_JsonTableColumn); Py_VISIT(traverse_module_state->__pyx_n_u_JsonTableColumnType); Py_VISIT(traverse_module_state->__pyx_n_s_JsonTablePathSpec); Py_VISIT(traverse_module_state->__pyx_n_s_JsonValueExpr); Py_VISIT(traverse_module_state->__pyx_n_u_JsonValueType); Py_VISIT(traverse_module_state->__pyx_n_u_JsonWrapper); Py_VISIT(traverse_module_state->__pyx_n_s_LONG_MAX); Py_VISIT(traverse_module_state->__pyx_n_u_LimitOption); Py_VISIT(traverse_module_state->__pyx_n_s_ListenStmt); Py_VISIT(traverse_module_state->__pyx_n_s_LoadStmt); Py_VISIT(traverse_module_state->__pyx_n_u_LockClauseStrength); Py_VISIT(traverse_module_state->__pyx_n_s_LockStmt); Py_VISIT(traverse_module_state->__pyx_n_u_LockWaitPolicy); Py_VISIT(traverse_module_state->__pyx_n_s_LockingClause); Py_VISIT(traverse_module_state->__pyx_n_s_MergeAction); Py_VISIT(traverse_module_state->__pyx_n_u_MergeMatchKind); Py_VISIT(traverse_module_state->__pyx_n_s_MergeStmt); Py_VISIT(traverse_module_state->__pyx_n_s_MergeSupportFunc); Py_VISIT(traverse_module_state->__pyx_n_s_MergeWhenClause); Py_VISIT(traverse_module_state->__pyx_n_s_MinMaxExpr); Py_VISIT(traverse_module_state->__pyx_n_u_MinMaxOp); Py_VISIT(traverse_module_state->__pyx_n_s_MultiAssignRef); Py_VISIT(traverse_module_state->__pyx_n_s_NamedArgExpr); Py_VISIT(traverse_module_state->__pyx_n_s_NotifyStmt); Py_VISIT(traverse_module_state->__pyx_n_s_NullTest); Py_VISIT(traverse_module_state->__pyx_n_u_NullTestType); Py_VISIT(traverse_module_state->__pyx_n_u_ObjectType); Py_VISIT(traverse_module_state->__pyx_n_s_ObjectWithArgs); Py_VISIT(traverse_module_state->__pyx_n_u_OnCommitAction); Py_VISIT(traverse_module_state->__pyx_n_u_OnConflictAction); Py_VISIT(traverse_module_state->__pyx_n_s_OnConflictClause); Py_VISIT(traverse_module_state->__pyx_n_s_OnConflictExpr); Py_VISIT(traverse_module_state->__pyx_n_s_OpExpr); Py_VISIT(traverse_module_state->__pyx_n_u_OverridingKind); Py_VISIT(traverse_module_state->__pyx_n_s_PLAssignStmt); Py_VISIT(traverse_module_state->__pyx_n_s_Param); Py_VISIT(traverse_module_state->__pyx_n_u_ParamKind); Py_VISIT(traverse_module_state->__pyx_n_s_ParamRef); Py_VISIT(traverse_module_state->__pyx_n_s_ParseError); Py_VISIT(traverse_module_state->__pyx_n_s_ParseError___str); Py_VISIT(traverse_module_state->__pyx_n_s_PartitionBoundSpec); Py_VISIT(traverse_module_state->__pyx_n_s_PartitionCmd); Py_VISIT(traverse_module_state->__pyx_n_s_PartitionElem); Py_VISIT(traverse_module_state->__pyx_n_s_PartitionRangeDatum); Py_VISIT(traverse_module_state->__pyx_n_u_PartitionRangeDatumKind); Py_VISIT(traverse_module_state->__pyx_n_s_PartitionSpec); Py_VISIT(traverse_module_state->__pyx_n_u_PartitionStrategy); Py_VISIT(traverse_module_state->__pyx_n_s_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_PrepareStmt); Py_VISIT(traverse_module_state->__pyx_n_s_PublicationObjSpec); Py_VISIT(traverse_module_state->__pyx_n_u_PublicationObjSpecType); Py_VISIT(traverse_module_state->__pyx_n_s_PublicationTable); Py_VISIT(traverse_module_state->__pyx_n_s_Query); Py_VISIT(traverse_module_state->__pyx_n_u_QuerySource); Py_VISIT(traverse_module_state->__pyx_n_u_RTEKind); Py_VISIT(traverse_module_state->__pyx_n_s_RTEPermissionInfo); Py_VISIT(traverse_module_state->__pyx_n_s_RangeFunction); Py_VISIT(traverse_module_state->__pyx_n_s_RangeSubselect); Py_VISIT(traverse_module_state->__pyx_n_s_RangeTableFunc); Py_VISIT(traverse_module_state->__pyx_n_s_RangeTableFuncCol); Py_VISIT(traverse_module_state->__pyx_n_s_RangeTableSample); Py_VISIT(traverse_module_state->__pyx_n_s_RangeTblEntry); Py_VISIT(traverse_module_state->__pyx_n_s_RangeTblFunction); Py_VISIT(traverse_module_state->__pyx_n_s_RangeTblRef); Py_VISIT(traverse_module_state->__pyx_n_s_RangeVar); Py_VISIT(traverse_module_state->__pyx_n_s_RawStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ReassignOwnedStmt); Py_VISIT(traverse_module_state->__pyx_n_s_RefreshMatViewStmt); Py_VISIT(traverse_module_state->__pyx_n_u_ReindexObjectType); Py_VISIT(traverse_module_state->__pyx_n_s_ReindexStmt); Py_VISIT(traverse_module_state->__pyx_n_s_RelabelType); Py_VISIT(traverse_module_state->__pyx_n_s_RenameStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ReplicaIdentityStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ResTarget); Py_VISIT(traverse_module_state->__pyx_n_s_ReturnStmt); Py_VISIT(traverse_module_state->__pyx_n_s_RoleSpec); Py_VISIT(traverse_module_state->__pyx_n_u_RoleSpecType); Py_VISIT(traverse_module_state->__pyx_n_u_RoleStmtType); Py_VISIT(traverse_module_state->__pyx_n_s_RowCompareExpr); Py_VISIT(traverse_module_state->__pyx_n_u_RowCompareType); Py_VISIT(traverse_module_state->__pyx_n_s_RowExpr); Py_VISIT(traverse_module_state->__pyx_n_s_RowMarkClause); Py_VISIT(traverse_module_state->__pyx_n_s_RuleStmt); Py_VISIT(traverse_module_state->__pyx_n_s_SQLValueFunction); Py_VISIT(traverse_module_state->__pyx_n_u_SQLValueFunctionOp); Py_VISIT(traverse_module_state->__pyx_n_s_ScalarArrayOpExpr); Py_VISIT(traverse_module_state->__pyx_n_s_SecLabelStmt); Py_VISIT(traverse_module_state->__pyx_n_s_SelectStmt); Py_VISIT(traverse_module_state->__pyx_n_u_SetOperation); Py_VISIT(traverse_module_state->__pyx_n_s_SetOperationStmt); Py_VISIT(traverse_module_state->__pyx_n_s_SetToDefault); Py_VISIT(traverse_module_state->__pyx_n_s_SinglePartitionSpec); Py_VISIT(traverse_module_state->__pyx_n_s_SortBy); Py_VISIT(traverse_module_state->__pyx_n_u_SortByDir); Py_VISIT(traverse_module_state->__pyx_n_u_SortByNulls); Py_VISIT(traverse_module_state->__pyx_n_s_SortGroupClause); Py_VISIT(traverse_module_state->__pyx_n_s_StatsElem); Py_VISIT(traverse_module_state->__pyx_n_s_String); Py_VISIT(traverse_module_state->__pyx_n_s_SubLink); Py_VISIT(traverse_module_state->__pyx_n_u_SubLinkType); Py_VISIT(traverse_module_state->__pyx_n_s_SubPlan); Py_VISIT(traverse_module_state->__pyx_n_s_SubscriptingRef); Py_VISIT(traverse_module_state->__pyx_n_s_TableFunc); Py_VISIT(traverse_module_state->__pyx_n_u_TableFuncType); Py_VISIT(traverse_module_state->__pyx_n_s_TableLikeClause); Py_VISIT(traverse_module_state->__pyx_n_s_TableSampleClause); Py_VISIT(traverse_module_state->__pyx_n_s_TargetEntry); Py_VISIT(traverse_module_state->__pyx_n_s_Token); Py_VISIT(traverse_module_state->__pyx_n_u_Token); Py_VISIT(traverse_module_state->__pyx_n_s_TransactionStmt); Py_VISIT(traverse_module_state->__pyx_n_u_TransactionStmtKind); Py_VISIT(traverse_module_state->__pyx_n_s_TriggerTransition); Py_VISIT(traverse_module_state->__pyx_n_s_TruncateStmt); Py_VISIT(traverse_module_state->__pyx_n_s_TypeCast); Py_VISIT(traverse_module_state->__pyx_n_s_TypeName); Py_VISIT(traverse_module_state->__pyx_n_u_UNKNOWN); Py_VISIT(traverse_module_state->__pyx_kp_u_Unhandled_tag_s); Py_VISIT(traverse_module_state->__pyx_n_s_UnlistenStmt); Py_VISIT(traverse_module_state->__pyx_n_s_UpdateStmt); Py_VISIT(traverse_module_state->__pyx_n_s_VacuumRelation); Py_VISIT(traverse_module_state->__pyx_n_s_VacuumStmt); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s_Var); Py_VISIT(traverse_module_state->__pyx_n_u_VariableSetKind); Py_VISIT(traverse_module_state->__pyx_n_s_VariableSetStmt); Py_VISIT(traverse_module_state->__pyx_n_s_VariableShowStmt); Py_VISIT(traverse_module_state->__pyx_n_u_ViewCheckOption); Py_VISIT(traverse_module_state->__pyx_n_s_ViewStmt); Py_VISIT(traverse_module_state->__pyx_n_u_WCOKind); Py_VISIT(traverse_module_state->__pyx_n_s_WindowClause); Py_VISIT(traverse_module_state->__pyx_n_s_WindowDef); Py_VISIT(traverse_module_state->__pyx_n_s_WindowFunc); Py_VISIT(traverse_module_state->__pyx_n_s_WindowFuncRunCondition); Py_VISIT(traverse_module_state->__pyx_n_s_WithCheckOption); Py_VISIT(traverse_module_state->__pyx_n_s_WithClause); Py_VISIT(traverse_module_state->__pyx_n_s_XmlExpr); Py_VISIT(traverse_module_state->__pyx_n_u_XmlExprOp); Py_VISIT(traverse_module_state->__pyx_n_u_XmlOptionType); Py_VISIT(traverse_module_state->__pyx_n_s_XmlSerialize); Py_VISIT(traverse_module_state->__pyx_kp_u__2); Py_VISIT(traverse_module_state->__pyx_n_s__3); Py_VISIT(traverse_module_state->__pyx_n_s__32); Py_VISIT(traverse_module_state->__pyx_n_s_args); Py_VISIT(traverse_module_state->__pyx_n_s_ast); Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); Py_VISIT(traverse_module_state->__pyx_kp_u_at_index); Py_VISIT(traverse_module_state->__pyx_kp_u_at_position); Py_VISIT(traverse_module_state->__pyx_n_s_chr); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_collections); Py_VISIT(traverse_module_state->__pyx_n_s_cstring); Py_VISIT(traverse_module_state->__pyx_n_s_cur_offset); Py_VISIT(traverse_module_state->__pyx_n_s_cursorpos); Py_VISIT(traverse_module_state->__pyx_n_s_decode); Py_VISIT(traverse_module_state->__pyx_n_s_deparse_protobuf); Py_VISIT(traverse_module_state->__pyx_n_s_deparsed); Py_VISIT(traverse_module_state->__pyx_n_s_dict); Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); Py_VISIT(traverse_module_state->__pyx_kp_u_disable); Py_VISIT(traverse_module_state->__pyx_n_s_doc); Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_end); Py_VISIT(traverse_module_state->__pyx_n_u_end); Py_VISIT(traverse_module_state->__pyx_n_s_enums); Py_VISIT(traverse_module_state->__pyx_n_s_fingerprint); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); Py_VISIT(traverse_module_state->__pyx_n_s_get_postgresql_version); Py_VISIT(traverse_module_state->__pyx_n_s_getstate); Py_VISIT(traverse_module_state->__pyx_n_s_i); Py_VISIT(traverse_module_state->__pyx_n_s_import); Py_VISIT(traverse_module_state->__pyx_n_s_index); Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); Py_VISIT(traverse_module_state->__pyx_n_s_item); Py_VISIT(traverse_module_state->__pyx_n_u_kind); Py_VISIT(traverse_module_state->__pyx_n_s_kwkind); Py_VISIT(traverse_module_state->__pyx_n_s_location); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_major); Py_VISIT(traverse_module_state->__pyx_n_s_mctx); Py_VISIT(traverse_module_state->__pyx_n_s_message); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); Py_VISIT(traverse_module_state->__pyx_n_s_minor); Py_VISIT(traverse_module_state->__pyx_n_s_module); Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_u_name_2); Py_VISIT(traverse_module_state->__pyx_n_s_namedtuple); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_offset); Py_VISIT(traverse_module_state->__pyx_n_s_offset_to_index); Py_VISIT(traverse_module_state->__pyx_n_s_only_slices); Py_VISIT(traverse_module_state->__pyx_n_s_parse_plpgsql_json); Py_VISIT(traverse_module_state->__pyx_n_s_parse_sql); Py_VISIT(traverse_module_state->__pyx_n_s_parse_sql_json); Py_VISIT(traverse_module_state->__pyx_n_s_parse_sql_protobuf); Py_VISIT(traverse_module_state->__pyx_n_s_parsed); Py_VISIT(traverse_module_state->__pyx_n_s_pglast); Py_VISIT(traverse_module_state->__pyx_n_s_pglast_parser); Py_VISIT(traverse_module_state->__pyx_kp_s_pglast_parser_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_pickle); Py_VISIT(traverse_module_state->__pyx_n_s_prepare); Py_VISIT(traverse_module_state->__pyx_n_s_prev_offset); Py_VISIT(traverse_module_state->__pyx_n_s_protobuf); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type); Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Displacements); Py_VISIT(traverse_module_state->__pyx_n_s_qualname); Py_VISIT(traverse_module_state->__pyx_n_s_query); Py_VISIT(traverse_module_state->__pyx_n_s_range); Py_VISIT(traverse_module_state->__pyx_n_s_reduce); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); Py_VISIT(traverse_module_state->__pyx_n_s_result); Py_VISIT(traverse_module_state->__pyx_n_s_reversed); Py_VISIT(traverse_module_state->__pyx_n_s_s); Py_VISIT(traverse_module_state->__pyx_n_s_scan); Py_VISIT(traverse_module_state->__pyx_n_s_scan_result); Py_VISIT(traverse_module_state->__pyx_n_s_scan_token); Py_VISIT(traverse_module_state->__pyx_n_s_scanned); Py_VISIT(traverse_module_state->__pyx_n_s_self); Py_VISIT(traverse_module_state->__pyx_n_s_set_name); Py_VISIT(traverse_module_state->__pyx_n_s_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); Py_VISIT(traverse_module_state->__pyx_n_s_split); Py_VISIT(traverse_module_state->__pyx_n_s_splitted); Py_VISIT(traverse_module_state->__pyx_n_s_start); Py_VISIT(traverse_module_state->__pyx_n_u_start); Py_VISIT(traverse_module_state->__pyx_n_s_state); Py_VISIT(traverse_module_state->__pyx_n_s_stmt); Py_VISIT(traverse_module_state->__pyx_n_s_stmts); Py_VISIT(traverse_module_state->__pyx_n_s_str); Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); Py_VISIT(traverse_module_state->__pyx_n_s_strip); Py_VISIT(traverse_module_state->__pyx_n_s_super); Py_VISIT(traverse_module_state->__pyx_n_s_test); Py_VISIT(traverse_module_state->__pyx_n_s_tkind); Py_VISIT(traverse_module_state->__pyx_n_s_token); Py_VISIT(traverse_module_state->__pyx_n_s_tree); Py_VISIT(traverse_module_state->__pyx_n_s_type); Py_VISIT(traverse_module_state->__pyx_n_s_update); Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate); Py_VISIT(traverse_module_state->__pyx_n_s_utf8); Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8); Py_VISIT(traverse_module_state->__pyx_n_s_version); Py_VISIT(traverse_module_state->__pyx_n_s_with_parser); Py_VISIT(traverse_module_state->__pyx_int_0); Py_VISIT(traverse_module_state->__pyx_int_1); Py_VISIT(traverse_module_state->__pyx_int_10000); Py_VISIT(traverse_module_state->__pyx_int_37136258); Py_VISIT(traverse_module_state->__pyx_int_48433145); Py_VISIT(traverse_module_state->__pyx_int_124017984); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__4); Py_VISIT(traverse_module_state->__pyx_tuple__7); Py_VISIT(traverse_module_state->__pyx_tuple__9); Py_VISIT(traverse_module_state->__pyx_tuple__11); Py_VISIT(traverse_module_state->__pyx_tuple__13); Py_VISIT(traverse_module_state->__pyx_tuple__15); Py_VISIT(traverse_module_state->__pyx_tuple__17); Py_VISIT(traverse_module_state->__pyx_tuple__20); Py_VISIT(traverse_module_state->__pyx_tuple__22); Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); Py_VISIT(traverse_module_state->__pyx_tuple__27); Py_VISIT(traverse_module_state->__pyx_tuple__28); Py_VISIT(traverse_module_state->__pyx_tuple__30); Py_VISIT(traverse_module_state->__pyx_codeobj__5); Py_VISIT(traverse_module_state->__pyx_codeobj__6); Py_VISIT(traverse_module_state->__pyx_codeobj__8); Py_VISIT(traverse_module_state->__pyx_codeobj__10); Py_VISIT(traverse_module_state->__pyx_codeobj__12); Py_VISIT(traverse_module_state->__pyx_codeobj__14); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); Py_VISIT(traverse_module_state->__pyx_codeobj__19); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__31); return 0; } #endif /* #### Code section: module_state_defines ### */ #define __pyx_d __pyx_mstate_global->__pyx_d #define __pyx_b __pyx_mstate_global->__pyx_b #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode #ifdef __Pyx_CyFunction_USED #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType #endif #ifdef __Pyx_FusedFunction_USED #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType #endif #ifdef __Pyx_Generator_USED #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType #endif #ifdef __Pyx_IterableCoroutine_USED #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType #endif #ifdef __Pyx_Coroutine_USED #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #endif #if CYTHON_USE_MODULE_STATE #define __pyx_type_6pglast_6parser_Displacements __pyx_mstate_global->__pyx_type_6pglast_6parser_Displacements #endif #define __pyx_ptype_6pglast_6parser_Displacements __pyx_mstate_global->__pyx_ptype_6pglast_6parser_Displacements #define __pyx_n_s_A_ArrayExpr __pyx_mstate_global->__pyx_n_s_A_ArrayExpr #define __pyx_n_s_A_Const __pyx_mstate_global->__pyx_n_s_A_Const #define __pyx_n_s_A_Expr __pyx_mstate_global->__pyx_n_s_A_Expr #define __pyx_n_u_A_Expr_Kind __pyx_mstate_global->__pyx_n_u_A_Expr_Kind #define __pyx_n_s_A_Indices __pyx_mstate_global->__pyx_n_s_A_Indices #define __pyx_n_s_A_Indirection __pyx_mstate_global->__pyx_n_s_A_Indirection #define __pyx_n_s_A_Star __pyx_mstate_global->__pyx_n_s_A_Star #define __pyx_n_s_AccessPriv __pyx_mstate_global->__pyx_n_s_AccessPriv #define __pyx_n_u_AggSplit __pyx_mstate_global->__pyx_n_u_AggSplit #define __pyx_n_s_Aggref __pyx_mstate_global->__pyx_n_s_Aggref #define __pyx_n_s_Alias __pyx_mstate_global->__pyx_n_s_Alias #define __pyx_n_s_AlterCollationStmt __pyx_mstate_global->__pyx_n_s_AlterCollationStmt #define __pyx_n_s_AlterDatabaseRefreshCollStmt __pyx_mstate_global->__pyx_n_s_AlterDatabaseRefreshCollStmt #define __pyx_n_s_AlterDatabaseSetStmt __pyx_mstate_global->__pyx_n_s_AlterDatabaseSetStmt #define __pyx_n_s_AlterDatabaseStmt __pyx_mstate_global->__pyx_n_s_AlterDatabaseStmt #define __pyx_n_s_AlterDefaultPrivilegesStmt __pyx_mstate_global->__pyx_n_s_AlterDefaultPrivilegesStmt #define __pyx_n_s_AlterDomainStmt __pyx_mstate_global->__pyx_n_s_AlterDomainStmt #define __pyx_n_s_AlterEnumStmt __pyx_mstate_global->__pyx_n_s_AlterEnumStmt #define __pyx_n_s_AlterEventTrigStmt __pyx_mstate_global->__pyx_n_s_AlterEventTrigStmt #define __pyx_n_s_AlterExtensionContentsStmt __pyx_mstate_global->__pyx_n_s_AlterExtensionContentsStmt #define __pyx_n_s_AlterExtensionStmt __pyx_mstate_global->__pyx_n_s_AlterExtensionStmt #define __pyx_n_s_AlterFdwStmt __pyx_mstate_global->__pyx_n_s_AlterFdwStmt #define __pyx_n_s_AlterForeignServerStmt __pyx_mstate_global->__pyx_n_s_AlterForeignServerStmt #define __pyx_n_s_AlterFunctionStmt __pyx_mstate_global->__pyx_n_s_AlterFunctionStmt #define __pyx_n_s_AlterObjectDependsStmt __pyx_mstate_global->__pyx_n_s_AlterObjectDependsStmt #define __pyx_n_s_AlterObjectSchemaStmt __pyx_mstate_global->__pyx_n_s_AlterObjectSchemaStmt #define __pyx_n_s_AlterOpFamilyStmt __pyx_mstate_global->__pyx_n_s_AlterOpFamilyStmt #define __pyx_n_s_AlterOperatorStmt __pyx_mstate_global->__pyx_n_s_AlterOperatorStmt #define __pyx_n_s_AlterOwnerStmt __pyx_mstate_global->__pyx_n_s_AlterOwnerStmt #define __pyx_n_s_AlterPolicyStmt __pyx_mstate_global->__pyx_n_s_AlterPolicyStmt #define __pyx_n_u_AlterPublicationAction __pyx_mstate_global->__pyx_n_u_AlterPublicationAction #define __pyx_n_s_AlterPublicationStmt __pyx_mstate_global->__pyx_n_s_AlterPublicationStmt #define __pyx_n_s_AlterRoleSetStmt __pyx_mstate_global->__pyx_n_s_AlterRoleSetStmt #define __pyx_n_s_AlterRoleStmt __pyx_mstate_global->__pyx_n_s_AlterRoleStmt #define __pyx_n_s_AlterSeqStmt __pyx_mstate_global->__pyx_n_s_AlterSeqStmt #define __pyx_n_s_AlterStatsStmt __pyx_mstate_global->__pyx_n_s_AlterStatsStmt #define __pyx_n_s_AlterSubscriptionStmt __pyx_mstate_global->__pyx_n_s_AlterSubscriptionStmt #define __pyx_n_u_AlterSubscriptionType __pyx_mstate_global->__pyx_n_u_AlterSubscriptionType #define __pyx_n_s_AlterSystemStmt __pyx_mstate_global->__pyx_n_s_AlterSystemStmt #define __pyx_n_u_AlterTSConfigType __pyx_mstate_global->__pyx_n_u_AlterTSConfigType #define __pyx_n_s_AlterTSConfigurationStmt __pyx_mstate_global->__pyx_n_s_AlterTSConfigurationStmt #define __pyx_n_s_AlterTSDictionaryStmt __pyx_mstate_global->__pyx_n_s_AlterTSDictionaryStmt #define __pyx_n_s_AlterTableCmd __pyx_mstate_global->__pyx_n_s_AlterTableCmd #define __pyx_n_s_AlterTableMoveAllStmt __pyx_mstate_global->__pyx_n_s_AlterTableMoveAllStmt #define __pyx_n_s_AlterTableSpaceOptionsStmt __pyx_mstate_global->__pyx_n_s_AlterTableSpaceOptionsStmt #define __pyx_n_s_AlterTableStmt __pyx_mstate_global->__pyx_n_s_AlterTableStmt #define __pyx_n_u_AlterTableType __pyx_mstate_global->__pyx_n_u_AlterTableType #define __pyx_n_s_AlterTypeStmt __pyx_mstate_global->__pyx_n_s_AlterTypeStmt #define __pyx_n_s_AlterUserMappingStmt __pyx_mstate_global->__pyx_n_s_AlterUserMappingStmt #define __pyx_n_s_AlternativeSubPlan __pyx_mstate_global->__pyx_n_s_AlternativeSubPlan #define __pyx_n_s_ArrayCoerceExpr __pyx_mstate_global->__pyx_n_s_ArrayCoerceExpr #define __pyx_n_s_ArrayExpr __pyx_mstate_global->__pyx_n_s_ArrayExpr #define __pyx_n_s_BitString __pyx_mstate_global->__pyx_n_s_BitString #define __pyx_n_s_BoolExpr __pyx_mstate_global->__pyx_n_s_BoolExpr #define __pyx_n_u_BoolExprType __pyx_mstate_global->__pyx_n_u_BoolExprType #define __pyx_n_u_BoolTestType __pyx_mstate_global->__pyx_n_u_BoolTestType #define __pyx_n_s_Boolean __pyx_mstate_global->__pyx_n_s_Boolean #define __pyx_n_s_BooleanTest __pyx_mstate_global->__pyx_n_s_BooleanTest #define __pyx_n_s_CTECycleClause __pyx_mstate_global->__pyx_n_s_CTECycleClause #define __pyx_n_u_CTEMaterialize __pyx_mstate_global->__pyx_n_u_CTEMaterialize #define __pyx_n_s_CTESearchClause __pyx_mstate_global->__pyx_n_s_CTESearchClause #define __pyx_n_s_CallContext __pyx_mstate_global->__pyx_n_s_CallContext #define __pyx_n_s_CallStmt __pyx_mstate_global->__pyx_n_s_CallStmt #define __pyx_n_s_CaseExpr __pyx_mstate_global->__pyx_n_s_CaseExpr #define __pyx_n_s_CaseTestExpr __pyx_mstate_global->__pyx_n_s_CaseTestExpr #define __pyx_n_s_CaseWhen __pyx_mstate_global->__pyx_n_s_CaseWhen #define __pyx_n_s_CheckPointStmt __pyx_mstate_global->__pyx_n_s_CheckPointStmt #define __pyx_n_s_ClosePortalStmt __pyx_mstate_global->__pyx_n_s_ClosePortalStmt #define __pyx_n_s_ClusterStmt __pyx_mstate_global->__pyx_n_s_ClusterStmt #define __pyx_n_u_CmdType __pyx_mstate_global->__pyx_n_u_CmdType #define __pyx_n_s_CoalesceExpr __pyx_mstate_global->__pyx_n_s_CoalesceExpr #define __pyx_n_s_CoerceToDomain __pyx_mstate_global->__pyx_n_s_CoerceToDomain #define __pyx_n_s_CoerceToDomainValue __pyx_mstate_global->__pyx_n_s_CoerceToDomainValue #define __pyx_n_s_CoerceViaIO __pyx_mstate_global->__pyx_n_s_CoerceViaIO #define __pyx_n_u_CoercionContext __pyx_mstate_global->__pyx_n_u_CoercionContext #define __pyx_n_u_CoercionForm __pyx_mstate_global->__pyx_n_u_CoercionForm #define __pyx_n_s_CollateClause __pyx_mstate_global->__pyx_n_s_CollateClause #define __pyx_n_s_CollateExpr __pyx_mstate_global->__pyx_n_s_CollateExpr #define __pyx_n_s_ColumnDef __pyx_mstate_global->__pyx_n_s_ColumnDef #define __pyx_n_s_ColumnRef __pyx_mstate_global->__pyx_n_s_ColumnRef #define __pyx_n_s_CommentStmt __pyx_mstate_global->__pyx_n_s_CommentStmt #define __pyx_n_s_CommonTableExpr __pyx_mstate_global->__pyx_n_s_CommonTableExpr #define __pyx_n_s_CompositeTypeStmt __pyx_mstate_global->__pyx_n_s_CompositeTypeStmt #define __pyx_n_u_ConstrType __pyx_mstate_global->__pyx_n_u_ConstrType #define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint #define __pyx_n_s_ConstraintsSetStmt __pyx_mstate_global->__pyx_n_s_ConstraintsSetStmt #define __pyx_n_s_ConvertRowtypeExpr __pyx_mstate_global->__pyx_n_s_ConvertRowtypeExpr #define __pyx_n_s_CopyStmt __pyx_mstate_global->__pyx_n_s_CopyStmt #define __pyx_n_s_CreateAmStmt __pyx_mstate_global->__pyx_n_s_CreateAmStmt #define __pyx_n_s_CreateCastStmt __pyx_mstate_global->__pyx_n_s_CreateCastStmt #define __pyx_n_s_CreateConversionStmt __pyx_mstate_global->__pyx_n_s_CreateConversionStmt #define __pyx_n_s_CreateDomainStmt __pyx_mstate_global->__pyx_n_s_CreateDomainStmt #define __pyx_n_s_CreateEnumStmt __pyx_mstate_global->__pyx_n_s_CreateEnumStmt #define __pyx_n_s_CreateEventTrigStmt __pyx_mstate_global->__pyx_n_s_CreateEventTrigStmt #define __pyx_n_s_CreateExtensionStmt __pyx_mstate_global->__pyx_n_s_CreateExtensionStmt #define __pyx_n_s_CreateFdwStmt __pyx_mstate_global->__pyx_n_s_CreateFdwStmt #define __pyx_n_s_CreateForeignServerStmt __pyx_mstate_global->__pyx_n_s_CreateForeignServerStmt #define __pyx_n_s_CreateForeignTableStmt __pyx_mstate_global->__pyx_n_s_CreateForeignTableStmt #define __pyx_n_s_CreateFunctionStmt __pyx_mstate_global->__pyx_n_s_CreateFunctionStmt #define __pyx_n_s_CreateOpClassItem __pyx_mstate_global->__pyx_n_s_CreateOpClassItem #define __pyx_n_s_CreateOpClassStmt __pyx_mstate_global->__pyx_n_s_CreateOpClassStmt #define __pyx_n_s_CreateOpFamilyStmt __pyx_mstate_global->__pyx_n_s_CreateOpFamilyStmt #define __pyx_n_s_CreatePLangStmt __pyx_mstate_global->__pyx_n_s_CreatePLangStmt #define __pyx_n_s_CreatePolicyStmt __pyx_mstate_global->__pyx_n_s_CreatePolicyStmt #define __pyx_n_s_CreatePublicationStmt __pyx_mstate_global->__pyx_n_s_CreatePublicationStmt #define __pyx_n_s_CreateRangeStmt __pyx_mstate_global->__pyx_n_s_CreateRangeStmt #define __pyx_n_s_CreateRoleStmt __pyx_mstate_global->__pyx_n_s_CreateRoleStmt #define __pyx_n_s_CreateSchemaStmt __pyx_mstate_global->__pyx_n_s_CreateSchemaStmt #define __pyx_n_s_CreateSeqStmt __pyx_mstate_global->__pyx_n_s_CreateSeqStmt #define __pyx_n_s_CreateStatsStmt __pyx_mstate_global->__pyx_n_s_CreateStatsStmt #define __pyx_n_s_CreateStmt __pyx_mstate_global->__pyx_n_s_CreateStmt #define __pyx_n_s_CreateSubscriptionStmt __pyx_mstate_global->__pyx_n_s_CreateSubscriptionStmt #define __pyx_n_s_CreateTableAsStmt __pyx_mstate_global->__pyx_n_s_CreateTableAsStmt #define __pyx_n_s_CreateTableSpaceStmt __pyx_mstate_global->__pyx_n_s_CreateTableSpaceStmt #define __pyx_n_s_CreateTransformStmt __pyx_mstate_global->__pyx_n_s_CreateTransformStmt #define __pyx_n_s_CreateTrigStmt __pyx_mstate_global->__pyx_n_s_CreateTrigStmt #define __pyx_n_s_CreateUserMappingStmt __pyx_mstate_global->__pyx_n_s_CreateUserMappingStmt #define __pyx_n_s_CreatedbStmt __pyx_mstate_global->__pyx_n_s_CreatedbStmt #define __pyx_n_s_CurrentOfExpr __pyx_mstate_global->__pyx_n_s_CurrentOfExpr #define __pyx_n_s_DeallocateStmt __pyx_mstate_global->__pyx_n_s_DeallocateStmt #define __pyx_n_s_DeclareCursorStmt __pyx_mstate_global->__pyx_n_s_DeclareCursorStmt #define __pyx_n_s_DefElem __pyx_mstate_global->__pyx_n_s_DefElem #define __pyx_n_u_DefElemAction __pyx_mstate_global->__pyx_n_u_DefElemAction #define __pyx_n_s_DefineStmt __pyx_mstate_global->__pyx_n_s_DefineStmt #define __pyx_n_s_DeleteStmt __pyx_mstate_global->__pyx_n_s_DeleteStmt #define __pyx_n_s_DeparseError __pyx_mstate_global->__pyx_n_s_DeparseError #define __pyx_n_s_DeparseError___str __pyx_mstate_global->__pyx_n_s_DeparseError___str #define __pyx_n_u_DiscardMode __pyx_mstate_global->__pyx_n_u_DiscardMode #define __pyx_n_s_DiscardStmt __pyx_mstate_global->__pyx_n_s_DiscardStmt #define __pyx_n_s_Displacements __pyx_mstate_global->__pyx_n_s_Displacements #define __pyx_n_s_Displacements___reduce_cython __pyx_mstate_global->__pyx_n_s_Displacements___reduce_cython #define __pyx_n_s_Displacements___setstate_cython __pyx_mstate_global->__pyx_n_s_Displacements___setstate_cython #define __pyx_n_s_DoStmt __pyx_mstate_global->__pyx_n_s_DoStmt #define __pyx_n_u_DropBehavior __pyx_mstate_global->__pyx_n_u_DropBehavior #define __pyx_n_s_DropOwnedStmt __pyx_mstate_global->__pyx_n_s_DropOwnedStmt #define __pyx_n_s_DropRoleStmt __pyx_mstate_global->__pyx_n_s_DropRoleStmt #define __pyx_n_s_DropStmt __pyx_mstate_global->__pyx_n_s_DropStmt #define __pyx_n_s_DropSubscriptionStmt __pyx_mstate_global->__pyx_n_s_DropSubscriptionStmt #define __pyx_n_s_DropTableSpaceStmt __pyx_mstate_global->__pyx_n_s_DropTableSpaceStmt #define __pyx_n_s_DropUserMappingStmt __pyx_mstate_global->__pyx_n_s_DropUserMappingStmt #define __pyx_n_s_DropdbStmt __pyx_mstate_global->__pyx_n_s_DropdbStmt #define __pyx_n_s_Error __pyx_mstate_global->__pyx_n_s_Error #define __pyx_kp_s_Exception_representing_the_error __pyx_mstate_global->__pyx_kp_s_Exception_representing_the_error #define __pyx_kp_s_Exception_representing_the_error_2 __pyx_mstate_global->__pyx_kp_s_Exception_representing_the_error_2 #define __pyx_n_s_ExecuteStmt __pyx_mstate_global->__pyx_n_s_ExecuteStmt #define __pyx_n_s_ExplainStmt __pyx_mstate_global->__pyx_n_s_ExplainStmt #define __pyx_n_u_FetchDirection __pyx_mstate_global->__pyx_n_u_FetchDirection #define __pyx_n_s_FetchStmt __pyx_mstate_global->__pyx_n_s_FetchStmt #define __pyx_n_s_FieldSelect __pyx_mstate_global->__pyx_n_s_FieldSelect #define __pyx_n_s_FieldStore __pyx_mstate_global->__pyx_n_s_FieldStore #define __pyx_n_s_Float __pyx_mstate_global->__pyx_n_s_Float #define __pyx_n_s_FromExpr __pyx_mstate_global->__pyx_n_s_FromExpr #define __pyx_n_s_FuncCall __pyx_mstate_global->__pyx_n_s_FuncCall #define __pyx_n_s_FuncExpr __pyx_mstate_global->__pyx_n_s_FuncExpr #define __pyx_n_s_FunctionParameter __pyx_mstate_global->__pyx_n_s_FunctionParameter #define __pyx_n_u_FunctionParameterMode __pyx_mstate_global->__pyx_n_u_FunctionParameterMode #define __pyx_n_s_GrantRoleStmt __pyx_mstate_global->__pyx_n_s_GrantRoleStmt #define __pyx_n_s_GrantStmt __pyx_mstate_global->__pyx_n_s_GrantStmt #define __pyx_n_u_GrantTargetType __pyx_mstate_global->__pyx_n_u_GrantTargetType #define __pyx_n_s_GroupingFunc __pyx_mstate_global->__pyx_n_s_GroupingFunc #define __pyx_n_s_GroupingSet __pyx_mstate_global->__pyx_n_s_GroupingSet #define __pyx_n_u_GroupingSetKind __pyx_mstate_global->__pyx_n_u_GroupingSetKind #define __pyx_n_s_ImportForeignSchemaStmt __pyx_mstate_global->__pyx_n_s_ImportForeignSchemaStmt #define __pyx_n_u_ImportForeignSchemaType __pyx_mstate_global->__pyx_n_u_ImportForeignSchemaType #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0 #define __pyx_n_s_IndexElem __pyx_mstate_global->__pyx_n_s_IndexElem #define __pyx_n_s_IndexStmt __pyx_mstate_global->__pyx_n_s_IndexStmt #define __pyx_n_s_InferClause __pyx_mstate_global->__pyx_n_s_InferClause #define __pyx_n_s_InferenceElem __pyx_mstate_global->__pyx_n_s_InferenceElem #define __pyx_n_s_InlineCodeBlock __pyx_mstate_global->__pyx_n_s_InlineCodeBlock #define __pyx_n_s_InsertStmt __pyx_mstate_global->__pyx_n_s_InsertStmt #define __pyx_n_s_Integer __pyx_mstate_global->__pyx_n_s_Integer #define __pyx_n_s_IntoClause __pyx_mstate_global->__pyx_n_s_IntoClause #define __pyx_n_s_JoinExpr __pyx_mstate_global->__pyx_n_s_JoinExpr #define __pyx_n_u_JoinType __pyx_mstate_global->__pyx_n_u_JoinType #define __pyx_n_s_JsonAggConstructor __pyx_mstate_global->__pyx_n_s_JsonAggConstructor #define __pyx_n_s_JsonArgument __pyx_mstate_global->__pyx_n_s_JsonArgument #define __pyx_n_s_JsonArrayAgg __pyx_mstate_global->__pyx_n_s_JsonArrayAgg #define __pyx_n_s_JsonArrayConstructor __pyx_mstate_global->__pyx_n_s_JsonArrayConstructor #define __pyx_n_s_JsonArrayQueryConstructor __pyx_mstate_global->__pyx_n_s_JsonArrayQueryConstructor #define __pyx_n_s_JsonBehavior __pyx_mstate_global->__pyx_n_s_JsonBehavior #define __pyx_n_u_JsonBehaviorType __pyx_mstate_global->__pyx_n_u_JsonBehaviorType #define __pyx_n_s_JsonConstructorExpr __pyx_mstate_global->__pyx_n_s_JsonConstructorExpr #define __pyx_n_u_JsonConstructorType __pyx_mstate_global->__pyx_n_u_JsonConstructorType #define __pyx_n_u_JsonEncoding __pyx_mstate_global->__pyx_n_u_JsonEncoding #define __pyx_n_s_JsonExpr __pyx_mstate_global->__pyx_n_s_JsonExpr #define __pyx_n_u_JsonExprOp __pyx_mstate_global->__pyx_n_u_JsonExprOp #define __pyx_n_s_JsonFormat __pyx_mstate_global->__pyx_n_s_JsonFormat #define __pyx_n_u_JsonFormatType __pyx_mstate_global->__pyx_n_u_JsonFormatType #define __pyx_n_s_JsonFuncExpr __pyx_mstate_global->__pyx_n_s_JsonFuncExpr #define __pyx_n_s_JsonIsPredicate __pyx_mstate_global->__pyx_n_s_JsonIsPredicate #define __pyx_n_s_JsonKeyValue __pyx_mstate_global->__pyx_n_s_JsonKeyValue #define __pyx_n_s_JsonObjectAgg __pyx_mstate_global->__pyx_n_s_JsonObjectAgg #define __pyx_n_s_JsonObjectConstructor __pyx_mstate_global->__pyx_n_s_JsonObjectConstructor #define __pyx_n_s_JsonOutput __pyx_mstate_global->__pyx_n_s_JsonOutput #define __pyx_n_s_JsonParseExpr __pyx_mstate_global->__pyx_n_s_JsonParseExpr #define __pyx_n_u_JsonQuotes __pyx_mstate_global->__pyx_n_u_JsonQuotes #define __pyx_n_s_JsonReturning __pyx_mstate_global->__pyx_n_s_JsonReturning #define __pyx_n_s_JsonScalarExpr __pyx_mstate_global->__pyx_n_s_JsonScalarExpr #define __pyx_n_s_JsonSerializeExpr __pyx_mstate_global->__pyx_n_s_JsonSerializeExpr #define __pyx_n_s_JsonTable __pyx_mstate_global->__pyx_n_s_JsonTable #define __pyx_n_s_JsonTableColumn __pyx_mstate_global->__pyx_n_s_JsonTableColumn #define __pyx_n_u_JsonTableColumnType __pyx_mstate_global->__pyx_n_u_JsonTableColumnType #define __pyx_n_s_JsonTablePathSpec __pyx_mstate_global->__pyx_n_s_JsonTablePathSpec #define __pyx_n_s_JsonValueExpr __pyx_mstate_global->__pyx_n_s_JsonValueExpr #define __pyx_n_u_JsonValueType __pyx_mstate_global->__pyx_n_u_JsonValueType #define __pyx_n_u_JsonWrapper __pyx_mstate_global->__pyx_n_u_JsonWrapper #define __pyx_n_s_LONG_MAX __pyx_mstate_global->__pyx_n_s_LONG_MAX #define __pyx_n_u_LimitOption __pyx_mstate_global->__pyx_n_u_LimitOption #define __pyx_n_s_ListenStmt __pyx_mstate_global->__pyx_n_s_ListenStmt #define __pyx_n_s_LoadStmt __pyx_mstate_global->__pyx_n_s_LoadStmt #define __pyx_n_u_LockClauseStrength __pyx_mstate_global->__pyx_n_u_LockClauseStrength #define __pyx_n_s_LockStmt __pyx_mstate_global->__pyx_n_s_LockStmt #define __pyx_n_u_LockWaitPolicy __pyx_mstate_global->__pyx_n_u_LockWaitPolicy #define __pyx_n_s_LockingClause __pyx_mstate_global->__pyx_n_s_LockingClause #define __pyx_n_s_MergeAction __pyx_mstate_global->__pyx_n_s_MergeAction #define __pyx_n_u_MergeMatchKind __pyx_mstate_global->__pyx_n_u_MergeMatchKind #define __pyx_n_s_MergeStmt __pyx_mstate_global->__pyx_n_s_MergeStmt #define __pyx_n_s_MergeSupportFunc __pyx_mstate_global->__pyx_n_s_MergeSupportFunc #define __pyx_n_s_MergeWhenClause __pyx_mstate_global->__pyx_n_s_MergeWhenClause #define __pyx_n_s_MinMaxExpr __pyx_mstate_global->__pyx_n_s_MinMaxExpr #define __pyx_n_u_MinMaxOp __pyx_mstate_global->__pyx_n_u_MinMaxOp #define __pyx_n_s_MultiAssignRef __pyx_mstate_global->__pyx_n_s_MultiAssignRef #define __pyx_n_s_NamedArgExpr __pyx_mstate_global->__pyx_n_s_NamedArgExpr #define __pyx_n_s_NotifyStmt __pyx_mstate_global->__pyx_n_s_NotifyStmt #define __pyx_n_s_NullTest __pyx_mstate_global->__pyx_n_s_NullTest #define __pyx_n_u_NullTestType __pyx_mstate_global->__pyx_n_u_NullTestType #define __pyx_n_u_ObjectType __pyx_mstate_global->__pyx_n_u_ObjectType #define __pyx_n_s_ObjectWithArgs __pyx_mstate_global->__pyx_n_s_ObjectWithArgs #define __pyx_n_u_OnCommitAction __pyx_mstate_global->__pyx_n_u_OnCommitAction #define __pyx_n_u_OnConflictAction __pyx_mstate_global->__pyx_n_u_OnConflictAction #define __pyx_n_s_OnConflictClause __pyx_mstate_global->__pyx_n_s_OnConflictClause #define __pyx_n_s_OnConflictExpr __pyx_mstate_global->__pyx_n_s_OnConflictExpr #define __pyx_n_s_OpExpr __pyx_mstate_global->__pyx_n_s_OpExpr #define __pyx_n_u_OverridingKind __pyx_mstate_global->__pyx_n_u_OverridingKind #define __pyx_n_s_PLAssignStmt __pyx_mstate_global->__pyx_n_s_PLAssignStmt #define __pyx_n_s_Param __pyx_mstate_global->__pyx_n_s_Param #define __pyx_n_u_ParamKind __pyx_mstate_global->__pyx_n_u_ParamKind #define __pyx_n_s_ParamRef __pyx_mstate_global->__pyx_n_s_ParamRef #define __pyx_n_s_ParseError __pyx_mstate_global->__pyx_n_s_ParseError #define __pyx_n_s_ParseError___str __pyx_mstate_global->__pyx_n_s_ParseError___str #define __pyx_n_s_PartitionBoundSpec __pyx_mstate_global->__pyx_n_s_PartitionBoundSpec #define __pyx_n_s_PartitionCmd __pyx_mstate_global->__pyx_n_s_PartitionCmd #define __pyx_n_s_PartitionElem __pyx_mstate_global->__pyx_n_s_PartitionElem #define __pyx_n_s_PartitionRangeDatum __pyx_mstate_global->__pyx_n_s_PartitionRangeDatum #define __pyx_n_u_PartitionRangeDatumKind __pyx_mstate_global->__pyx_n_u_PartitionRangeDatumKind #define __pyx_n_s_PartitionSpec __pyx_mstate_global->__pyx_n_s_PartitionSpec #define __pyx_n_u_PartitionStrategy __pyx_mstate_global->__pyx_n_u_PartitionStrategy #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError #define __pyx_n_s_PrepareStmt __pyx_mstate_global->__pyx_n_s_PrepareStmt #define __pyx_n_s_PublicationObjSpec __pyx_mstate_global->__pyx_n_s_PublicationObjSpec #define __pyx_n_u_PublicationObjSpecType __pyx_mstate_global->__pyx_n_u_PublicationObjSpecType #define __pyx_n_s_PublicationTable __pyx_mstate_global->__pyx_n_s_PublicationTable #define __pyx_n_s_Query __pyx_mstate_global->__pyx_n_s_Query #define __pyx_n_u_QuerySource __pyx_mstate_global->__pyx_n_u_QuerySource #define __pyx_n_u_RTEKind __pyx_mstate_global->__pyx_n_u_RTEKind #define __pyx_n_s_RTEPermissionInfo __pyx_mstate_global->__pyx_n_s_RTEPermissionInfo #define __pyx_n_s_RangeFunction __pyx_mstate_global->__pyx_n_s_RangeFunction #define __pyx_n_s_RangeSubselect __pyx_mstate_global->__pyx_n_s_RangeSubselect #define __pyx_n_s_RangeTableFunc __pyx_mstate_global->__pyx_n_s_RangeTableFunc #define __pyx_n_s_RangeTableFuncCol __pyx_mstate_global->__pyx_n_s_RangeTableFuncCol #define __pyx_n_s_RangeTableSample __pyx_mstate_global->__pyx_n_s_RangeTableSample #define __pyx_n_s_RangeTblEntry __pyx_mstate_global->__pyx_n_s_RangeTblEntry #define __pyx_n_s_RangeTblFunction __pyx_mstate_global->__pyx_n_s_RangeTblFunction #define __pyx_n_s_RangeTblRef __pyx_mstate_global->__pyx_n_s_RangeTblRef #define __pyx_n_s_RangeVar __pyx_mstate_global->__pyx_n_s_RangeVar #define __pyx_n_s_RawStmt __pyx_mstate_global->__pyx_n_s_RawStmt #define __pyx_n_s_ReassignOwnedStmt __pyx_mstate_global->__pyx_n_s_ReassignOwnedStmt #define __pyx_n_s_RefreshMatViewStmt __pyx_mstate_global->__pyx_n_s_RefreshMatViewStmt #define __pyx_n_u_ReindexObjectType __pyx_mstate_global->__pyx_n_u_ReindexObjectType #define __pyx_n_s_ReindexStmt __pyx_mstate_global->__pyx_n_s_ReindexStmt #define __pyx_n_s_RelabelType __pyx_mstate_global->__pyx_n_s_RelabelType #define __pyx_n_s_RenameStmt __pyx_mstate_global->__pyx_n_s_RenameStmt #define __pyx_n_s_ReplicaIdentityStmt __pyx_mstate_global->__pyx_n_s_ReplicaIdentityStmt #define __pyx_n_s_ResTarget __pyx_mstate_global->__pyx_n_s_ResTarget #define __pyx_n_s_ReturnStmt __pyx_mstate_global->__pyx_n_s_ReturnStmt #define __pyx_n_s_RoleSpec __pyx_mstate_global->__pyx_n_s_RoleSpec #define __pyx_n_u_RoleSpecType __pyx_mstate_global->__pyx_n_u_RoleSpecType #define __pyx_n_u_RoleStmtType __pyx_mstate_global->__pyx_n_u_RoleStmtType #define __pyx_n_s_RowCompareExpr __pyx_mstate_global->__pyx_n_s_RowCompareExpr #define __pyx_n_u_RowCompareType __pyx_mstate_global->__pyx_n_u_RowCompareType #define __pyx_n_s_RowExpr __pyx_mstate_global->__pyx_n_s_RowExpr #define __pyx_n_s_RowMarkClause __pyx_mstate_global->__pyx_n_s_RowMarkClause #define __pyx_n_s_RuleStmt __pyx_mstate_global->__pyx_n_s_RuleStmt #define __pyx_n_s_SQLValueFunction __pyx_mstate_global->__pyx_n_s_SQLValueFunction #define __pyx_n_u_SQLValueFunctionOp __pyx_mstate_global->__pyx_n_u_SQLValueFunctionOp #define __pyx_n_s_ScalarArrayOpExpr __pyx_mstate_global->__pyx_n_s_ScalarArrayOpExpr #define __pyx_n_s_SecLabelStmt __pyx_mstate_global->__pyx_n_s_SecLabelStmt #define __pyx_n_s_SelectStmt __pyx_mstate_global->__pyx_n_s_SelectStmt #define __pyx_n_u_SetOperation __pyx_mstate_global->__pyx_n_u_SetOperation #define __pyx_n_s_SetOperationStmt __pyx_mstate_global->__pyx_n_s_SetOperationStmt #define __pyx_n_s_SetToDefault __pyx_mstate_global->__pyx_n_s_SetToDefault #define __pyx_n_s_SinglePartitionSpec __pyx_mstate_global->__pyx_n_s_SinglePartitionSpec #define __pyx_n_s_SortBy __pyx_mstate_global->__pyx_n_s_SortBy #define __pyx_n_u_SortByDir __pyx_mstate_global->__pyx_n_u_SortByDir #define __pyx_n_u_SortByNulls __pyx_mstate_global->__pyx_n_u_SortByNulls #define __pyx_n_s_SortGroupClause __pyx_mstate_global->__pyx_n_s_SortGroupClause #define __pyx_n_s_StatsElem __pyx_mstate_global->__pyx_n_s_StatsElem #define __pyx_n_s_String __pyx_mstate_global->__pyx_n_s_String #define __pyx_n_s_SubLink __pyx_mstate_global->__pyx_n_s_SubLink #define __pyx_n_u_SubLinkType __pyx_mstate_global->__pyx_n_u_SubLinkType #define __pyx_n_s_SubPlan __pyx_mstate_global->__pyx_n_s_SubPlan #define __pyx_n_s_SubscriptingRef __pyx_mstate_global->__pyx_n_s_SubscriptingRef #define __pyx_n_s_TableFunc __pyx_mstate_global->__pyx_n_s_TableFunc #define __pyx_n_u_TableFuncType __pyx_mstate_global->__pyx_n_u_TableFuncType #define __pyx_n_s_TableLikeClause __pyx_mstate_global->__pyx_n_s_TableLikeClause #define __pyx_n_s_TableSampleClause __pyx_mstate_global->__pyx_n_s_TableSampleClause #define __pyx_n_s_TargetEntry __pyx_mstate_global->__pyx_n_s_TargetEntry #define __pyx_n_s_Token __pyx_mstate_global->__pyx_n_s_Token #define __pyx_n_u_Token __pyx_mstate_global->__pyx_n_u_Token #define __pyx_n_s_TransactionStmt __pyx_mstate_global->__pyx_n_s_TransactionStmt #define __pyx_n_u_TransactionStmtKind __pyx_mstate_global->__pyx_n_u_TransactionStmtKind #define __pyx_n_s_TriggerTransition __pyx_mstate_global->__pyx_n_s_TriggerTransition #define __pyx_n_s_TruncateStmt __pyx_mstate_global->__pyx_n_s_TruncateStmt #define __pyx_n_s_TypeCast __pyx_mstate_global->__pyx_n_s_TypeCast #define __pyx_n_s_TypeName __pyx_mstate_global->__pyx_n_s_TypeName #define __pyx_n_u_UNKNOWN __pyx_mstate_global->__pyx_n_u_UNKNOWN #define __pyx_kp_u_Unhandled_tag_s __pyx_mstate_global->__pyx_kp_u_Unhandled_tag_s #define __pyx_n_s_UnlistenStmt __pyx_mstate_global->__pyx_n_s_UnlistenStmt #define __pyx_n_s_UpdateStmt __pyx_mstate_global->__pyx_n_s_UpdateStmt #define __pyx_n_s_VacuumRelation __pyx_mstate_global->__pyx_n_s_VacuumRelation #define __pyx_n_s_VacuumStmt __pyx_mstate_global->__pyx_n_s_VacuumStmt #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s_Var __pyx_mstate_global->__pyx_n_s_Var #define __pyx_n_u_VariableSetKind __pyx_mstate_global->__pyx_n_u_VariableSetKind #define __pyx_n_s_VariableSetStmt __pyx_mstate_global->__pyx_n_s_VariableSetStmt #define __pyx_n_s_VariableShowStmt __pyx_mstate_global->__pyx_n_s_VariableShowStmt #define __pyx_n_u_ViewCheckOption __pyx_mstate_global->__pyx_n_u_ViewCheckOption #define __pyx_n_s_ViewStmt __pyx_mstate_global->__pyx_n_s_ViewStmt #define __pyx_n_u_WCOKind __pyx_mstate_global->__pyx_n_u_WCOKind #define __pyx_n_s_WindowClause __pyx_mstate_global->__pyx_n_s_WindowClause #define __pyx_n_s_WindowDef __pyx_mstate_global->__pyx_n_s_WindowDef #define __pyx_n_s_WindowFunc __pyx_mstate_global->__pyx_n_s_WindowFunc #define __pyx_n_s_WindowFuncRunCondition __pyx_mstate_global->__pyx_n_s_WindowFuncRunCondition #define __pyx_n_s_WithCheckOption __pyx_mstate_global->__pyx_n_s_WithCheckOption #define __pyx_n_s_WithClause __pyx_mstate_global->__pyx_n_s_WithClause #define __pyx_n_s_XmlExpr __pyx_mstate_global->__pyx_n_s_XmlExpr #define __pyx_n_u_XmlExprOp __pyx_mstate_global->__pyx_n_u_XmlExprOp #define __pyx_n_u_XmlOptionType __pyx_mstate_global->__pyx_n_u_XmlOptionType #define __pyx_n_s_XmlSerialize __pyx_mstate_global->__pyx_n_s_XmlSerialize #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3 #define __pyx_n_s__32 __pyx_mstate_global->__pyx_n_s__32 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args #define __pyx_n_s_ast __pyx_mstate_global->__pyx_n_s_ast #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines #define __pyx_kp_u_at_index __pyx_mstate_global->__pyx_kp_u_at_index #define __pyx_kp_u_at_position __pyx_mstate_global->__pyx_kp_u_at_position #define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections #define __pyx_n_s_cstring __pyx_mstate_global->__pyx_n_s_cstring #define __pyx_n_s_cur_offset __pyx_mstate_global->__pyx_n_s_cur_offset #define __pyx_n_s_cursorpos __pyx_mstate_global->__pyx_n_s_cursorpos #define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode #define __pyx_n_s_deparse_protobuf __pyx_mstate_global->__pyx_n_s_deparse_protobuf #define __pyx_n_s_deparsed __pyx_mstate_global->__pyx_n_s_deparsed #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict #define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end #define __pyx_n_u_end __pyx_mstate_global->__pyx_n_u_end #define __pyx_n_s_enums __pyx_mstate_global->__pyx_n_s_enums #define __pyx_n_s_fingerprint __pyx_mstate_global->__pyx_n_s_fingerprint #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc #define __pyx_n_s_get_postgresql_version __pyx_mstate_global->__pyx_n_s_get_postgresql_version #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled #define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item #define __pyx_n_u_kind __pyx_mstate_global->__pyx_n_u_kind #define __pyx_n_s_kwkind __pyx_mstate_global->__pyx_n_s_kwkind #define __pyx_n_s_location __pyx_mstate_global->__pyx_n_s_location #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_major __pyx_mstate_global->__pyx_n_s_major #define __pyx_n_s_mctx __pyx_mstate_global->__pyx_n_s_mctx #define __pyx_n_s_message __pyx_mstate_global->__pyx_n_s_message #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass #define __pyx_n_s_minor __pyx_mstate_global->__pyx_n_s_minor #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_u_name_2 __pyx_mstate_global->__pyx_n_u_name_2 #define __pyx_n_s_namedtuple __pyx_mstate_global->__pyx_n_s_namedtuple #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset #define __pyx_n_s_offset_to_index __pyx_mstate_global->__pyx_n_s_offset_to_index #define __pyx_n_s_only_slices __pyx_mstate_global->__pyx_n_s_only_slices #define __pyx_n_s_parse_plpgsql_json __pyx_mstate_global->__pyx_n_s_parse_plpgsql_json #define __pyx_n_s_parse_sql __pyx_mstate_global->__pyx_n_s_parse_sql #define __pyx_n_s_parse_sql_json __pyx_mstate_global->__pyx_n_s_parse_sql_json #define __pyx_n_s_parse_sql_protobuf __pyx_mstate_global->__pyx_n_s_parse_sql_protobuf #define __pyx_n_s_parsed __pyx_mstate_global->__pyx_n_s_parsed #define __pyx_n_s_pglast __pyx_mstate_global->__pyx_n_s_pglast #define __pyx_n_s_pglast_parser __pyx_mstate_global->__pyx_n_s_pglast_parser #define __pyx_kp_s_pglast_parser_pyx __pyx_mstate_global->__pyx_kp_s_pglast_parser_pyx #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare #define __pyx_n_s_prev_offset __pyx_mstate_global->__pyx_n_s_prev_offset #define __pyx_n_s_protobuf __pyx_mstate_global->__pyx_n_s_protobuf #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type #define __pyx_n_s_pyx_unpickle_Displacements __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Displacements #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname #define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex #define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result #define __pyx_n_s_reversed __pyx_mstate_global->__pyx_n_s_reversed #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s #define __pyx_n_s_scan __pyx_mstate_global->__pyx_n_s_scan #define __pyx_n_s_scan_result __pyx_mstate_global->__pyx_n_s_scan_result #define __pyx_n_s_scan_token __pyx_mstate_global->__pyx_n_s_scan_token #define __pyx_n_s_scanned __pyx_mstate_global->__pyx_n_s_scanned #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split #define __pyx_n_s_splitted __pyx_mstate_global->__pyx_n_s_splitted #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start #define __pyx_n_u_start __pyx_mstate_global->__pyx_n_u_start #define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state #define __pyx_n_s_stmt __pyx_mstate_global->__pyx_n_s_stmt #define __pyx_n_s_stmts __pyx_mstate_global->__pyx_n_s_stmts #define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test #define __pyx_n_s_tkind __pyx_mstate_global->__pyx_n_s_tkind #define __pyx_n_s_token __pyx_mstate_global->__pyx_n_s_token #define __pyx_n_s_tree __pyx_mstate_global->__pyx_n_s_tree #define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update #define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate #define __pyx_n_s_utf8 __pyx_mstate_global->__pyx_n_s_utf8 #define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8 #define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version #define __pyx_n_s_with_parser __pyx_mstate_global->__pyx_n_s_with_parser #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 #define __pyx_int_10000 __pyx_mstate_global->__pyx_int_10000 #define __pyx_int_37136258 __pyx_mstate_global->__pyx_int_37136258 #define __pyx_int_48433145 __pyx_mstate_global->__pyx_int_48433145 #define __pyx_int_124017984 __pyx_mstate_global->__pyx_int_124017984 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 #define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 #define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 /* #### Code section: module_code ### */ /* "pglast/ast.pyx":17 * * * cdef _pg_bitmapset_to_set(const structs.Bitmapset* bms): # <<<<<<<<<<<<<< * cdef set result * cdef int m */ static PyObject *__pyx_f_6pglast_6parser__pg_bitmapset_to_set(Bitmapset const *__pyx_v_bms) { PyObject *__pyx_v_result = 0; int __pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_pg_bitmapset_to_set", 1); /* "pglast/ast.pyx":20 * cdef set result * cdef int m * if bms is not NULL: # <<<<<<<<<<<<<< * result = set() * m = structs.bms_next_member(bms, -1) */ __pyx_t_1 = (__pyx_v_bms != NULL); if (__pyx_t_1) { /* "pglast/ast.pyx":21 * cdef int m * if bms is not NULL: * result = set() # <<<<<<<<<<<<<< * m = structs.bms_next_member(bms, -1) * while m >= 0: */ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":22 * if bms is not NULL: * result = set() * m = structs.bms_next_member(bms, -1) # <<<<<<<<<<<<<< * while m >= 0: * result.add(m) */ __pyx_v_m = bms_next_member(__pyx_v_bms, -1); /* "pglast/ast.pyx":23 * result = set() * m = structs.bms_next_member(bms, -1) * while m >= 0: # <<<<<<<<<<<<<< * result.add(m) * m = structs.bms_next_member(bms, m) */ while (1) { __pyx_t_1 = (__pyx_v_m >= 0); if (!__pyx_t_1) break; /* "pglast/ast.pyx":24 * m = structs.bms_next_member(bms, -1) * while m >= 0: * result.add(m) # <<<<<<<<<<<<<< * m = structs.bms_next_member(bms, m) * else: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySet_Add(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":25 * while m >= 0: * result.add(m) * m = structs.bms_next_member(bms, m) # <<<<<<<<<<<<<< * else: * result = None */ __pyx_v_m = bms_next_member(__pyx_v_bms, __pyx_v_m); } /* "pglast/ast.pyx":20 * cdef set result * cdef int m * if bms is not NULL: # <<<<<<<<<<<<<< * result = set() * m = structs.bms_next_member(bms, -1) */ goto __pyx_L3; } /* "pglast/ast.pyx":27 * m = structs.bms_next_member(bms, m) * else: * result = None # <<<<<<<<<<<<<< * return result * */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_result = ((PyObject*)Py_None); } __pyx_L3:; /* "pglast/ast.pyx":28 * else: * result = None * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "pglast/ast.pyx":17 * * * cdef _pg_bitmapset_to_set(const structs.Bitmapset* bms): # <<<<<<<<<<<<<< * cdef set result * cdef int m */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pglast.parser._pg_bitmapset_to_set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":31 * * * cdef _pg_list_to_tuple(const structs.List* lst, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple result * cdef int i */ static PyObject *__pyx_f_6pglast_6parser__pg_list_to_tuple(List const *__pyx_v_lst, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_result = 0; int __pyx_v_i; PyObject *__pyx_v_item = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_pg_list_to_tuple", 1); /* "pglast/ast.pyx":34 * cdef tuple result * cdef int i * if lst is not NULL: # <<<<<<<<<<<<<< * result = PyTuple_New(lst.length) * for i in range(lst.length): */ __pyx_t_1 = (__pyx_v_lst != NULL); if (__pyx_t_1) { /* "pglast/ast.pyx":35 * cdef int i * if lst is not NULL: * result = PyTuple_New(lst.length) # <<<<<<<<<<<<<< * for i in range(lst.length): * item = create(structs.list_nth(lst, i), offset_to_index) */ __pyx_t_2 = PyTuple_New(__pyx_v_lst->length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":36 * if lst is not NULL: * result = PyTuple_New(lst.length) * for i in range(lst.length): # <<<<<<<<<<<<<< * item = create(structs.list_nth(lst, i), offset_to_index) * Py_INCREF(item) */ __pyx_t_3 = __pyx_v_lst->length; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "pglast/ast.pyx":37 * result = PyTuple_New(lst.length) * for i in range(lst.length): * item = create(structs.list_nth(lst, i), offset_to_index) # <<<<<<<<<<<<<< * Py_INCREF(item) * PyTuple_SET_ITEM(result, i, item) */ __pyx_t_2 = __pyx_f_6pglast_6parser_create(list_nth(__pyx_v_lst, __pyx_v_i), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":38 * for i in range(lst.length): * item = create(structs.list_nth(lst, i), offset_to_index) * Py_INCREF(item) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, item) * else: */ Py_INCREF(__pyx_v_item); /* "pglast/ast.pyx":39 * item = create(structs.list_nth(lst, i), offset_to_index) * Py_INCREF(item) * PyTuple_SET_ITEM(result, i, item) # <<<<<<<<<<<<<< * else: * result = None */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_item); } /* "pglast/ast.pyx":34 * cdef tuple result * cdef int i * if lst is not NULL: # <<<<<<<<<<<<<< * result = PyTuple_New(lst.length) * for i in range(lst.length): */ goto __pyx_L3; } /* "pglast/ast.pyx":41 * PyTuple_SET_ITEM(result, i, item) * else: * result = None # <<<<<<<<<<<<<< * return result * */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_result = ((PyObject*)Py_None); } __pyx_L3:; /* "pglast/ast.pyx":42 * else: * result = None * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "pglast/ast.pyx":31 * * * cdef _pg_list_to_tuple(const structs.List* lst, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple result * cdef int i */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pglast.parser._pg_list_to_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":45 * * * cdef create_Query(structs.Query* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) */ static PyObject *__pyx_f_6pglast_6parser_create_Query(Query *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_commandType = 0; PyObject *__pyx_v_v_querySource = 0; PyObject *__pyx_v_v_canSetTag = 0; PyObject *__pyx_v_v_utilityStmt = 0; PyObject *__pyx_v_v_resultRelation = 0; PyObject *__pyx_v_v_hasAggs = 0; PyObject *__pyx_v_v_hasWindowFuncs = 0; PyObject *__pyx_v_v_hasTargetSRFs = 0; PyObject *__pyx_v_v_hasSubLinks = 0; PyObject *__pyx_v_v_hasDistinctOn = 0; PyObject *__pyx_v_v_hasRecursive = 0; PyObject *__pyx_v_v_hasModifyingCTE = 0; PyObject *__pyx_v_v_hasForUpdate = 0; PyObject *__pyx_v_v_hasRowSecurity = 0; PyObject *__pyx_v_v_isReturn = 0; PyObject *__pyx_v_v_cteList = 0; PyObject *__pyx_v_v_rtable = 0; PyObject *__pyx_v_v_rteperminfos = 0; PyObject *__pyx_v_v_jointree = 0; PyObject *__pyx_v_v_mergeActionList = 0; PyObject *__pyx_v_v_mergeTargetRelation = 0; PyObject *__pyx_v_v_mergeJoinCondition = 0; PyObject *__pyx_v_v_targetList = 0; PyObject *__pyx_v_v_override = 0; PyObject *__pyx_v_v_onConflict = 0; PyObject *__pyx_v_v_returningList = 0; PyObject *__pyx_v_v_groupClause = 0; PyObject *__pyx_v_v_groupDistinct = 0; PyObject *__pyx_v_v_groupingSets = 0; PyObject *__pyx_v_v_havingQual = 0; PyObject *__pyx_v_v_windowClause = 0; PyObject *__pyx_v_v_distinctClause = 0; PyObject *__pyx_v_v_sortClause = 0; PyObject *__pyx_v_v_limitOffset = 0; PyObject *__pyx_v_v_limitCount = 0; PyObject *__pyx_v_v_limitOption = 0; PyObject *__pyx_v_v_rowMarks = 0; PyObject *__pyx_v_v_setOperations = 0; PyObject *__pyx_v_v_constraintDeps = 0; PyObject *__pyx_v_v_withCheckOptions = 0; PyObject *__pyx_v_v_stmt_location = 0; PyObject *__pyx_v_v_stmt_len = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Query", 1); /* "pglast/ast.pyx":46 * * cdef create_Query(structs.Query* data, offset_to_index): * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) # <<<<<<<<<<<<<< * cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) * cdef object v_canSetTag = bool(data.canSetTag) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_CmdType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_CmdType(__pyx_v_data->commandType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_commandType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":47 * cdef create_Query(structs.Query* data, offset_to_index): * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) # <<<<<<<<<<<<<< * cdef object v_canSetTag = bool(data.canSetTag) * cdef object v_utilityStmt = create(data.utilityStmt, offset_to_index) if data.utilityStmt is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_QuerySource); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_QuerySource(__pyx_v_data->querySource); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_querySource = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":48 * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) * cdef object v_canSetTag = bool(data.canSetTag) # <<<<<<<<<<<<<< * cdef object v_utilityStmt = create(data.utilityStmt, offset_to_index) if data.utilityStmt is not NULL else None * cdef object v_resultRelation = data.resultRelation */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->canSetTag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_canSetTag = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":49 * cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) * cdef object v_canSetTag = bool(data.canSetTag) * cdef object v_utilityStmt = create(data.utilityStmt, offset_to_index) if data.utilityStmt is not NULL else None # <<<<<<<<<<<<<< * cdef object v_resultRelation = data.resultRelation * cdef object v_hasAggs = bool(data.hasAggs) */ __pyx_t_6 = (__pyx_v_data->utilityStmt != NULL); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_6pglast_6parser_create(__pyx_v_data->utilityStmt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_utilityStmt = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":50 * cdef object v_canSetTag = bool(data.canSetTag) * cdef object v_utilityStmt = create(data.utilityStmt, offset_to_index) if data.utilityStmt is not NULL else None * cdef object v_resultRelation = data.resultRelation # <<<<<<<<<<<<<< * cdef object v_hasAggs = bool(data.hasAggs) * cdef object v_hasWindowFuncs = bool(data.hasWindowFuncs) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->resultRelation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resultRelation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":51 * cdef object v_utilityStmt = create(data.utilityStmt, offset_to_index) if data.utilityStmt is not NULL else None * cdef object v_resultRelation = data.resultRelation * cdef object v_hasAggs = bool(data.hasAggs) # <<<<<<<<<<<<<< * cdef object v_hasWindowFuncs = bool(data.hasWindowFuncs) * cdef object v_hasTargetSRFs = bool(data.hasTargetSRFs) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasAggs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasAggs = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":52 * cdef object v_resultRelation = data.resultRelation * cdef object v_hasAggs = bool(data.hasAggs) * cdef object v_hasWindowFuncs = bool(data.hasWindowFuncs) # <<<<<<<<<<<<<< * cdef object v_hasTargetSRFs = bool(data.hasTargetSRFs) * cdef object v_hasSubLinks = bool(data.hasSubLinks) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasWindowFuncs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasWindowFuncs = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":53 * cdef object v_hasAggs = bool(data.hasAggs) * cdef object v_hasWindowFuncs = bool(data.hasWindowFuncs) * cdef object v_hasTargetSRFs = bool(data.hasTargetSRFs) # <<<<<<<<<<<<<< * cdef object v_hasSubLinks = bool(data.hasSubLinks) * cdef object v_hasDistinctOn = bool(data.hasDistinctOn) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasTargetSRFs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasTargetSRFs = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":54 * cdef object v_hasWindowFuncs = bool(data.hasWindowFuncs) * cdef object v_hasTargetSRFs = bool(data.hasTargetSRFs) * cdef object v_hasSubLinks = bool(data.hasSubLinks) # <<<<<<<<<<<<<< * cdef object v_hasDistinctOn = bool(data.hasDistinctOn) * cdef object v_hasRecursive = bool(data.hasRecursive) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasSubLinks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasSubLinks = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":55 * cdef object v_hasTargetSRFs = bool(data.hasTargetSRFs) * cdef object v_hasSubLinks = bool(data.hasSubLinks) * cdef object v_hasDistinctOn = bool(data.hasDistinctOn) # <<<<<<<<<<<<<< * cdef object v_hasRecursive = bool(data.hasRecursive) * cdef object v_hasModifyingCTE = bool(data.hasModifyingCTE) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasDistinctOn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasDistinctOn = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":56 * cdef object v_hasSubLinks = bool(data.hasSubLinks) * cdef object v_hasDistinctOn = bool(data.hasDistinctOn) * cdef object v_hasRecursive = bool(data.hasRecursive) # <<<<<<<<<<<<<< * cdef object v_hasModifyingCTE = bool(data.hasModifyingCTE) * cdef object v_hasForUpdate = bool(data.hasForUpdate) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasRecursive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasRecursive = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":57 * cdef object v_hasDistinctOn = bool(data.hasDistinctOn) * cdef object v_hasRecursive = bool(data.hasRecursive) * cdef object v_hasModifyingCTE = bool(data.hasModifyingCTE) # <<<<<<<<<<<<<< * cdef object v_hasForUpdate = bool(data.hasForUpdate) * cdef object v_hasRowSecurity = bool(data.hasRowSecurity) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasModifyingCTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasModifyingCTE = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":58 * cdef object v_hasRecursive = bool(data.hasRecursive) * cdef object v_hasModifyingCTE = bool(data.hasModifyingCTE) * cdef object v_hasForUpdate = bool(data.hasForUpdate) # <<<<<<<<<<<<<< * cdef object v_hasRowSecurity = bool(data.hasRowSecurity) * cdef object v_isReturn = bool(data.isReturn) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasForUpdate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasForUpdate = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":59 * cdef object v_hasModifyingCTE = bool(data.hasModifyingCTE) * cdef object v_hasForUpdate = bool(data.hasForUpdate) * cdef object v_hasRowSecurity = bool(data.hasRowSecurity) # <<<<<<<<<<<<<< * cdef object v_isReturn = bool(data.isReturn) * cdef tuple v_cteList = _pg_list_to_tuple(data.cteList, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hasRowSecurity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hasRowSecurity = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":60 * cdef object v_hasForUpdate = bool(data.hasForUpdate) * cdef object v_hasRowSecurity = bool(data.hasRowSecurity) * cdef object v_isReturn = bool(data.isReturn) # <<<<<<<<<<<<<< * cdef tuple v_cteList = _pg_list_to_tuple(data.cteList, offset_to_index) * cdef tuple v_rtable = _pg_list_to_tuple(data.rtable, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isReturn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isReturn = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":61 * cdef object v_hasRowSecurity = bool(data.hasRowSecurity) * cdef object v_isReturn = bool(data.isReturn) * cdef tuple v_cteList = _pg_list_to_tuple(data.cteList, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_rtable = _pg_list_to_tuple(data.rtable, offset_to_index) * cdef tuple v_rteperminfos = _pg_list_to_tuple(data.rteperminfos, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->cteList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 61, __pyx_L1_error) __pyx_v_v_cteList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":62 * cdef object v_isReturn = bool(data.isReturn) * cdef tuple v_cteList = _pg_list_to_tuple(data.cteList, offset_to_index) * cdef tuple v_rtable = _pg_list_to_tuple(data.rtable, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_rteperminfos = _pg_list_to_tuple(data.rteperminfos, offset_to_index) * cdef object v_jointree = create(data.jointree, offset_to_index) if data.jointree is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->rtable, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 62, __pyx_L1_error) __pyx_v_v_rtable = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":63 * cdef tuple v_cteList = _pg_list_to_tuple(data.cteList, offset_to_index) * cdef tuple v_rtable = _pg_list_to_tuple(data.rtable, offset_to_index) * cdef tuple v_rteperminfos = _pg_list_to_tuple(data.rteperminfos, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_jointree = create(data.jointree, offset_to_index) if data.jointree is not NULL else None * cdef tuple v_mergeActionList = _pg_list_to_tuple(data.mergeActionList, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->rteperminfos, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_v_v_rteperminfos = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":64 * cdef tuple v_rtable = _pg_list_to_tuple(data.rtable, offset_to_index) * cdef tuple v_rteperminfos = _pg_list_to_tuple(data.rteperminfos, offset_to_index) * cdef object v_jointree = create(data.jointree, offset_to_index) if data.jointree is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_mergeActionList = _pg_list_to_tuple(data.mergeActionList, offset_to_index) * cdef object v_mergeTargetRelation = data.mergeTargetRelation */ __pyx_t_6 = (__pyx_v_data->jointree != NULL); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_6pglast_6parser_create(__pyx_v_data->jointree, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_jointree = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":65 * cdef tuple v_rteperminfos = _pg_list_to_tuple(data.rteperminfos, offset_to_index) * cdef object v_jointree = create(data.jointree, offset_to_index) if data.jointree is not NULL else None * cdef tuple v_mergeActionList = _pg_list_to_tuple(data.mergeActionList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_mergeTargetRelation = data.mergeTargetRelation * cdef object v_mergeJoinCondition = create(data.mergeJoinCondition, offset_to_index) if data.mergeJoinCondition is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->mergeActionList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_v_v_mergeActionList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":66 * cdef object v_jointree = create(data.jointree, offset_to_index) if data.jointree is not NULL else None * cdef tuple v_mergeActionList = _pg_list_to_tuple(data.mergeActionList, offset_to_index) * cdef object v_mergeTargetRelation = data.mergeTargetRelation # <<<<<<<<<<<<<< * cdef object v_mergeJoinCondition = create(data.mergeJoinCondition, offset_to_index) if data.mergeJoinCondition is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->mergeTargetRelation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_mergeTargetRelation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":67 * cdef tuple v_mergeActionList = _pg_list_to_tuple(data.mergeActionList, offset_to_index) * cdef object v_mergeTargetRelation = data.mergeTargetRelation * cdef object v_mergeJoinCondition = create(data.mergeJoinCondition, offset_to_index) if data.mergeJoinCondition is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) */ __pyx_t_6 = (__pyx_v_data->mergeJoinCondition != NULL); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_6pglast_6parser_create(__pyx_v_data->mergeJoinCondition, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_mergeJoinCondition = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":68 * cdef object v_mergeTargetRelation = data.mergeTargetRelation * cdef object v_mergeJoinCondition = create(data.mergeJoinCondition, offset_to_index) if data.mergeJoinCondition is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_onConflict = create(data.onConflict, offset_to_index) if data.onConflict is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->targetList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 68, __pyx_L1_error) __pyx_v_v_targetList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":69 * cdef object v_mergeJoinCondition = create(data.mergeJoinCondition, offset_to_index) if data.mergeJoinCondition is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) # <<<<<<<<<<<<<< * cdef object v_onConflict = create(data.onConflict, offset_to_index) if data.onConflict is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_OverridingKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_OverridingKind(__pyx_v_data->override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_override = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":70 * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_onConflict = create(data.onConflict, offset_to_index) if data.onConflict is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->onConflict != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->onConflict, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_onConflict = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":71 * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_onConflict = create(data.onConflict, offset_to_index) if data.onConflict is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) * cdef object v_groupDistinct = bool(data.groupDistinct) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->returningList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 71, __pyx_L1_error) __pyx_v_v_returningList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":72 * cdef object v_onConflict = create(data.onConflict, offset_to_index) if data.onConflict is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_groupDistinct = bool(data.groupDistinct) * cdef tuple v_groupingSets = _pg_list_to_tuple(data.groupingSets, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->groupClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_v_v_groupClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":73 * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) * cdef object v_groupDistinct = bool(data.groupDistinct) # <<<<<<<<<<<<<< * cdef tuple v_groupingSets = _pg_list_to_tuple(data.groupingSets, offset_to_index) * cdef object v_havingQual = create(data.havingQual, offset_to_index) if data.havingQual is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->groupDistinct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_groupDistinct = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":74 * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) * cdef object v_groupDistinct = bool(data.groupDistinct) * cdef tuple v_groupingSets = _pg_list_to_tuple(data.groupingSets, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_havingQual = create(data.havingQual, offset_to_index) if data.havingQual is not NULL else None * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->groupingSets, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 74, __pyx_L1_error) __pyx_v_v_groupingSets = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":75 * cdef object v_groupDistinct = bool(data.groupDistinct) * cdef tuple v_groupingSets = _pg_list_to_tuple(data.groupingSets, offset_to_index) * cdef object v_havingQual = create(data.havingQual, offset_to_index) if data.havingQual is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->havingQual != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->havingQual, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_havingQual = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":76 * cdef tuple v_groupingSets = _pg_list_to_tuple(data.groupingSets, offset_to_index) * cdef object v_havingQual = create(data.havingQual, offset_to_index) if data.havingQual is not NULL else None * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->windowClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 76, __pyx_L1_error) __pyx_v_v_windowClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":77 * cdef object v_havingQual = create(data.havingQual, offset_to_index) if data.havingQual is not NULL else None * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->distinctClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_v_v_distinctClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":78 * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->sortClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_v_v_sortClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":79 * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None # <<<<<<<<<<<<<< * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) */ __pyx_t_6 = (__pyx_v_data->limitOffset != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->limitOffset, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_limitOffset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":80 * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None # <<<<<<<<<<<<<< * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) * cdef tuple v_rowMarks = _pg_list_to_tuple(data.rowMarks, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->limitCount != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->limitCount, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_limitCount = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":81 * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) # <<<<<<<<<<<<<< * cdef tuple v_rowMarks = _pg_list_to_tuple(data.rowMarks, offset_to_index) * cdef object v_setOperations = create(data.setOperations, offset_to_index) if data.setOperations is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_LimitOption); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_LimitOption(__pyx_v_data->limitOption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_limitOption = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":82 * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) * cdef tuple v_rowMarks = _pg_list_to_tuple(data.rowMarks, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_setOperations = create(data.setOperations, offset_to_index) if data.setOperations is not NULL else None * cdef tuple v_constraintDeps = _pg_list_to_tuple(data.constraintDeps, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->rowMarks, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_v_v_rowMarks = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":83 * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) * cdef tuple v_rowMarks = _pg_list_to_tuple(data.rowMarks, offset_to_index) * cdef object v_setOperations = create(data.setOperations, offset_to_index) if data.setOperations is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_constraintDeps = _pg_list_to_tuple(data.constraintDeps, offset_to_index) * cdef tuple v_withCheckOptions = _pg_list_to_tuple(data.withCheckOptions, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->setOperations != NULL); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_6pglast_6parser_create(__pyx_v_data->setOperations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_setOperations = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":84 * cdef tuple v_rowMarks = _pg_list_to_tuple(data.rowMarks, offset_to_index) * cdef object v_setOperations = create(data.setOperations, offset_to_index) if data.setOperations is not NULL else None * cdef tuple v_constraintDeps = _pg_list_to_tuple(data.constraintDeps, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_withCheckOptions = _pg_list_to_tuple(data.withCheckOptions, offset_to_index) * cdef object v_stmt_location = offset_to_index(data.stmt_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->constraintDeps, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 84, __pyx_L1_error) __pyx_v_v_constraintDeps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":85 * cdef object v_setOperations = create(data.setOperations, offset_to_index) if data.setOperations is not NULL else None * cdef tuple v_constraintDeps = _pg_list_to_tuple(data.constraintDeps, offset_to_index) * cdef tuple v_withCheckOptions = _pg_list_to_tuple(data.withCheckOptions, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_stmt_location = offset_to_index(data.stmt_location) * cdef object v_stmt_len = offset_to_index(data.stmt_len) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->withCheckOptions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_v_v_withCheckOptions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":86 * cdef tuple v_constraintDeps = _pg_list_to_tuple(data.constraintDeps, offset_to_index) * cdef tuple v_withCheckOptions = _pg_list_to_tuple(data.withCheckOptions, offset_to_index) * cdef object v_stmt_location = offset_to_index(data.stmt_location) # <<<<<<<<<<<<<< * cdef object v_stmt_len = offset_to_index(data.stmt_len) * return ast.Query(v_commandType, v_querySource, v_canSetTag, v_utilityStmt, v_resultRelation, v_hasAggs, v_hasWindowFuncs, v_hasTargetSRFs, v_hasSubLinks, v_hasDistinctOn, v_hasRecursive, v_hasModifyingCTE, v_hasForUpdate, v_hasRowSecurity, v_isReturn, v_cteList, v_rtable, v_rteperminfos, v_jointree, v_mergeActionList, v_mergeTargetRelation, v_mergeJoinCondition, v_targetList, v_override, v_onConflict, v_returningList, v_groupClause, v_groupDistinct, v_groupingSets, v_havingQual, v_windowClause, v_distinctClause, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_rowMarks, v_setOperations, v_constraintDeps, v_withCheckOptions, v_stmt_location, v_stmt_len) */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->stmt_location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_stmt_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":87 * cdef tuple v_withCheckOptions = _pg_list_to_tuple(data.withCheckOptions, offset_to_index) * cdef object v_stmt_location = offset_to_index(data.stmt_location) * cdef object v_stmt_len = offset_to_index(data.stmt_len) # <<<<<<<<<<<<<< * return ast.Query(v_commandType, v_querySource, v_canSetTag, v_utilityStmt, v_resultRelation, v_hasAggs, v_hasWindowFuncs, v_hasTargetSRFs, v_hasSubLinks, v_hasDistinctOn, v_hasRecursive, v_hasModifyingCTE, v_hasForUpdate, v_hasRowSecurity, v_isReturn, v_cteList, v_rtable, v_rteperminfos, v_jointree, v_mergeActionList, v_mergeTargetRelation, v_mergeJoinCondition, v_targetList, v_override, v_onConflict, v_returningList, v_groupClause, v_groupDistinct, v_groupingSets, v_havingQual, v_windowClause, v_distinctClause, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_rowMarks, v_setOperations, v_constraintDeps, v_withCheckOptions, v_stmt_location, v_stmt_len) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->stmt_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_stmt_len = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":88 * cdef object v_stmt_location = offset_to_index(data.stmt_location) * cdef object v_stmt_len = offset_to_index(data.stmt_len) * return ast.Query(v_commandType, v_querySource, v_canSetTag, v_utilityStmt, v_resultRelation, v_hasAggs, v_hasWindowFuncs, v_hasTargetSRFs, v_hasSubLinks, v_hasDistinctOn, v_hasRecursive, v_hasModifyingCTE, v_hasForUpdate, v_hasRowSecurity, v_isReturn, v_cteList, v_rtable, v_rteperminfos, v_jointree, v_mergeActionList, v_mergeTargetRelation, v_mergeJoinCondition, v_targetList, v_override, v_onConflict, v_returningList, v_groupClause, v_groupDistinct, v_groupingSets, v_havingQual, v_windowClause, v_distinctClause, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_rowMarks, v_setOperations, v_constraintDeps, v_withCheckOptions, v_stmt_location, v_stmt_len) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Query); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[43] = {__pyx_t_2, __pyx_v_v_commandType, __pyx_v_v_querySource, __pyx_v_v_canSetTag, __pyx_v_v_utilityStmt, __pyx_v_v_resultRelation, __pyx_v_v_hasAggs, __pyx_v_v_hasWindowFuncs, __pyx_v_v_hasTargetSRFs, __pyx_v_v_hasSubLinks, __pyx_v_v_hasDistinctOn, __pyx_v_v_hasRecursive, __pyx_v_v_hasModifyingCTE, __pyx_v_v_hasForUpdate, __pyx_v_v_hasRowSecurity, __pyx_v_v_isReturn, __pyx_v_v_cteList, __pyx_v_v_rtable, __pyx_v_v_rteperminfos, __pyx_v_v_jointree, __pyx_v_v_mergeActionList, __pyx_v_v_mergeTargetRelation, __pyx_v_v_mergeJoinCondition, __pyx_v_v_targetList, __pyx_v_v_override, __pyx_v_v_onConflict, __pyx_v_v_returningList, __pyx_v_v_groupClause, __pyx_v_v_groupDistinct, __pyx_v_v_groupingSets, __pyx_v_v_havingQual, __pyx_v_v_windowClause, __pyx_v_v_distinctClause, __pyx_v_v_sortClause, __pyx_v_v_limitOffset, __pyx_v_v_limitCount, __pyx_v_v_limitOption, __pyx_v_v_rowMarks, __pyx_v_v_setOperations, __pyx_v_v_constraintDeps, __pyx_v_v_withCheckOptions, __pyx_v_v_stmt_location, __pyx_v_v_stmt_len}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 42+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":45 * * * cdef create_Query(structs.Query* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_querySource = getattr(enums, 'QuerySource')(data.querySource) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_Query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_commandType); __Pyx_XDECREF(__pyx_v_v_querySource); __Pyx_XDECREF(__pyx_v_v_canSetTag); __Pyx_XDECREF(__pyx_v_v_utilityStmt); __Pyx_XDECREF(__pyx_v_v_resultRelation); __Pyx_XDECREF(__pyx_v_v_hasAggs); __Pyx_XDECREF(__pyx_v_v_hasWindowFuncs); __Pyx_XDECREF(__pyx_v_v_hasTargetSRFs); __Pyx_XDECREF(__pyx_v_v_hasSubLinks); __Pyx_XDECREF(__pyx_v_v_hasDistinctOn); __Pyx_XDECREF(__pyx_v_v_hasRecursive); __Pyx_XDECREF(__pyx_v_v_hasModifyingCTE); __Pyx_XDECREF(__pyx_v_v_hasForUpdate); __Pyx_XDECREF(__pyx_v_v_hasRowSecurity); __Pyx_XDECREF(__pyx_v_v_isReturn); __Pyx_XDECREF(__pyx_v_v_cteList); __Pyx_XDECREF(__pyx_v_v_rtable); __Pyx_XDECREF(__pyx_v_v_rteperminfos); __Pyx_XDECREF(__pyx_v_v_jointree); __Pyx_XDECREF(__pyx_v_v_mergeActionList); __Pyx_XDECREF(__pyx_v_v_mergeTargetRelation); __Pyx_XDECREF(__pyx_v_v_mergeJoinCondition); __Pyx_XDECREF(__pyx_v_v_targetList); __Pyx_XDECREF(__pyx_v_v_override); __Pyx_XDECREF(__pyx_v_v_onConflict); __Pyx_XDECREF(__pyx_v_v_returningList); __Pyx_XDECREF(__pyx_v_v_groupClause); __Pyx_XDECREF(__pyx_v_v_groupDistinct); __Pyx_XDECREF(__pyx_v_v_groupingSets); __Pyx_XDECREF(__pyx_v_v_havingQual); __Pyx_XDECREF(__pyx_v_v_windowClause); __Pyx_XDECREF(__pyx_v_v_distinctClause); __Pyx_XDECREF(__pyx_v_v_sortClause); __Pyx_XDECREF(__pyx_v_v_limitOffset); __Pyx_XDECREF(__pyx_v_v_limitCount); __Pyx_XDECREF(__pyx_v_v_limitOption); __Pyx_XDECREF(__pyx_v_v_rowMarks); __Pyx_XDECREF(__pyx_v_v_setOperations); __Pyx_XDECREF(__pyx_v_v_constraintDeps); __Pyx_XDECREF(__pyx_v_v_withCheckOptions); __Pyx_XDECREF(__pyx_v_v_stmt_location); __Pyx_XDECREF(__pyx_v_v_stmt_len); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":91 * * * cdef create_TypeName(structs.TypeName* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_names = _pg_list_to_tuple(data.names, offset_to_index) * cdef object v_setof = bool(data.setof) */ static PyObject *__pyx_f_6pglast_6parser_create_TypeName(TypeName *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_names = 0; PyObject *__pyx_v_v_setof = 0; PyObject *__pyx_v_v_pct_type = 0; PyObject *__pyx_v_v_typmods = 0; PyObject *__pyx_v_v_typemod = 0; PyObject *__pyx_v_v_arrayBounds = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TypeName", 1); /* "pglast/ast.pyx":92 * * cdef create_TypeName(structs.TypeName* data, offset_to_index): * cdef tuple v_names = _pg_list_to_tuple(data.names, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_setof = bool(data.setof) * cdef object v_pct_type = bool(data.pct_type) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->names, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 92, __pyx_L1_error) __pyx_v_v_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":93 * cdef create_TypeName(structs.TypeName* data, offset_to_index): * cdef tuple v_names = _pg_list_to_tuple(data.names, offset_to_index) * cdef object v_setof = bool(data.setof) # <<<<<<<<<<<<<< * cdef object v_pct_type = bool(data.pct_type) * cdef tuple v_typmods = _pg_list_to_tuple(data.typmods, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->setof); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_setof = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":94 * cdef tuple v_names = _pg_list_to_tuple(data.names, offset_to_index) * cdef object v_setof = bool(data.setof) * cdef object v_pct_type = bool(data.pct_type) # <<<<<<<<<<<<<< * cdef tuple v_typmods = _pg_list_to_tuple(data.typmods, offset_to_index) * cdef object v_typemod = data.typemod */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->pct_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_pct_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":95 * cdef object v_setof = bool(data.setof) * cdef object v_pct_type = bool(data.pct_type) * cdef tuple v_typmods = _pg_list_to_tuple(data.typmods, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_typemod = data.typemod * cdef tuple v_arrayBounds = _pg_list_to_tuple(data.arrayBounds, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->typmods, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 95, __pyx_L1_error) __pyx_v_v_typmods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":96 * cdef object v_pct_type = bool(data.pct_type) * cdef tuple v_typmods = _pg_list_to_tuple(data.typmods, offset_to_index) * cdef object v_typemod = data.typemod # <<<<<<<<<<<<<< * cdef tuple v_arrayBounds = _pg_list_to_tuple(data.arrayBounds, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typemod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typemod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":97 * cdef tuple v_typmods = _pg_list_to_tuple(data.typmods, offset_to_index) * cdef object v_typemod = data.typemod * cdef tuple v_arrayBounds = _pg_list_to_tuple(data.arrayBounds, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.TypeName(v_names, v_setof, v_pct_type, v_typmods, v_typemod, v_arrayBounds, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->arrayBounds, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_v_v_arrayBounds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":98 * cdef object v_typemod = data.typemod * cdef tuple v_arrayBounds = _pg_list_to_tuple(data.arrayBounds, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.TypeName(v_names, v_setof, v_pct_type, v_typmods, v_typemod, v_arrayBounds, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":99 * cdef tuple v_arrayBounds = _pg_list_to_tuple(data.arrayBounds, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.TypeName(v_names, v_setof, v_pct_type, v_typmods, v_typemod, v_arrayBounds, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_TypeName); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_v_v_names, __pyx_v_v_setof, __pyx_v_v_pct_type, __pyx_v_v_typmods, __pyx_v_v_typemod, __pyx_v_v_arrayBounds, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 7+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":91 * * * cdef create_TypeName(structs.TypeName* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_names = _pg_list_to_tuple(data.names, offset_to_index) * cdef object v_setof = bool(data.setof) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_TypeName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_names); __Pyx_XDECREF(__pyx_v_v_setof); __Pyx_XDECREF(__pyx_v_v_pct_type); __Pyx_XDECREF(__pyx_v_v_typmods); __Pyx_XDECREF(__pyx_v_v_typemod); __Pyx_XDECREF(__pyx_v_v_arrayBounds); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":102 * * * cdef create_ColumnRef(structs.ColumnRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_fields = _pg_list_to_tuple(data.fields, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_ColumnRef(ColumnRef *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_fields = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ColumnRef", 1); /* "pglast/ast.pyx":103 * * cdef create_ColumnRef(structs.ColumnRef* data, offset_to_index): * cdef tuple v_fields = _pg_list_to_tuple(data.fields, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ColumnRef(v_fields, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fields, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 103, __pyx_L1_error) __pyx_v_v_fields = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":104 * cdef create_ColumnRef(structs.ColumnRef* data, offset_to_index): * cdef tuple v_fields = _pg_list_to_tuple(data.fields, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ColumnRef(v_fields, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":105 * cdef tuple v_fields = _pg_list_to_tuple(data.fields, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.ColumnRef(v_fields, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ColumnRef); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_fields, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":102 * * * cdef create_ColumnRef(structs.ColumnRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_fields = _pg_list_to_tuple(data.fields, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ColumnRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_fields); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":108 * * * cdef create_ParamRef(structs.ParamRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_number = data.number * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_ParamRef(ParamRef *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_number = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ParamRef", 1); /* "pglast/ast.pyx":109 * * cdef create_ParamRef(structs.ParamRef* data, offset_to_index): * cdef object v_number = data.number # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ParamRef(v_number, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_number = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":110 * cdef create_ParamRef(structs.ParamRef* data, offset_to_index): * cdef object v_number = data.number * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ParamRef(v_number, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":111 * cdef object v_number = data.number * cdef object v_location = offset_to_index(data.location) * return ast.ParamRef(v_number, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ParamRef); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_number, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":108 * * * cdef create_ParamRef(structs.ParamRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_number = data.number * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ParamRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_number); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":114 * * * cdef create_A_Expr(structs.A_Expr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'A_Expr_Kind')(data.kind) * cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_A_Expr(A_Expr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_lexpr = 0; PyObject *__pyx_v_v_rexpr = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_A_Expr", 1); /* "pglast/ast.pyx":115 * * cdef create_A_Expr(structs.A_Expr* data, offset_to_index): * cdef object v_kind = getattr(enums, 'A_Expr_Kind')(data.kind) # <<<<<<<<<<<<<< * cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) * cdef object v_lexpr = create(data.lexpr, offset_to_index) if data.lexpr is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_A_Expr_Kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_A_Expr_Kind(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":116 * cdef create_A_Expr(structs.A_Expr* data, offset_to_index): * cdef object v_kind = getattr(enums, 'A_Expr_Kind')(data.kind) * cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_lexpr = create(data.lexpr, offset_to_index) if data.lexpr is not NULL else None * cdef object v_rexpr = create(data.rexpr, offset_to_index) if data.rexpr is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 116, __pyx_L1_error) __pyx_v_v_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":117 * cdef object v_kind = getattr(enums, 'A_Expr_Kind')(data.kind) * cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) * cdef object v_lexpr = create(data.lexpr, offset_to_index) if data.lexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rexpr = create(data.rexpr, offset_to_index) if data.rexpr is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->lexpr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->lexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_lexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":118 * cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) * cdef object v_lexpr = create(data.lexpr, offset_to_index) if data.lexpr is not NULL else None * cdef object v_rexpr = create(data.rexpr, offset_to_index) if data.rexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.A_Expr(v_kind, v_name, v_lexpr, v_rexpr, v_location) */ __pyx_t_6 = (__pyx_v_data->rexpr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":119 * cdef object v_lexpr = create(data.lexpr, offset_to_index) if data.lexpr is not NULL else None * cdef object v_rexpr = create(data.rexpr, offset_to_index) if data.rexpr is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.A_Expr(v_kind, v_name, v_lexpr, v_rexpr, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":120 * cdef object v_rexpr = create(data.rexpr, offset_to_index) if data.rexpr is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.A_Expr(v_kind, v_name, v_lexpr, v_rexpr, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_A_Expr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_v_kind, __pyx_v_v_name, __pyx_v_v_lexpr, __pyx_v_v_rexpr, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":114 * * * cdef create_A_Expr(structs.A_Expr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'A_Expr_Kind')(data.kind) * cdef tuple v_name = _pg_list_to_tuple(data.name, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_A_Expr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_lexpr); __Pyx_XDECREF(__pyx_v_v_rexpr); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":123 * * * cdef create_TypeCast(structs.TypeCast* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_TypeCast(TypeCast *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TypeCast", 1); /* "pglast/ast.pyx":124 * * cdef create_TypeCast(structs.TypeCast* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":125 * cdef create_TypeCast(structs.TypeCast* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.TypeCast(v_arg, v_typeName, v_location) */ __pyx_t_2 = (__pyx_v_data->typeName != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":126 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.TypeCast(v_arg, v_typeName, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":127 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.TypeCast(v_arg, v_typeName, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_TypeCast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_arg, __pyx_v_v_typeName, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":123 * * * cdef create_TypeCast(structs.TypeCast* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_TypeCast", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":130 * * * cdef create_CollateClause(structs.CollateClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CollateClause(CollateClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_collname = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CollateClause", 1); /* "pglast/ast.pyx":131 * * cdef create_CollateClause(structs.CollateClause* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":132 * cdef create_CollateClause(structs.CollateClause* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CollateClause(v_arg, v_collname, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->collname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 132, __pyx_L1_error) __pyx_v_v_collname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":133 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CollateClause(v_arg, v_collname, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":134 * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.CollateClause(v_arg, v_collname, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CollateClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_arg, __pyx_v_v_collname, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":130 * * * cdef create_CollateClause(structs.CollateClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CollateClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_collname); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":137 * * * cdef create_RoleSpec(structs.RoleSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_roletype = getattr(enums, 'RoleSpecType')(data.roletype) * cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RoleSpec(RoleSpec *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_roletype = 0; PyObject *__pyx_v_v_rolename = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RoleSpec", 1); /* "pglast/ast.pyx":138 * * cdef create_RoleSpec(structs.RoleSpec* data, offset_to_index): * cdef object v_roletype = getattr(enums, 'RoleSpecType')(data.roletype) # <<<<<<<<<<<<<< * cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_RoleSpecType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_RoleSpecType(__pyx_v_data->roletype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_roletype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":139 * cdef create_RoleSpec(structs.RoleSpec* data, offset_to_index): * cdef object v_roletype = getattr(enums, 'RoleSpecType')(data.roletype) * cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RoleSpec(v_roletype, v_rolename, v_location) */ __pyx_t_6 = (__pyx_v_data->rolename != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->rolename; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rolename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":140 * cdef object v_roletype = getattr(enums, 'RoleSpecType')(data.roletype) * cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RoleSpec(v_roletype, v_rolename, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":141 * cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.RoleSpec(v_roletype, v_rolename, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RoleSpec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_roletype, __pyx_v_v_rolename, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":137 * * * cdef create_RoleSpec(structs.RoleSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_roletype = getattr(enums, 'RoleSpecType')(data.roletype) * cdef object v_rolename = data.rolename.decode("utf-8") if data.rolename is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RoleSpec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_roletype); __Pyx_XDECREF(__pyx_v_v_rolename); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":144 * * * cdef create_FuncCall(structs.FuncCall* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_FuncCall(FuncCall *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_funcname = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_agg_order = 0; PyObject *__pyx_v_v_agg_filter = 0; PyObject *__pyx_v_v_over = 0; PyObject *__pyx_v_v_agg_within_group = 0; PyObject *__pyx_v_v_agg_star = 0; PyObject *__pyx_v_v_agg_distinct = 0; PyObject *__pyx_v_v_func_variadic = 0; PyObject *__pyx_v_v_funcformat = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FuncCall", 1); /* "pglast/ast.pyx":145 * * cdef create_FuncCall(structs.FuncCall* data, offset_to_index): * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funcname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 145, __pyx_L1_error) __pyx_v_v_funcname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":146 * cdef create_FuncCall(structs.FuncCall* data, offset_to_index): * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":147 * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->agg_order, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_v_v_agg_order = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":148 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None # <<<<<<<<<<<<<< * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None * cdef object v_agg_within_group = bool(data.agg_within_group) */ __pyx_t_2 = (__pyx_v_data->agg_filter != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->agg_filter, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_agg_filter = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":149 * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None # <<<<<<<<<<<<<< * cdef object v_agg_within_group = bool(data.agg_within_group) * cdef object v_agg_star = bool(data.agg_star) */ __pyx_t_2 = (__pyx_v_data->over != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->over, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_over = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":150 * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None * cdef object v_agg_within_group = bool(data.agg_within_group) # <<<<<<<<<<<<<< * cdef object v_agg_star = bool(data.agg_star) * cdef object v_agg_distinct = bool(data.agg_distinct) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->agg_within_group); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_agg_within_group = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":151 * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None * cdef object v_agg_within_group = bool(data.agg_within_group) * cdef object v_agg_star = bool(data.agg_star) # <<<<<<<<<<<<<< * cdef object v_agg_distinct = bool(data.agg_distinct) * cdef object v_func_variadic = bool(data.func_variadic) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->agg_star); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_agg_star = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":152 * cdef object v_agg_within_group = bool(data.agg_within_group) * cdef object v_agg_star = bool(data.agg_star) * cdef object v_agg_distinct = bool(data.agg_distinct) # <<<<<<<<<<<<<< * cdef object v_func_variadic = bool(data.func_variadic) * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->agg_distinct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_agg_distinct = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":153 * cdef object v_agg_star = bool(data.agg_star) * cdef object v_agg_distinct = bool(data.agg_distinct) * cdef object v_func_variadic = bool(data.func_variadic) # <<<<<<<<<<<<<< * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->func_variadic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_func_variadic = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":154 * cdef object v_agg_distinct = bool(data.agg_distinct) * cdef object v_func_variadic = bool(data.func_variadic) * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.FuncCall(v_funcname, v_args, v_agg_order, v_agg_filter, v_over, v_agg_within_group, v_agg_star, v_agg_distinct, v_func_variadic, v_funcformat, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->funcformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_funcformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":155 * cdef object v_func_variadic = bool(data.func_variadic) * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.FuncCall(v_funcname, v_args, v_agg_order, v_agg_filter, v_over, v_agg_within_group, v_agg_star, v_agg_distinct, v_func_variadic, v_funcformat, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":156 * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) * cdef object v_location = offset_to_index(data.location) * return ast.FuncCall(v_funcname, v_args, v_agg_order, v_agg_filter, v_over, v_agg_within_group, v_agg_star, v_agg_distinct, v_func_variadic, v_funcformat, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FuncCall); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[12] = {__pyx_t_3, __pyx_v_v_funcname, __pyx_v_v_args, __pyx_v_v_agg_order, __pyx_v_v_agg_filter, __pyx_v_v_over, __pyx_v_v_agg_within_group, __pyx_v_v_agg_star, __pyx_v_v_agg_distinct, __pyx_v_v_func_variadic, __pyx_v_v_funcformat, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 11+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":144 * * * cdef create_FuncCall(structs.FuncCall* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_FuncCall", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_funcname); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_agg_order); __Pyx_XDECREF(__pyx_v_v_agg_filter); __Pyx_XDECREF(__pyx_v_v_over); __Pyx_XDECREF(__pyx_v_v_agg_within_group); __Pyx_XDECREF(__pyx_v_v_agg_star); __Pyx_XDECREF(__pyx_v_v_agg_distinct); __Pyx_XDECREF(__pyx_v_v_func_variadic); __Pyx_XDECREF(__pyx_v_v_funcformat); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":159 * * * cdef create_A_Star(structs.A_Star* data, offset_to_index): # <<<<<<<<<<<<<< * return ast.A_Star() * */ static PyObject *__pyx_f_6pglast_6parser_create_A_Star(CYTHON_UNUSED A_Star *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_A_Star", 1); /* "pglast/ast.pyx":160 * * cdef create_A_Star(structs.A_Star* data, offset_to_index): * return ast.A_Star() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_A_Star); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":159 * * * cdef create_A_Star(structs.A_Star* data, offset_to_index): # <<<<<<<<<<<<<< * return ast.A_Star() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_A_Star", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":163 * * * cdef create_A_Indices(structs.A_Indices* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_is_slice = bool(data.is_slice) * cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_A_Indices(A_Indices *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_is_slice = 0; PyObject *__pyx_v_v_lidx = 0; PyObject *__pyx_v_v_uidx = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_A_Indices", 1); /* "pglast/ast.pyx":164 * * cdef create_A_Indices(structs.A_Indices* data, offset_to_index): * cdef object v_is_slice = bool(data.is_slice) # <<<<<<<<<<<<<< * cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None * cdef object v_uidx = create(data.uidx, offset_to_index) if data.uidx is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_slice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_slice = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":165 * cdef create_A_Indices(structs.A_Indices* data, offset_to_index): * cdef object v_is_slice = bool(data.is_slice) * cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None # <<<<<<<<<<<<<< * cdef object v_uidx = create(data.uidx, offset_to_index) if data.uidx is not NULL else None * return ast.A_Indices(v_is_slice, v_lidx, v_uidx) */ __pyx_t_2 = (__pyx_v_data->lidx != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->lidx, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_lidx = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":166 * cdef object v_is_slice = bool(data.is_slice) * cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None * cdef object v_uidx = create(data.uidx, offset_to_index) if data.uidx is not NULL else None # <<<<<<<<<<<<<< * return ast.A_Indices(v_is_slice, v_lidx, v_uidx) * */ __pyx_t_2 = (__pyx_v_data->uidx != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->uidx, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_uidx = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":167 * cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None * cdef object v_uidx = create(data.uidx, offset_to_index) if data.uidx is not NULL else None * return ast.A_Indices(v_is_slice, v_lidx, v_uidx) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_A_Indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_is_slice, __pyx_v_v_lidx, __pyx_v_v_uidx}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":163 * * * cdef create_A_Indices(structs.A_Indices* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_is_slice = bool(data.is_slice) * cdef object v_lidx = create(data.lidx, offset_to_index) if data.lidx is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_A_Indices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_is_slice); __Pyx_XDECREF(__pyx_v_v_lidx); __Pyx_XDECREF(__pyx_v_v_uidx); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":170 * * * cdef create_A_Indirection(structs.A_Indirection* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_A_Indirection(A_Indirection *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_indirection = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_A_Indirection", 1); /* "pglast/ast.pyx":171 * * cdef create_A_Indirection(structs.A_Indirection* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * return ast.A_Indirection(v_arg, v_indirection) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":172 * cdef create_A_Indirection(structs.A_Indirection* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) # <<<<<<<<<<<<<< * return ast.A_Indirection(v_arg, v_indirection) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->indirection, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_v_v_indirection = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":173 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * return ast.A_Indirection(v_arg, v_indirection) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_A_Indirection); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_indirection}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":170 * * * cdef create_A_Indirection(structs.A_Indirection* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_A_Indirection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_indirection); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":176 * * * cdef create_A_ArrayExpr(structs.A_ArrayExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_A_ArrayExpr(A_ArrayExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_elements = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_A_ArrayExpr", 1); /* "pglast/ast.pyx":177 * * cdef create_A_ArrayExpr(structs.A_ArrayExpr* data, offset_to_index): * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.A_ArrayExpr(v_elements, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->elements, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_v_v_elements = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":178 * cdef create_A_ArrayExpr(structs.A_ArrayExpr* data, offset_to_index): * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.A_ArrayExpr(v_elements, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":179 * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.A_ArrayExpr(v_elements, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_A_ArrayExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_elements, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":176 * * * cdef create_A_ArrayExpr(structs.A_ArrayExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_A_ArrayExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_elements); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":182 * * * cdef create_ResTarget(structs.ResTarget* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_ResTarget(ResTarget *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_indirection = 0; PyObject *__pyx_v_v_val = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ResTarget", 1); /* "pglast/ast.pyx":183 * * cdef create_ResTarget(structs.ResTarget* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 183, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":184 * cdef create_ResTarget(structs.ResTarget* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->indirection, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_v_v_indirection = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":185 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ResTarget(v_name, v_indirection, v_val, v_location) */ __pyx_t_2 = (__pyx_v_data->val != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->val, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":186 * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ResTarget(v_name, v_indirection, v_val, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":187 * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.ResTarget(v_name, v_indirection, v_val, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ResTarget); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_v_name, __pyx_v_v_indirection, __pyx_v_v_val, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":182 * * * cdef create_ResTarget(structs.ResTarget* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_ResTarget", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_indirection); __Pyx_XDECREF(__pyx_v_v_val); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":190 * * * cdef create_MultiAssignRef(structs.MultiAssignRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_source = create(data.source, offset_to_index) if data.source is not NULL else None * cdef object v_colno = data.colno */ static PyObject *__pyx_f_6pglast_6parser_create_MultiAssignRef(MultiAssignRef *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_source = 0; PyObject *__pyx_v_v_colno = 0; PyObject *__pyx_v_v_ncolumns = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_MultiAssignRef", 1); /* "pglast/ast.pyx":191 * * cdef create_MultiAssignRef(structs.MultiAssignRef* data, offset_to_index): * cdef object v_source = create(data.source, offset_to_index) if data.source is not NULL else None # <<<<<<<<<<<<<< * cdef object v_colno = data.colno * cdef object v_ncolumns = data.ncolumns */ __pyx_t_2 = (__pyx_v_data->source != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->source, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_source = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":192 * cdef create_MultiAssignRef(structs.MultiAssignRef* data, offset_to_index): * cdef object v_source = create(data.source, offset_to_index) if data.source is not NULL else None * cdef object v_colno = data.colno # <<<<<<<<<<<<<< * cdef object v_ncolumns = data.ncolumns * return ast.MultiAssignRef(v_source, v_colno, v_ncolumns) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->colno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_colno = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":193 * cdef object v_source = create(data.source, offset_to_index) if data.source is not NULL else None * cdef object v_colno = data.colno * cdef object v_ncolumns = data.ncolumns # <<<<<<<<<<<<<< * return ast.MultiAssignRef(v_source, v_colno, v_ncolumns) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->ncolumns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_ncolumns = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":194 * cdef object v_colno = data.colno * cdef object v_ncolumns = data.ncolumns * return ast.MultiAssignRef(v_source, v_colno, v_ncolumns) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MultiAssignRef); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_source, __pyx_v_v_colno, __pyx_v_v_ncolumns}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":190 * * * cdef create_MultiAssignRef(structs.MultiAssignRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_source = create(data.source, offset_to_index) if data.source is not NULL else None * cdef object v_colno = data.colno */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_MultiAssignRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_source); __Pyx_XDECREF(__pyx_v_v_colno); __Pyx_XDECREF(__pyx_v_v_ncolumns); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":197 * * * cdef create_SortBy(structs.SortBy* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_node = create(data.node, offset_to_index) if data.node is not NULL else None * cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) */ static PyObject *__pyx_f_6pglast_6parser_create_SortBy(SortBy *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_node = 0; PyObject *__pyx_v_v_sortby_dir = 0; PyObject *__pyx_v_v_sortby_nulls = 0; PyObject *__pyx_v_v_useOp = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SortBy", 1); /* "pglast/ast.pyx":198 * * cdef create_SortBy(structs.SortBy* data, offset_to_index): * cdef object v_node = create(data.node, offset_to_index) if data.node is not NULL else None # <<<<<<<<<<<<<< * cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) * cdef object v_sortby_nulls = getattr(enums, 'SortByNulls')(data.sortby_nulls) */ __pyx_t_2 = (__pyx_v_data->node != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->node, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_node = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":199 * cdef create_SortBy(structs.SortBy* data, offset_to_index): * cdef object v_node = create(data.node, offset_to_index) if data.node is not NULL else None * cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) # <<<<<<<<<<<<<< * cdef object v_sortby_nulls = getattr(enums, 'SortByNulls')(data.sortby_nulls) * cdef tuple v_useOp = _pg_list_to_tuple(data.useOp, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_SortByDir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_SortByDir(__pyx_v_data->sortby_dir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_sortby_dir = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":200 * cdef object v_node = create(data.node, offset_to_index) if data.node is not NULL else None * cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) * cdef object v_sortby_nulls = getattr(enums, 'SortByNulls')(data.sortby_nulls) # <<<<<<<<<<<<<< * cdef tuple v_useOp = _pg_list_to_tuple(data.useOp, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_n_u_SortByNulls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_SortByNulls(__pyx_v_data->sortby_nulls); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_sortby_nulls = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":201 * cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) * cdef object v_sortby_nulls = getattr(enums, 'SortByNulls')(data.sortby_nulls) * cdef tuple v_useOp = _pg_list_to_tuple(data.useOp, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.SortBy(v_node, v_sortby_dir, v_sortby_nulls, v_useOp, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->useOp, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 201, __pyx_L1_error) __pyx_v_v_useOp = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":202 * cdef object v_sortby_nulls = getattr(enums, 'SortByNulls')(data.sortby_nulls) * cdef tuple v_useOp = _pg_list_to_tuple(data.useOp, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.SortBy(v_node, v_sortby_dir, v_sortby_nulls, v_useOp, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":203 * cdef tuple v_useOp = _pg_list_to_tuple(data.useOp, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.SortBy(v_node, v_sortby_dir, v_sortby_nulls, v_useOp, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_SortBy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_node, __pyx_v_v_sortby_dir, __pyx_v_v_sortby_nulls, __pyx_v_v_useOp, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":197 * * * cdef create_SortBy(structs.SortBy* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_node = create(data.node, offset_to_index) if data.node is not NULL else None * cdef object v_sortby_dir = getattr(enums, 'SortByDir')(data.sortby_dir) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_SortBy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_node); __Pyx_XDECREF(__pyx_v_v_sortby_dir); __Pyx_XDECREF(__pyx_v_v_sortby_nulls); __Pyx_XDECREF(__pyx_v_v_useOp); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":206 * * * cdef create_WindowDef(structs.WindowDef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_WindowDef(WindowDef *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_refname = 0; PyObject *__pyx_v_v_partitionClause = 0; PyObject *__pyx_v_v_orderClause = 0; PyObject *__pyx_v_v_frameOptions = 0; PyObject *__pyx_v_v_startOffset = 0; PyObject *__pyx_v_v_endOffset = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_WindowDef", 1); /* "pglast/ast.pyx":207 * * cdef create_WindowDef(structs.WindowDef* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":208 * cdef create_WindowDef(structs.WindowDef* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->refname != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->refname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 208, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_refname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":209 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) * cdef object v_frameOptions = data.frameOptions */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->partitionClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 209, __pyx_L1_error) __pyx_v_v_partitionClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":210 * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_frameOptions = data.frameOptions * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->orderClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 210, __pyx_L1_error) __pyx_v_v_orderClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":211 * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) * cdef object v_frameOptions = data.frameOptions # <<<<<<<<<<<<<< * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->frameOptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_frameOptions = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":212 * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) * cdef object v_frameOptions = data.frameOptions * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None # <<<<<<<<<<<<<< * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->startOffset != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->startOffset, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_startOffset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":213 * cdef object v_frameOptions = data.frameOptions * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.WindowDef(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_location) */ __pyx_t_2 = (__pyx_v_data->endOffset != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->endOffset, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_endOffset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":214 * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.WindowDef(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_7 = __pyx_v_offset_to_index; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":215 * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.WindowDef(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ast); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_WindowDef); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_7, __pyx_v_v_name, __pyx_v_v_refname, __pyx_v_v_partitionClause, __pyx_v_v_orderClause, __pyx_v_v_frameOptions, __pyx_v_v_startOffset, __pyx_v_v_endOffset, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 8+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":206 * * * cdef create_WindowDef(structs.WindowDef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.create_WindowDef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_refname); __Pyx_XDECREF(__pyx_v_v_partitionClause); __Pyx_XDECREF(__pyx_v_v_orderClause); __Pyx_XDECREF(__pyx_v_v_frameOptions); __Pyx_XDECREF(__pyx_v_v_startOffset); __Pyx_XDECREF(__pyx_v_v_endOffset); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":218 * * * cdef create_RangeSubselect(structs.RangeSubselect* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RangeSubselect(RangeSubselect *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_lateral = 0; PyObject *__pyx_v_v_subquery = 0; PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeSubselect", 1); /* "pglast/ast.pyx":219 * * cdef create_RangeSubselect(structs.RangeSubselect* data, offset_to_index): * cdef object v_lateral = bool(data.lateral) # <<<<<<<<<<<<<< * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->lateral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_lateral = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":220 * cdef create_RangeSubselect(structs.RangeSubselect* data, offset_to_index): * cdef object v_lateral = bool(data.lateral) * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * return ast.RangeSubselect(v_lateral, v_subquery, v_alias) */ __pyx_t_2 = (__pyx_v_data->subquery != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->subquery, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_subquery = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":221 * cdef object v_lateral = bool(data.lateral) * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * return ast.RangeSubselect(v_lateral, v_subquery, v_alias) * */ __pyx_t_2 = (__pyx_v_data->alias != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":222 * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * return ast.RangeSubselect(v_lateral, v_subquery, v_alias) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RangeSubselect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_lateral, __pyx_v_v_subquery, __pyx_v_v_alias}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":218 * * * cdef create_RangeSubselect(structs.RangeSubselect* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RangeSubselect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_lateral); __Pyx_XDECREF(__pyx_v_v_subquery); __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":225 * * * cdef create_RangeFunction(structs.RangeFunction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_ordinality = bool(data.ordinality) */ static PyObject *__pyx_f_6pglast_6parser_create_RangeFunction(RangeFunction *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_lateral = 0; PyObject *__pyx_v_v_ordinality = 0; PyObject *__pyx_v_v_is_rowsfrom = 0; PyObject *__pyx_v_v_functions = 0; PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_v_v_coldeflist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeFunction", 1); /* "pglast/ast.pyx":226 * * cdef create_RangeFunction(structs.RangeFunction* data, offset_to_index): * cdef object v_lateral = bool(data.lateral) # <<<<<<<<<<<<<< * cdef object v_ordinality = bool(data.ordinality) * cdef object v_is_rowsfrom = bool(data.is_rowsfrom) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->lateral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_lateral = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":227 * cdef create_RangeFunction(structs.RangeFunction* data, offset_to_index): * cdef object v_lateral = bool(data.lateral) * cdef object v_ordinality = bool(data.ordinality) # <<<<<<<<<<<<<< * cdef object v_is_rowsfrom = bool(data.is_rowsfrom) * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->ordinality); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_ordinality = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":228 * cdef object v_lateral = bool(data.lateral) * cdef object v_ordinality = bool(data.ordinality) * cdef object v_is_rowsfrom = bool(data.is_rowsfrom) # <<<<<<<<<<<<<< * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_rowsfrom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_rowsfrom = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":229 * cdef object v_ordinality = bool(data.ordinality) * cdef object v_is_rowsfrom = bool(data.is_rowsfrom) * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->functions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_v_v_functions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":230 * cdef object v_is_rowsfrom = bool(data.is_rowsfrom) * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) * return ast.RangeFunction(v_lateral, v_ordinality, v_is_rowsfrom, v_functions, v_alias, v_coldeflist) */ __pyx_t_2 = (__pyx_v_data->alias != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":231 * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) # <<<<<<<<<<<<<< * return ast.RangeFunction(v_lateral, v_ordinality, v_is_rowsfrom, v_functions, v_alias, v_coldeflist) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coldeflist, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 231, __pyx_L1_error) __pyx_v_v_coldeflist = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":232 * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) * return ast.RangeFunction(v_lateral, v_ordinality, v_is_rowsfrom, v_functions, v_alias, v_coldeflist) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RangeFunction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_lateral, __pyx_v_v_ordinality, __pyx_v_v_is_rowsfrom, __pyx_v_v_functions, __pyx_v_v_alias, __pyx_v_v_coldeflist}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":225 * * * cdef create_RangeFunction(structs.RangeFunction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_ordinality = bool(data.ordinality) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RangeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_lateral); __Pyx_XDECREF(__pyx_v_v_ordinality); __Pyx_XDECREF(__pyx_v_v_is_rowsfrom); __Pyx_XDECREF(__pyx_v_v_functions); __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XDECREF(__pyx_v_v_coldeflist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":235 * * * cdef create_RangeTableFunc(structs.RangeTableFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RangeTableFunc(RangeTableFunc *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_lateral = 0; PyObject *__pyx_v_v_docexpr = 0; PyObject *__pyx_v_v_rowexpr = 0; PyObject *__pyx_v_v_namespaces = 0; PyObject *__pyx_v_v_columns = 0; PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeTableFunc", 1); /* "pglast/ast.pyx":236 * * cdef create_RangeTableFunc(structs.RangeTableFunc* data, offset_to_index): * cdef object v_lateral = bool(data.lateral) # <<<<<<<<<<<<<< * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->lateral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_lateral = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":237 * cdef create_RangeTableFunc(structs.RangeTableFunc* data, offset_to_index): * cdef object v_lateral = bool(data.lateral) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None * cdef tuple v_namespaces = _pg_list_to_tuple(data.namespaces, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->docexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->docexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_docexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":238 * cdef object v_lateral = bool(data.lateral) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_namespaces = _pg_list_to_tuple(data.namespaces, offset_to_index) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->rowexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rowexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rowexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":239 * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None * cdef tuple v_namespaces = _pg_list_to_tuple(data.namespaces, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->namespaces, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_v_v_namespaces = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":240 * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None * cdef tuple v_namespaces = _pg_list_to_tuple(data.namespaces, offset_to_index) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->columns, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 240, __pyx_L1_error) __pyx_v_v_columns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":241 * cdef tuple v_namespaces = _pg_list_to_tuple(data.namespaces, offset_to_index) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RangeTableFunc(v_lateral, v_docexpr, v_rowexpr, v_namespaces, v_columns, v_alias, v_location) */ __pyx_t_2 = (__pyx_v_data->alias != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":242 * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RangeTableFunc(v_lateral, v_docexpr, v_rowexpr, v_namespaces, v_columns, v_alias, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":243 * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.RangeTableFunc(v_lateral, v_docexpr, v_rowexpr, v_namespaces, v_columns, v_alias, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RangeTableFunc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_v_v_lateral, __pyx_v_v_docexpr, __pyx_v_v_rowexpr, __pyx_v_v_namespaces, __pyx_v_v_columns, __pyx_v_v_alias, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 7+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":235 * * * cdef create_RangeTableFunc(structs.RangeTableFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_RangeTableFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_lateral); __Pyx_XDECREF(__pyx_v_v_docexpr); __Pyx_XDECREF(__pyx_v_v_rowexpr); __Pyx_XDECREF(__pyx_v_v_namespaces); __Pyx_XDECREF(__pyx_v_v_columns); __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":246 * * * cdef create_RangeTableFuncCol(structs.RangeTableFuncCol* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RangeTableFuncCol(RangeTableFuncCol *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_colname = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_for_ordinality = 0; PyObject *__pyx_v_v_is_not_null = 0; PyObject *__pyx_v_v_colexpr = 0; PyObject *__pyx_v_v_coldefexpr = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeTableFuncCol", 1); /* "pglast/ast.pyx":247 * * cdef create_RangeTableFuncCol(structs.RangeTableFuncCol* data, offset_to_index): * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_for_ordinality = bool(data.for_ordinality) */ __pyx_t_2 = (__pyx_v_data->colname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->colname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 247, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_colname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":248 * cdef create_RangeTableFuncCol(structs.RangeTableFuncCol* data, offset_to_index): * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_for_ordinality = bool(data.for_ordinality) * cdef object v_is_not_null = bool(data.is_not_null) */ __pyx_t_2 = (__pyx_v_data->typeName != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":249 * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_for_ordinality = bool(data.for_ordinality) # <<<<<<<<<<<<<< * cdef object v_is_not_null = bool(data.is_not_null) * cdef object v_colexpr = create(data.colexpr, offset_to_index) if data.colexpr is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->for_ordinality); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_for_ordinality = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":250 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_for_ordinality = bool(data.for_ordinality) * cdef object v_is_not_null = bool(data.is_not_null) # <<<<<<<<<<<<<< * cdef object v_colexpr = create(data.colexpr, offset_to_index) if data.colexpr is not NULL else None * cdef object v_coldefexpr = create(data.coldefexpr, offset_to_index) if data.coldefexpr is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_not_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_not_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":251 * cdef object v_for_ordinality = bool(data.for_ordinality) * cdef object v_is_not_null = bool(data.is_not_null) * cdef object v_colexpr = create(data.colexpr, offset_to_index) if data.colexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_coldefexpr = create(data.coldefexpr, offset_to_index) if data.coldefexpr is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->colexpr != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->colexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_colexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":252 * cdef object v_is_not_null = bool(data.is_not_null) * cdef object v_colexpr = create(data.colexpr, offset_to_index) if data.colexpr is not NULL else None * cdef object v_coldefexpr = create(data.coldefexpr, offset_to_index) if data.coldefexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RangeTableFuncCol(v_colname, v_typeName, v_for_ordinality, v_is_not_null, v_colexpr, v_coldefexpr, v_location) */ __pyx_t_2 = (__pyx_v_data->coldefexpr != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->coldefexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_coldefexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":253 * cdef object v_colexpr = create(data.colexpr, offset_to_index) if data.colexpr is not NULL else None * cdef object v_coldefexpr = create(data.coldefexpr, offset_to_index) if data.coldefexpr is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RangeTableFuncCol(v_colname, v_typeName, v_for_ordinality, v_is_not_null, v_colexpr, v_coldefexpr, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":254 * cdef object v_coldefexpr = create(data.coldefexpr, offset_to_index) if data.coldefexpr is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.RangeTableFuncCol(v_colname, v_typeName, v_for_ordinality, v_is_not_null, v_colexpr, v_coldefexpr, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_RangeTableFuncCol); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_6, __pyx_v_v_colname, __pyx_v_v_typeName, __pyx_v_v_for_ordinality, __pyx_v_v_is_not_null, __pyx_v_v_colexpr, __pyx_v_v_coldefexpr, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":246 * * * cdef create_RangeTableFuncCol(structs.RangeTableFuncCol* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_RangeTableFuncCol", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_colname); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_for_ordinality); __Pyx_XDECREF(__pyx_v_v_is_not_null); __Pyx_XDECREF(__pyx_v_v_colexpr); __Pyx_XDECREF(__pyx_v_v_coldefexpr); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":257 * * * cdef create_RangeTableSample(structs.RangeTableSample* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_RangeTableSample(RangeTableSample *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_method = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_repeatable = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeTableSample", 1); /* "pglast/ast.pyx":258 * * cdef create_RangeTableSample(structs.RangeTableSample* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":259 * cdef create_RangeTableSample(structs.RangeTableSample* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->method, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 259, __pyx_L1_error) __pyx_v_v_method = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":260 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 260, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":261 * cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RangeTableSample(v_relation, v_method, v_args, v_repeatable, v_location) */ __pyx_t_2 = (__pyx_v_data->repeatable != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->repeatable, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_repeatable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":262 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RangeTableSample(v_relation, v_method, v_args, v_repeatable, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":263 * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.RangeTableSample(v_relation, v_method, v_args, v_repeatable, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_RangeTableSample); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_relation, __pyx_v_v_method, __pyx_v_v_args, __pyx_v_v_repeatable, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":257 * * * cdef create_RangeTableSample(structs.RangeTableSample* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_method = _pg_list_to_tuple(data.method, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_RangeTableSample", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_method); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_repeatable); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":266 * * * cdef create_ColumnDef(structs.ColumnDef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ColumnDef(ColumnDef *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_colname = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_compression = 0; PyObject *__pyx_v_v_inhcount = 0; PyObject *__pyx_v_v_is_local = 0; PyObject *__pyx_v_v_is_not_null = 0; PyObject *__pyx_v_v_is_from_type = 0; PyObject *__pyx_v_v_storage = 0; PyObject *__pyx_v_v_storage_name = 0; PyObject *__pyx_v_v_raw_default = 0; PyObject *__pyx_v_v_cooked_default = 0; PyObject *__pyx_v_v_identity = 0; PyObject *__pyx_v_v_identitySequence = 0; PyObject *__pyx_v_v_generated = 0; PyObject *__pyx_v_v_collClause = 0; PyObject *__pyx_v_v_constraints = 0; PyObject *__pyx_v_v_fdwoptions = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ColumnDef", 1); /* "pglast/ast.pyx":267 * * cdef create_ColumnDef(structs.ColumnDef* data, offset_to_index): * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_compression = data.compression.decode("utf-8") if data.compression is not NULL else None */ __pyx_t_2 = (__pyx_v_data->colname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->colname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 267, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_colname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":268 * cdef create_ColumnDef(structs.ColumnDef* data, offset_to_index): * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_compression = data.compression.decode("utf-8") if data.compression is not NULL else None * cdef object v_inhcount = data.inhcount */ __pyx_t_2 = (__pyx_v_data->typeName != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":269 * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_compression = data.compression.decode("utf-8") if data.compression is not NULL else None # <<<<<<<<<<<<<< * cdef object v_inhcount = data.inhcount * cdef object v_is_local = bool(data.is_local) */ __pyx_t_2 = (__pyx_v_data->compression != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->compression; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 269, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_compression = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":270 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_compression = data.compression.decode("utf-8") if data.compression is not NULL else None * cdef object v_inhcount = data.inhcount # <<<<<<<<<<<<<< * cdef object v_is_local = bool(data.is_local) * cdef object v_is_not_null = bool(data.is_not_null) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->inhcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inhcount = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":271 * cdef object v_compression = data.compression.decode("utf-8") if data.compression is not NULL else None * cdef object v_inhcount = data.inhcount * cdef object v_is_local = bool(data.is_local) # <<<<<<<<<<<<<< * cdef object v_is_not_null = bool(data.is_not_null) * cdef object v_is_from_type = bool(data.is_from_type) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_local = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":272 * cdef object v_inhcount = data.inhcount * cdef object v_is_local = bool(data.is_local) * cdef object v_is_not_null = bool(data.is_not_null) # <<<<<<<<<<<<<< * cdef object v_is_from_type = bool(data.is_from_type) * cdef object v_storage = chr(data.storage) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_not_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_not_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":273 * cdef object v_is_local = bool(data.is_local) * cdef object v_is_not_null = bool(data.is_not_null) * cdef object v_is_from_type = bool(data.is_from_type) # <<<<<<<<<<<<<< * cdef object v_storage = chr(data.storage) * cdef object v_storage_name = data.storage_name.decode("utf-8") if data.storage_name is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_from_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_from_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":274 * cdef object v_is_not_null = bool(data.is_not_null) * cdef object v_is_from_type = bool(data.is_from_type) * cdef object v_storage = chr(data.storage) # <<<<<<<<<<<<<< * cdef object v_storage_name = data.storage_name.decode("utf-8") if data.storage_name is not NULL else None * cdef object v_raw_default = create(data.raw_default, offset_to_index) if data.raw_default is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->storage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_storage = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":275 * cdef object v_is_from_type = bool(data.is_from_type) * cdef object v_storage = chr(data.storage) * cdef object v_storage_name = data.storage_name.decode("utf-8") if data.storage_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_raw_default = create(data.raw_default, offset_to_index) if data.raw_default is not NULL else None * cdef object v_cooked_default = create(data.cooked_default, offset_to_index) if data.cooked_default is not NULL else None */ __pyx_t_2 = (__pyx_v_data->storage_name != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->storage_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_v_v_storage_name = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":276 * cdef object v_storage = chr(data.storage) * cdef object v_storage_name = data.storage_name.decode("utf-8") if data.storage_name is not NULL else None * cdef object v_raw_default = create(data.raw_default, offset_to_index) if data.raw_default is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cooked_default = create(data.cooked_default, offset_to_index) if data.cooked_default is not NULL else None * cdef object v_identity = chr(data.identity) */ __pyx_t_2 = (__pyx_v_data->raw_default != NULL); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->raw_default, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_v_v_raw_default = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":277 * cdef object v_storage_name = data.storage_name.decode("utf-8") if data.storage_name is not NULL else None * cdef object v_raw_default = create(data.raw_default, offset_to_index) if data.raw_default is not NULL else None * cdef object v_cooked_default = create(data.cooked_default, offset_to_index) if data.cooked_default is not NULL else None # <<<<<<<<<<<<<< * cdef object v_identity = chr(data.identity) * cdef object v_identitySequence = create(data.identitySequence, offset_to_index) if data.identitySequence is not NULL else None */ __pyx_t_2 = (__pyx_v_data->cooked_default != NULL); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->cooked_default, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_v_v_cooked_default = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":278 * cdef object v_raw_default = create(data.raw_default, offset_to_index) if data.raw_default is not NULL else None * cdef object v_cooked_default = create(data.cooked_default, offset_to_index) if data.cooked_default is not NULL else None * cdef object v_identity = chr(data.identity) # <<<<<<<<<<<<<< * cdef object v_identitySequence = create(data.identitySequence, offset_to_index) if data.identitySequence is not NULL else None * cdef object v_generated = chr(data.generated) */ __pyx_t_5 = __Pyx_PyInt_From_char(__pyx_v_data->identity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_v_identity = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":279 * cdef object v_cooked_default = create(data.cooked_default, offset_to_index) if data.cooked_default is not NULL else None * cdef object v_identity = chr(data.identity) * cdef object v_identitySequence = create(data.identitySequence, offset_to_index) if data.identitySequence is not NULL else None # <<<<<<<<<<<<<< * cdef object v_generated = chr(data.generated) * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->identitySequence != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->identitySequence, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_identitySequence = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":280 * cdef object v_identity = chr(data.identity) * cdef object v_identitySequence = create(data.identitySequence, offset_to_index) if data.identitySequence is not NULL else None * cdef object v_generated = chr(data.generated) # <<<<<<<<<<<<<< * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->generated); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_generated = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":281 * cdef object v_identitySequence = create(data.identitySequence, offset_to_index) if data.identitySequence is not NULL else None * cdef object v_generated = chr(data.generated) * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef tuple v_fdwoptions = _pg_list_to_tuple(data.fdwoptions, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->collClause != NULL); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->collClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_v_v_collClause = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":282 * cdef object v_generated = chr(data.generated) * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_fdwoptions = _pg_list_to_tuple(data.fdwoptions, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_5 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->constraints, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(0, 282, __pyx_L1_error) __pyx_v_v_constraints = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "pglast/ast.pyx":283 * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef tuple v_fdwoptions = _pg_list_to_tuple(data.fdwoptions, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ColumnDef(v_colname, v_typeName, v_compression, v_inhcount, v_is_local, v_is_not_null, v_is_from_type, v_storage, v_storage_name, v_raw_default, v_cooked_default, v_identity, v_identitySequence, v_generated, v_collClause, v_constraints, v_fdwoptions, v_location) */ __pyx_t_5 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fdwoptions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(0, 283, __pyx_L1_error) __pyx_v_v_fdwoptions = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "pglast/ast.pyx":284 * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef tuple v_fdwoptions = _pg_list_to_tuple(data.fdwoptions, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ColumnDef(v_colname, v_typeName, v_compression, v_inhcount, v_is_local, v_is_not_null, v_is_from_type, v_storage, v_storage_name, v_raw_default, v_cooked_default, v_identity, v_identitySequence, v_generated, v_collClause, v_constraints, v_fdwoptions, v_location) * */ __pyx_t_1 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_8 = __pyx_v_offset_to_index; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_v_location = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":285 * cdef tuple v_fdwoptions = _pg_list_to_tuple(data.fdwoptions, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.ColumnDef(v_colname, v_typeName, v_compression, v_inhcount, v_is_local, v_is_not_null, v_is_from_type, v_storage, v_storage_name, v_raw_default, v_cooked_default, v_identity, v_identitySequence, v_generated, v_collClause, v_constraints, v_fdwoptions, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ast); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ColumnDef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[19] = {__pyx_t_8, __pyx_v_v_colname, __pyx_v_v_typeName, __pyx_v_v_compression, __pyx_v_v_inhcount, __pyx_v_v_is_local, __pyx_v_v_is_not_null, __pyx_v_v_is_from_type, __pyx_v_v_storage, __pyx_v_v_storage_name, __pyx_v_v_raw_default, __pyx_v_v_cooked_default, __pyx_v_v_identity, __pyx_v_v_identitySequence, __pyx_v_v_generated, __pyx_v_v_collClause, __pyx_v_v_constraints, __pyx_v_v_fdwoptions, __pyx_v_v_location}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 18+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pglast/ast.pyx":266 * * * cdef create_ColumnDef(structs.ColumnDef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_colname = data.colname.decode("utf-8") if data.colname is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pglast.parser.create_ColumnDef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_colname); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_compression); __Pyx_XDECREF(__pyx_v_v_inhcount); __Pyx_XDECREF(__pyx_v_v_is_local); __Pyx_XDECREF(__pyx_v_v_is_not_null); __Pyx_XDECREF(__pyx_v_v_is_from_type); __Pyx_XDECREF(__pyx_v_v_storage); __Pyx_XDECREF(__pyx_v_v_storage_name); __Pyx_XDECREF(__pyx_v_v_raw_default); __Pyx_XDECREF(__pyx_v_v_cooked_default); __Pyx_XDECREF(__pyx_v_v_identity); __Pyx_XDECREF(__pyx_v_v_identitySequence); __Pyx_XDECREF(__pyx_v_v_generated); __Pyx_XDECREF(__pyx_v_v_collClause); __Pyx_XDECREF(__pyx_v_v_constraints); __Pyx_XDECREF(__pyx_v_v_fdwoptions); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":288 * * * cdef create_TableLikeClause(structs.TableLikeClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_options = data.options */ static PyObject *__pyx_f_6pglast_6parser_create_TableLikeClause(TableLikeClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TableLikeClause", 1); /* "pglast/ast.pyx":289 * * cdef create_TableLikeClause(structs.TableLikeClause* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_options = data.options * return ast.TableLikeClause(v_relation, v_options) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":290 * cdef create_TableLikeClause(structs.TableLikeClause* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_options = data.options # <<<<<<<<<<<<<< * return ast.TableLikeClause(v_relation, v_options) * */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_options = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":291 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_options = data.options * return ast.TableLikeClause(v_relation, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TableLikeClause); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":288 * * * cdef create_TableLikeClause(structs.TableLikeClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_options = data.options */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_TableLikeClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":294 * * * cdef create_IndexElem(structs.IndexElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_IndexElem(IndexElem *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_indexcolname = 0; PyObject *__pyx_v_v_collation = 0; PyObject *__pyx_v_v_opclass = 0; PyObject *__pyx_v_v_opclassopts = 0; PyObject *__pyx_v_v_ordering = 0; PyObject *__pyx_v_v_nulls_ordering = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_IndexElem", 1); /* "pglast/ast.pyx":295 * * cdef create_IndexElem(structs.IndexElem* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_indexcolname = data.indexcolname.decode("utf-8") if data.indexcolname is not NULL else None */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 295, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":296 * cdef create_IndexElem(structs.IndexElem* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_indexcolname = data.indexcolname.decode("utf-8") if data.indexcolname is not NULL else None * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":297 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_indexcolname = data.indexcolname.decode("utf-8") if data.indexcolname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->indexcolname != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->indexcolname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 297, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_indexcolname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":298 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_indexcolname = data.indexcolname.decode("utf-8") if data.indexcolname is not NULL else None * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) * cdef tuple v_opclassopts = _pg_list_to_tuple(data.opclassopts, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->collation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_v_collation = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":299 * cdef object v_indexcolname = data.indexcolname.decode("utf-8") if data.indexcolname is not NULL else None * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_opclassopts = _pg_list_to_tuple(data.opclassopts, offset_to_index) * cdef object v_ordering = getattr(enums, 'SortByDir')(data.ordering) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opclass, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 299, __pyx_L1_error) __pyx_v_v_opclass = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":300 * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) * cdef tuple v_opclassopts = _pg_list_to_tuple(data.opclassopts, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_ordering = getattr(enums, 'SortByDir')(data.ordering) * cdef object v_nulls_ordering = getattr(enums, 'SortByNulls')(data.nulls_ordering) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opclassopts, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_v_v_opclassopts = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":301 * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) * cdef tuple v_opclassopts = _pg_list_to_tuple(data.opclassopts, offset_to_index) * cdef object v_ordering = getattr(enums, 'SortByDir')(data.ordering) # <<<<<<<<<<<<<< * cdef object v_nulls_ordering = getattr(enums, 'SortByNulls')(data.nulls_ordering) * return ast.IndexElem(v_name, v_expr, v_indexcolname, v_collation, v_opclass, v_opclassopts, v_ordering, v_nulls_ordering) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_SortByDir); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_SortByDir(__pyx_v_data->ordering); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_v_ordering = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":302 * cdef tuple v_opclassopts = _pg_list_to_tuple(data.opclassopts, offset_to_index) * cdef object v_ordering = getattr(enums, 'SortByDir')(data.ordering) * cdef object v_nulls_ordering = getattr(enums, 'SortByNulls')(data.nulls_ordering) # <<<<<<<<<<<<<< * return ast.IndexElem(v_name, v_expr, v_indexcolname, v_collation, v_opclass, v_opclassopts, v_ordering, v_nulls_ordering) * */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_enums); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_GetAttr(__pyx_t_7, __pyx_n_u_SortByNulls); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_SortByNulls(__pyx_v_data->nulls_ordering); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_v_nulls_ordering = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":303 * cdef object v_ordering = getattr(enums, 'SortByDir')(data.ordering) * cdef object v_nulls_ordering = getattr(enums, 'SortByNulls')(data.nulls_ordering) * return ast.IndexElem(v_name, v_expr, v_indexcolname, v_collation, v_opclass, v_opclassopts, v_ordering, v_nulls_ordering) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_IndexElem); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_5, __pyx_v_v_name, __pyx_v_v_expr, __pyx_v_v_indexcolname, __pyx_v_v_collation, __pyx_v_v_opclass, __pyx_v_v_opclassopts, __pyx_v_v_ordering, __pyx_v_v_nulls_ordering}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 8+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":294 * * * cdef create_IndexElem(structs.IndexElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.create_IndexElem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_indexcolname); __Pyx_XDECREF(__pyx_v_v_collation); __Pyx_XDECREF(__pyx_v_v_opclass); __Pyx_XDECREF(__pyx_v_v_opclassopts); __Pyx_XDECREF(__pyx_v_v_ordering); __Pyx_XDECREF(__pyx_v_v_nulls_ordering); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":306 * * * cdef create_DefElem(structs.DefElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_defnamespace = data.defnamespace.decode("utf-8") if data.defnamespace is not NULL else None * cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_DefElem(DefElem *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_defnamespace = 0; PyObject *__pyx_v_v_defname = 0; PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_defaction = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DefElem", 1); /* "pglast/ast.pyx":307 * * cdef create_DefElem(structs.DefElem* data, offset_to_index): * cdef object v_defnamespace = data.defnamespace.decode("utf-8") if data.defnamespace is not NULL else None # <<<<<<<<<<<<<< * cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ __pyx_t_2 = (__pyx_v_data->defnamespace != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->defnamespace; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_defnamespace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":308 * cdef create_DefElem(structs.DefElem* data, offset_to_index): * cdef object v_defnamespace = data.defnamespace.decode("utf-8") if data.defnamespace is not NULL else None * cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_defaction = getattr(enums, 'DefElemAction')(data.defaction) */ __pyx_t_2 = (__pyx_v_data->defname != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->defname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 308, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_defname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":309 * cdef object v_defnamespace = data.defnamespace.decode("utf-8") if data.defnamespace is not NULL else None * cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_defaction = getattr(enums, 'DefElemAction')(data.defaction) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":310 * cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_defaction = getattr(enums, 'DefElemAction')(data.defaction) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.DefElem(v_defnamespace, v_defname, v_arg, v_defaction, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_DefElemAction); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_DefElemAction(__pyx_v_data->defaction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_v_defaction = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":311 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_defaction = getattr(enums, 'DefElemAction')(data.defaction) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.DefElem(v_defnamespace, v_defname, v_arg, v_defaction, v_location) * */ __pyx_t_7 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_5 = __pyx_v_offset_to_index; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":312 * cdef object v_defaction = getattr(enums, 'DefElemAction')(data.defaction) * cdef object v_location = offset_to_index(data.location) * return ast.DefElem(v_defnamespace, v_defname, v_arg, v_defaction, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DefElem); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_v_v_defnamespace, __pyx_v_v_defname, __pyx_v_v_arg, __pyx_v_v_defaction, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 5+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":306 * * * cdef create_DefElem(structs.DefElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_defnamespace = data.defnamespace.decode("utf-8") if data.defnamespace is not NULL else None * cdef object v_defname = data.defname.decode("utf-8") if data.defname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.create_DefElem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_defnamespace); __Pyx_XDECREF(__pyx_v_v_defname); __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_defaction); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":315 * * * cdef create_LockingClause(structs.LockingClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_lockedRels = _pg_list_to_tuple(data.lockedRels, offset_to_index) * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) */ static PyObject *__pyx_f_6pglast_6parser_create_LockingClause(LockingClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_lockedRels = 0; PyObject *__pyx_v_v_strength = 0; PyObject *__pyx_v_v_waitPolicy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_LockingClause", 1); /* "pglast/ast.pyx":316 * * cdef create_LockingClause(structs.LockingClause* data, offset_to_index): * cdef tuple v_lockedRels = _pg_list_to_tuple(data.lockedRels, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->lockedRels, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 316, __pyx_L1_error) __pyx_v_v_lockedRels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":317 * cdef create_LockingClause(structs.LockingClause* data, offset_to_index): * cdef tuple v_lockedRels = _pg_list_to_tuple(data.lockedRels, offset_to_index) * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) # <<<<<<<<<<<<<< * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) * return ast.LockingClause(v_lockedRels, v_strength, v_waitPolicy) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_LockClauseStrength); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_LockClauseStrength(__pyx_v_data->strength); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_strength = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":318 * cdef tuple v_lockedRels = _pg_list_to_tuple(data.lockedRels, offset_to_index) * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) # <<<<<<<<<<<<<< * return ast.LockingClause(v_lockedRels, v_strength, v_waitPolicy) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_LockWaitPolicy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_LockWaitPolicy(__pyx_v_data->waitPolicy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_waitPolicy = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":319 * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) * return ast.LockingClause(v_lockedRels, v_strength, v_waitPolicy) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LockingClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_lockedRels, __pyx_v_v_strength, __pyx_v_v_waitPolicy}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":315 * * * cdef create_LockingClause(structs.LockingClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_lockedRels = _pg_list_to_tuple(data.lockedRels, offset_to_index) * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_LockingClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_lockedRels); __Pyx_XDECREF(__pyx_v_v_strength); __Pyx_XDECREF(__pyx_v_v_waitPolicy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":322 * * * cdef create_XmlSerialize(structs.XmlSerialize* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_XmlSerialize(XmlSerialize *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_xmloption = 0; PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_indent = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_XmlSerialize", 1); /* "pglast/ast.pyx":323 * * cdef create_XmlSerialize(structs.XmlSerialize* data, offset_to_index): * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_XmlOptionType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_XmlOptionType(__pyx_v_data->xmloption); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_xmloption = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":324 * cdef create_XmlSerialize(structs.XmlSerialize* data, offset_to_index): * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_indent = bool(data.indent) */ __pyx_t_6 = (__pyx_v_data->expr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":325 * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_indent = bool(data.indent) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->typeName != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":326 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_indent = bool(data.indent) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.XmlSerialize(v_xmloption, v_expr, v_typeName, v_indent, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->indent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_indent = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":327 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_indent = bool(data.indent) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.XmlSerialize(v_xmloption, v_expr, v_typeName, v_indent, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":328 * cdef object v_indent = bool(data.indent) * cdef object v_location = offset_to_index(data.location) * return ast.XmlSerialize(v_xmloption, v_expr, v_typeName, v_indent, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_XmlSerialize); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_v_xmloption, __pyx_v_v_expr, __pyx_v_v_typeName, __pyx_v_v_indent, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":322 * * * cdef create_XmlSerialize(structs.XmlSerialize* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_XmlSerialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_xmloption); __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_indent); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":331 * * * cdef create_PartitionElem(structs.PartitionElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_PartitionElem(PartitionElem *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_collation = 0; PyObject *__pyx_v_v_opclass = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PartitionElem", 1); /* "pglast/ast.pyx":332 * * cdef create_PartitionElem(structs.PartitionElem* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 332, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":333 * cdef create_PartitionElem(structs.PartitionElem* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":334 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->collation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 334, __pyx_L1_error) __pyx_v_v_collation = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":335 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.PartitionElem(v_name, v_expr, v_collation, v_opclass, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opclass, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 335, __pyx_L1_error) __pyx_v_v_opclass = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":336 * cdef tuple v_collation = _pg_list_to_tuple(data.collation, offset_to_index) * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.PartitionElem(v_name, v_expr, v_collation, v_opclass, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":337 * cdef tuple v_opclass = _pg_list_to_tuple(data.opclass, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.PartitionElem(v_name, v_expr, v_collation, v_opclass, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_PartitionElem); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_6, __pyx_v_v_name, __pyx_v_v_expr, __pyx_v_v_collation, __pyx_v_v_opclass, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":331 * * * cdef create_PartitionElem(structs.PartitionElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_PartitionElem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_collation); __Pyx_XDECREF(__pyx_v_v_opclass); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":340 * * * cdef create_PartitionSpec(structs.PartitionSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_strategy = getattr(enums, 'PartitionStrategy')(chr(data.strategy)) * cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_PartitionSpec(PartitionSpec *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_strategy = 0; PyObject *__pyx_v_v_partParams = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PartitionSpec", 1); /* "pglast/ast.pyx":341 * * cdef create_PartitionSpec(structs.PartitionSpec* data, offset_to_index): * cdef object v_strategy = getattr(enums, 'PartitionStrategy')(chr(data.strategy)) # <<<<<<<<<<<<<< * cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_PartitionStrategy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PartitionStrategy(__pyx_v_data->strategy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_strategy = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":342 * cdef create_PartitionSpec(structs.PartitionSpec* data, offset_to_index): * cdef object v_strategy = getattr(enums, 'PartitionStrategy')(chr(data.strategy)) * cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.PartitionSpec(v_strategy, v_partParams, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->partParams, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 342, __pyx_L1_error) __pyx_v_v_partParams = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":343 * cdef object v_strategy = getattr(enums, 'PartitionStrategy')(chr(data.strategy)) * cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.PartitionSpec(v_strategy, v_partParams, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":344 * cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.PartitionSpec(v_strategy, v_partParams, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PartitionSpec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_strategy, __pyx_v_v_partParams, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":340 * * * cdef create_PartitionSpec(structs.PartitionSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_strategy = getattr(enums, 'PartitionStrategy')(chr(data.strategy)) * cdef tuple v_partParams = _pg_list_to_tuple(data.partParams, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_PartitionSpec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_strategy); __Pyx_XDECREF(__pyx_v_v_partParams); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":347 * * * cdef create_PartitionBoundSpec(structs.PartitionBoundSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_strategy = chr(data.strategy) * cdef object v_is_default = bool(data.is_default) */ static PyObject *__pyx_f_6pglast_6parser_create_PartitionBoundSpec(PartitionBoundSpec *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_strategy = 0; PyObject *__pyx_v_v_is_default = 0; PyObject *__pyx_v_v_modulus = 0; PyObject *__pyx_v_v_remainder = 0; PyObject *__pyx_v_v_listdatums = 0; PyObject *__pyx_v_v_lowerdatums = 0; PyObject *__pyx_v_v_upperdatums = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PartitionBoundSpec", 1); /* "pglast/ast.pyx":348 * * cdef create_PartitionBoundSpec(structs.PartitionBoundSpec* data, offset_to_index): * cdef object v_strategy = chr(data.strategy) # <<<<<<<<<<<<<< * cdef object v_is_default = bool(data.is_default) * cdef object v_modulus = data.modulus */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->strategy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_strategy = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":349 * cdef create_PartitionBoundSpec(structs.PartitionBoundSpec* data, offset_to_index): * cdef object v_strategy = chr(data.strategy) * cdef object v_is_default = bool(data.is_default) # <<<<<<<<<<<<<< * cdef object v_modulus = data.modulus * cdef object v_remainder = data.remainder */ __pyx_t_2 = __Pyx_PyInt_From_bool(__pyx_v_data->is_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_v_is_default = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":350 * cdef object v_strategy = chr(data.strategy) * cdef object v_is_default = bool(data.is_default) * cdef object v_modulus = data.modulus # <<<<<<<<<<<<<< * cdef object v_remainder = data.remainder * cdef tuple v_listdatums = _pg_list_to_tuple(data.listdatums, offset_to_index) */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->modulus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_v_modulus = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":351 * cdef object v_is_default = bool(data.is_default) * cdef object v_modulus = data.modulus * cdef object v_remainder = data.remainder # <<<<<<<<<<<<<< * cdef tuple v_listdatums = _pg_list_to_tuple(data.listdatums, offset_to_index) * cdef tuple v_lowerdatums = _pg_list_to_tuple(data.lowerdatums, offset_to_index) */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_data->remainder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_v_remainder = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":352 * cdef object v_modulus = data.modulus * cdef object v_remainder = data.remainder * cdef tuple v_listdatums = _pg_list_to_tuple(data.listdatums, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_lowerdatums = _pg_list_to_tuple(data.lowerdatums, offset_to_index) * cdef tuple v_upperdatums = _pg_list_to_tuple(data.upperdatums, offset_to_index) */ __pyx_t_2 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->listdatums, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(0, 352, __pyx_L1_error) __pyx_v_v_listdatums = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":353 * cdef object v_remainder = data.remainder * cdef tuple v_listdatums = _pg_list_to_tuple(data.listdatums, offset_to_index) * cdef tuple v_lowerdatums = _pg_list_to_tuple(data.lowerdatums, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_upperdatums = _pg_list_to_tuple(data.upperdatums, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->lowerdatums, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(0, 353, __pyx_L1_error) __pyx_v_v_lowerdatums = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":354 * cdef tuple v_listdatums = _pg_list_to_tuple(data.listdatums, offset_to_index) * cdef tuple v_lowerdatums = _pg_list_to_tuple(data.lowerdatums, offset_to_index) * cdef tuple v_upperdatums = _pg_list_to_tuple(data.upperdatums, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.PartitionBoundSpec(v_strategy, v_is_default, v_modulus, v_remainder, v_listdatums, v_lowerdatums, v_upperdatums, v_location) */ __pyx_t_2 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->upperdatums, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_v_v_upperdatums = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":355 * cdef tuple v_lowerdatums = _pg_list_to_tuple(data.lowerdatums, offset_to_index) * cdef tuple v_upperdatums = _pg_list_to_tuple(data.upperdatums, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.PartitionBoundSpec(v_strategy, v_is_default, v_modulus, v_remainder, v_listdatums, v_lowerdatums, v_upperdatums, v_location) * */ __pyx_t_1 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":356 * cdef tuple v_upperdatums = _pg_list_to_tuple(data.upperdatums, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.PartitionBoundSpec(v_strategy, v_is_default, v_modulus, v_remainder, v_listdatums, v_lowerdatums, v_upperdatums, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PartitionBoundSpec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_4, __pyx_v_v_strategy, __pyx_v_v_is_default, __pyx_v_v_modulus, __pyx_v_v_remainder, __pyx_v_v_listdatums, __pyx_v_v_lowerdatums, __pyx_v_v_upperdatums, __pyx_v_v_location}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":347 * * * cdef create_PartitionBoundSpec(structs.PartitionBoundSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_strategy = chr(data.strategy) * cdef object v_is_default = bool(data.is_default) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_PartitionBoundSpec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_strategy); __Pyx_XDECREF(__pyx_v_v_is_default); __Pyx_XDECREF(__pyx_v_v_modulus); __Pyx_XDECREF(__pyx_v_v_remainder); __Pyx_XDECREF(__pyx_v_v_listdatums); __Pyx_XDECREF(__pyx_v_v_lowerdatums); __Pyx_XDECREF(__pyx_v_v_upperdatums); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":359 * * * cdef create_PartitionRangeDatum(structs.PartitionRangeDatum* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'PartitionRangeDatumKind')(data.kind) * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_PartitionRangeDatum(PartitionRangeDatum *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_value = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PartitionRangeDatum", 1); /* "pglast/ast.pyx":360 * * cdef create_PartitionRangeDatum(structs.PartitionRangeDatum* data, offset_to_index): * cdef object v_kind = getattr(enums, 'PartitionRangeDatumKind')(data.kind) # <<<<<<<<<<<<<< * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_PartitionRangeDatumKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PartitionRangeDatumKind(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":361 * cdef create_PartitionRangeDatum(structs.PartitionRangeDatum* data, offset_to_index): * cdef object v_kind = getattr(enums, 'PartitionRangeDatumKind')(data.kind) * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.PartitionRangeDatum(v_kind, v_value, v_location) */ __pyx_t_6 = (__pyx_v_data->value != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->value, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_value = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":362 * cdef object v_kind = getattr(enums, 'PartitionRangeDatumKind')(data.kind) * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.PartitionRangeDatum(v_kind, v_value, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":363 * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.PartitionRangeDatum(v_kind, v_value, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PartitionRangeDatum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_kind, __pyx_v_v_value, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":359 * * * cdef create_PartitionRangeDatum(structs.PartitionRangeDatum* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'PartitionRangeDatumKind')(data.kind) * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_PartitionRangeDatum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_value); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":366 * * * cdef create_SinglePartitionSpec(structs.SinglePartitionSpec* data, offset_to_index): # <<<<<<<<<<<<<< * return ast.SinglePartitionSpec() * */ static PyObject *__pyx_f_6pglast_6parser_create_SinglePartitionSpec(CYTHON_UNUSED SinglePartitionSpec *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SinglePartitionSpec", 1); /* "pglast/ast.pyx":367 * * cdef create_SinglePartitionSpec(structs.SinglePartitionSpec* data, offset_to_index): * return ast.SinglePartitionSpec() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SinglePartitionSpec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":366 * * * cdef create_SinglePartitionSpec(structs.SinglePartitionSpec* data, offset_to_index): # <<<<<<<<<<<<<< * return ast.SinglePartitionSpec() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_SinglePartitionSpec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":370 * * * cdef create_PartitionCmd(structs.PartitionCmd* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_PartitionCmd(PartitionCmd *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_bound = 0; PyObject *__pyx_v_v_concurrent = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PartitionCmd", 1); /* "pglast/ast.pyx":371 * * cdef create_PartitionCmd(structs.PartitionCmd* data, offset_to_index): * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None * cdef object v_concurrent = bool(data.concurrent) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":372 * cdef create_PartitionCmd(structs.PartitionCmd* data, offset_to_index): * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None # <<<<<<<<<<<<<< * cdef object v_concurrent = bool(data.concurrent) * return ast.PartitionCmd(v_name, v_bound, v_concurrent) */ __pyx_t_2 = (__pyx_v_data->bound != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->bound, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_bound = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":373 * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None * cdef object v_concurrent = bool(data.concurrent) # <<<<<<<<<<<<<< * return ast.PartitionCmd(v_name, v_bound, v_concurrent) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->concurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_concurrent = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":374 * cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None * cdef object v_concurrent = bool(data.concurrent) * return ast.PartitionCmd(v_name, v_bound, v_concurrent) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PartitionCmd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_name, __pyx_v_v_bound, __pyx_v_v_concurrent}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":370 * * * cdef create_PartitionCmd(structs.PartitionCmd* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_bound = create(data.bound, offset_to_index) if data.bound is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_PartitionCmd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_bound); __Pyx_XDECREF(__pyx_v_v_concurrent); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":377 * * * cdef create_RangeTblEntry(structs.RangeTblEntry* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RangeTblEntry(RangeTblEntry *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_v_v_eref = 0; PyObject *__pyx_v_v_rtekind = 0; PyObject *__pyx_v_v_inh = 0; PyObject *__pyx_v_v_relkind = 0; PyObject *__pyx_v_v_rellockmode = 0; PyObject *__pyx_v_v_perminfoindex = 0; PyObject *__pyx_v_v_tablesample = 0; PyObject *__pyx_v_v_subquery = 0; PyObject *__pyx_v_v_security_barrier = 0; PyObject *__pyx_v_v_jointype = 0; PyObject *__pyx_v_v_joinmergedcols = 0; PyObject *__pyx_v_v_joinaliasvars = 0; PyObject *__pyx_v_v_joinleftcols = 0; PyObject *__pyx_v_v_joinrightcols = 0; PyObject *__pyx_v_v_join_using_alias = 0; PyObject *__pyx_v_v_functions = 0; PyObject *__pyx_v_v_funcordinality = 0; PyObject *__pyx_v_v_tablefunc = 0; PyObject *__pyx_v_v_values_lists = 0; PyObject *__pyx_v_v_ctename = 0; PyObject *__pyx_v_v_ctelevelsup = 0; PyObject *__pyx_v_v_self_reference = 0; PyObject *__pyx_v_v_coltypes = 0; PyObject *__pyx_v_v_coltypmods = 0; PyObject *__pyx_v_v_colcollations = 0; PyObject *__pyx_v_v_enrname = 0; PyObject *__pyx_v_v_enrtuples = 0; PyObject *__pyx_v_v_lateral = 0; PyObject *__pyx_v_v_inFromCl = 0; PyObject *__pyx_v_v_securityQuals = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeTblEntry", 1); /* "pglast/ast.pyx":378 * * cdef create_RangeTblEntry(structs.RangeTblEntry* data, offset_to_index): * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None * cdef object v_rtekind = getattr(enums, 'RTEKind')(data.rtekind) */ __pyx_t_2 = (__pyx_v_data->alias != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":379 * cdef create_RangeTblEntry(structs.RangeTblEntry* data, offset_to_index): * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rtekind = getattr(enums, 'RTEKind')(data.rtekind) * cdef object v_inh = bool(data.inh) */ __pyx_t_2 = (__pyx_v_data->eref != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->eref, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_eref = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":380 * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None * cdef object v_rtekind = getattr(enums, 'RTEKind')(data.rtekind) # <<<<<<<<<<<<<< * cdef object v_inh = bool(data.inh) * cdef object v_relkind = chr(data.relkind) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_RTEKind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_RTEKind(__pyx_v_data->rtekind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_rtekind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":381 * cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None * cdef object v_rtekind = getattr(enums, 'RTEKind')(data.rtekind) * cdef object v_inh = bool(data.inh) # <<<<<<<<<<<<<< * cdef object v_relkind = chr(data.relkind) * cdef object v_rellockmode = data.rellockmode */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->inh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inh = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":382 * cdef object v_rtekind = getattr(enums, 'RTEKind')(data.rtekind) * cdef object v_inh = bool(data.inh) * cdef object v_relkind = chr(data.relkind) # <<<<<<<<<<<<<< * cdef object v_rellockmode = data.rellockmode * cdef object v_perminfoindex = data.perminfoindex */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->relkind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_relkind = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":383 * cdef object v_inh = bool(data.inh) * cdef object v_relkind = chr(data.relkind) * cdef object v_rellockmode = data.rellockmode # <<<<<<<<<<<<<< * cdef object v_perminfoindex = data.perminfoindex * cdef object v_tablesample = create(data.tablesample, offset_to_index) if data.tablesample is not NULL else None */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_data->rellockmode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_rellockmode = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":384 * cdef object v_relkind = chr(data.relkind) * cdef object v_rellockmode = data.rellockmode * cdef object v_perminfoindex = data.perminfoindex # <<<<<<<<<<<<<< * cdef object v_tablesample = create(data.tablesample, offset_to_index) if data.tablesample is not NULL else None * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None */ __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->perminfoindex); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_perminfoindex = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":385 * cdef object v_rellockmode = data.rellockmode * cdef object v_perminfoindex = data.perminfoindex * cdef object v_tablesample = create(data.tablesample, offset_to_index) if data.tablesample is not NULL else None # <<<<<<<<<<<<<< * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None * cdef object v_security_barrier = bool(data.security_barrier) */ __pyx_t_2 = (__pyx_v_data->tablesample != NULL); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->tablesample, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } __pyx_v_v_tablesample = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":386 * cdef object v_perminfoindex = data.perminfoindex * cdef object v_tablesample = create(data.tablesample, offset_to_index) if data.tablesample is not NULL else None * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None # <<<<<<<<<<<<<< * cdef object v_security_barrier = bool(data.security_barrier) * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) */ __pyx_t_2 = (__pyx_v_data->subquery != NULL); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->subquery, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } __pyx_v_v_subquery = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":387 * cdef object v_tablesample = create(data.tablesample, offset_to_index) if data.tablesample is not NULL else None * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None * cdef object v_security_barrier = bool(data.security_barrier) # <<<<<<<<<<<<<< * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_joinmergedcols = data.joinmergedcols */ __pyx_t_4 = __Pyx_PyInt_From_bool(__pyx_v_data->security_barrier); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_security_barrier = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":388 * cdef object v_subquery = create(data.subquery, offset_to_index) if data.subquery is not NULL else None * cdef object v_security_barrier = bool(data.security_barrier) * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) # <<<<<<<<<<<<<< * cdef object v_joinmergedcols = data.joinmergedcols * cdef tuple v_joinaliasvars = _pg_list_to_tuple(data.joinaliasvars, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_enums); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_1, __pyx_n_u_JoinType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_JoinType(__pyx_v_data->jointype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_jointype = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":389 * cdef object v_security_barrier = bool(data.security_barrier) * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_joinmergedcols = data.joinmergedcols # <<<<<<<<<<<<<< * cdef tuple v_joinaliasvars = _pg_list_to_tuple(data.joinaliasvars, offset_to_index) * cdef tuple v_joinleftcols = _pg_list_to_tuple(data.joinleftcols, offset_to_index) */ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_data->joinmergedcols); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_joinmergedcols = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":390 * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_joinmergedcols = data.joinmergedcols * cdef tuple v_joinaliasvars = _pg_list_to_tuple(data.joinaliasvars, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_joinleftcols = _pg_list_to_tuple(data.joinleftcols, offset_to_index) * cdef tuple v_joinrightcols = _pg_list_to_tuple(data.joinrightcols, offset_to_index) */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->joinaliasvars, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 390, __pyx_L1_error) __pyx_v_v_joinaliasvars = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":391 * cdef object v_joinmergedcols = data.joinmergedcols * cdef tuple v_joinaliasvars = _pg_list_to_tuple(data.joinaliasvars, offset_to_index) * cdef tuple v_joinleftcols = _pg_list_to_tuple(data.joinleftcols, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_joinrightcols = _pg_list_to_tuple(data.joinrightcols, offset_to_index) * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->joinleftcols, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 391, __pyx_L1_error) __pyx_v_v_joinleftcols = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":392 * cdef tuple v_joinaliasvars = _pg_list_to_tuple(data.joinaliasvars, offset_to_index) * cdef tuple v_joinleftcols = _pg_list_to_tuple(data.joinleftcols, offset_to_index) * cdef tuple v_joinrightcols = _pg_list_to_tuple(data.joinrightcols, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->joinrightcols, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 392, __pyx_L1_error) __pyx_v_v_joinrightcols = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":393 * cdef tuple v_joinleftcols = _pg_list_to_tuple(data.joinleftcols, offset_to_index) * cdef tuple v_joinrightcols = _pg_list_to_tuple(data.joinrightcols, offset_to_index) * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) * cdef object v_funcordinality = bool(data.funcordinality) */ __pyx_t_2 = (__pyx_v_data->join_using_alias != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->join_using_alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } __pyx_v_v_join_using_alias = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":394 * cdef tuple v_joinrightcols = _pg_list_to_tuple(data.joinrightcols, offset_to_index) * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_funcordinality = bool(data.funcordinality) * cdef object v_tablefunc = create(data.tablefunc, offset_to_index) if data.tablefunc is not NULL else None */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->functions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 394, __pyx_L1_error) __pyx_v_v_functions = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":395 * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) * cdef object v_funcordinality = bool(data.funcordinality) # <<<<<<<<<<<<<< * cdef object v_tablefunc = create(data.tablefunc, offset_to_index) if data.tablefunc is not NULL else None * cdef tuple v_values_lists = _pg_list_to_tuple(data.values_lists, offset_to_index) */ __pyx_t_4 = __Pyx_PyInt_From_bool(__pyx_v_data->funcordinality); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_funcordinality = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":396 * cdef tuple v_functions = _pg_list_to_tuple(data.functions, offset_to_index) * cdef object v_funcordinality = bool(data.funcordinality) * cdef object v_tablefunc = create(data.tablefunc, offset_to_index) if data.tablefunc is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_values_lists = _pg_list_to_tuple(data.values_lists, offset_to_index) * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None */ __pyx_t_2 = (__pyx_v_data->tablefunc != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->tablefunc, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } __pyx_v_v_tablefunc = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":397 * cdef object v_funcordinality = bool(data.funcordinality) * cdef object v_tablefunc = create(data.tablefunc, offset_to_index) if data.tablefunc is not NULL else None * cdef tuple v_values_lists = _pg_list_to_tuple(data.values_lists, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef object v_ctelevelsup = data.ctelevelsup */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->values_lists, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 397, __pyx_L1_error) __pyx_v_v_values_lists = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":398 * cdef object v_tablefunc = create(data.tablefunc, offset_to_index) if data.tablefunc is not NULL else None * cdef tuple v_values_lists = _pg_list_to_tuple(data.values_lists, offset_to_index) * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_ctelevelsup = data.ctelevelsup * cdef object v_self_reference = bool(data.self_reference) */ __pyx_t_2 = (__pyx_v_data->ctename != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->ctename; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 398, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } __pyx_v_v_ctename = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":399 * cdef tuple v_values_lists = _pg_list_to_tuple(data.values_lists, offset_to_index) * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef object v_ctelevelsup = data.ctelevelsup # <<<<<<<<<<<<<< * cdef object v_self_reference = bool(data.self_reference) * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) */ __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->ctelevelsup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_ctelevelsup = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":400 * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef object v_ctelevelsup = data.ctelevelsup * cdef object v_self_reference = bool(data.self_reference) # <<<<<<<<<<<<<< * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) */ __pyx_t_4 = __Pyx_PyInt_From_bool(__pyx_v_data->self_reference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_self_reference = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":401 * cdef object v_ctelevelsup = data.ctelevelsup * cdef object v_self_reference = bool(data.self_reference) * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coltypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_v_v_coltypes = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":402 * cdef object v_self_reference = bool(data.self_reference) * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) * cdef object v_enrname = data.enrname.decode("utf-8") if data.enrname is not NULL else None */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coltypmods, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 402, __pyx_L1_error) __pyx_v_v_coltypmods = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":403 * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_enrname = data.enrname.decode("utf-8") if data.enrname is not NULL else None * cdef object v_enrtuples = data.enrtuples */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colcollations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 403, __pyx_L1_error) __pyx_v_v_colcollations = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":404 * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) * cdef object v_enrname = data.enrname.decode("utf-8") if data.enrname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_enrtuples = data.enrtuples * cdef object v_lateral = bool(data.lateral) */ __pyx_t_2 = (__pyx_v_data->enrname != NULL); if (__pyx_t_2) { __pyx_t_9 = __pyx_v_data->enrname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 404, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } __pyx_v_v_enrname = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":405 * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) * cdef object v_enrname = data.enrname.decode("utf-8") if data.enrname is not NULL else None * cdef object v_enrtuples = data.enrtuples # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_inFromCl = bool(data.inFromCl) */ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_data->enrtuples); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_enrtuples = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":406 * cdef object v_enrname = data.enrname.decode("utf-8") if data.enrname is not NULL else None * cdef object v_enrtuples = data.enrtuples * cdef object v_lateral = bool(data.lateral) # <<<<<<<<<<<<<< * cdef object v_inFromCl = bool(data.inFromCl) * cdef tuple v_securityQuals = _pg_list_to_tuple(data.securityQuals, offset_to_index) */ __pyx_t_4 = __Pyx_PyInt_From_bool(__pyx_v_data->lateral); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_lateral = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":407 * cdef object v_enrtuples = data.enrtuples * cdef object v_lateral = bool(data.lateral) * cdef object v_inFromCl = bool(data.inFromCl) # <<<<<<<<<<<<<< * cdef tuple v_securityQuals = _pg_list_to_tuple(data.securityQuals, offset_to_index) * return ast.RangeTblEntry(v_alias, v_eref, v_rtekind, v_inh, v_relkind, v_rellockmode, v_perminfoindex, v_tablesample, v_subquery, v_security_barrier, v_jointype, v_joinmergedcols, v_joinaliasvars, v_joinleftcols, v_joinrightcols, v_join_using_alias, v_functions, v_funcordinality, v_tablefunc, v_values_lists, v_ctename, v_ctelevelsup, v_self_reference, v_coltypes, v_coltypmods, v_colcollations, v_enrname, v_enrtuples, v_lateral, v_inFromCl, v_securityQuals) */ __pyx_t_4 = __Pyx_PyInt_From_bool(__pyx_v_data->inFromCl); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_v_inFromCl = __pyx_t_4; __pyx_t_4 = 0; /* "pglast/ast.pyx":408 * cdef object v_lateral = bool(data.lateral) * cdef object v_inFromCl = bool(data.inFromCl) * cdef tuple v_securityQuals = _pg_list_to_tuple(data.securityQuals, offset_to_index) # <<<<<<<<<<<<<< * return ast.RangeTblEntry(v_alias, v_eref, v_rtekind, v_inh, v_relkind, v_rellockmode, v_perminfoindex, v_tablesample, v_subquery, v_security_barrier, v_jointype, v_joinmergedcols, v_joinaliasvars, v_joinleftcols, v_joinrightcols, v_join_using_alias, v_functions, v_funcordinality, v_tablefunc, v_values_lists, v_ctename, v_ctelevelsup, v_self_reference, v_coltypes, v_coltypmods, v_colcollations, v_enrname, v_enrtuples, v_lateral, v_inFromCl, v_securityQuals) * */ __pyx_t_4 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->securityQuals, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyTuple_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_4))) __PYX_ERR(0, 408, __pyx_L1_error) __pyx_v_v_securityQuals = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "pglast/ast.pyx":409 * cdef object v_inFromCl = bool(data.inFromCl) * cdef tuple v_securityQuals = _pg_list_to_tuple(data.securityQuals, offset_to_index) * return ast.RangeTblEntry(v_alias, v_eref, v_rtekind, v_inh, v_relkind, v_rellockmode, v_perminfoindex, v_tablesample, v_subquery, v_security_barrier, v_jointype, v_joinmergedcols, v_joinaliasvars, v_joinleftcols, v_joinrightcols, v_join_using_alias, v_functions, v_funcordinality, v_tablefunc, v_values_lists, v_ctename, v_ctelevelsup, v_self_reference, v_coltypes, v_coltypmods, v_colcollations, v_enrname, v_enrtuples, v_lateral, v_inFromCl, v_securityQuals) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RangeTblEntry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[32] = {__pyx_t_3, __pyx_v_v_alias, __pyx_v_v_eref, __pyx_v_v_rtekind, __pyx_v_v_inh, __pyx_v_v_relkind, __pyx_v_v_rellockmode, __pyx_v_v_perminfoindex, __pyx_v_v_tablesample, __pyx_v_v_subquery, __pyx_v_v_security_barrier, __pyx_v_v_jointype, __pyx_v_v_joinmergedcols, __pyx_v_v_joinaliasvars, __pyx_v_v_joinleftcols, __pyx_v_v_joinrightcols, __pyx_v_v_join_using_alias, __pyx_v_v_functions, __pyx_v_v_funcordinality, __pyx_v_v_tablefunc, __pyx_v_v_values_lists, __pyx_v_v_ctename, __pyx_v_v_ctelevelsup, __pyx_v_v_self_reference, __pyx_v_v_coltypes, __pyx_v_v_coltypmods, __pyx_v_v_colcollations, __pyx_v_v_enrname, __pyx_v_v_enrtuples, __pyx_v_v_lateral, __pyx_v_v_inFromCl, __pyx_v_v_securityQuals}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 31+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "pglast/ast.pyx":377 * * * cdef create_RangeTblEntry(structs.RangeTblEntry* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_eref = create(data.eref, offset_to_index) if data.eref is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_RangeTblEntry", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XDECREF(__pyx_v_v_eref); __Pyx_XDECREF(__pyx_v_v_rtekind); __Pyx_XDECREF(__pyx_v_v_inh); __Pyx_XDECREF(__pyx_v_v_relkind); __Pyx_XDECREF(__pyx_v_v_rellockmode); __Pyx_XDECREF(__pyx_v_v_perminfoindex); __Pyx_XDECREF(__pyx_v_v_tablesample); __Pyx_XDECREF(__pyx_v_v_subquery); __Pyx_XDECREF(__pyx_v_v_security_barrier); __Pyx_XDECREF(__pyx_v_v_jointype); __Pyx_XDECREF(__pyx_v_v_joinmergedcols); __Pyx_XDECREF(__pyx_v_v_joinaliasvars); __Pyx_XDECREF(__pyx_v_v_joinleftcols); __Pyx_XDECREF(__pyx_v_v_joinrightcols); __Pyx_XDECREF(__pyx_v_v_join_using_alias); __Pyx_XDECREF(__pyx_v_v_functions); __Pyx_XDECREF(__pyx_v_v_funcordinality); __Pyx_XDECREF(__pyx_v_v_tablefunc); __Pyx_XDECREF(__pyx_v_v_values_lists); __Pyx_XDECREF(__pyx_v_v_ctename); __Pyx_XDECREF(__pyx_v_v_ctelevelsup); __Pyx_XDECREF(__pyx_v_v_self_reference); __Pyx_XDECREF(__pyx_v_v_coltypes); __Pyx_XDECREF(__pyx_v_v_coltypmods); __Pyx_XDECREF(__pyx_v_v_colcollations); __Pyx_XDECREF(__pyx_v_v_enrname); __Pyx_XDECREF(__pyx_v_v_enrtuples); __Pyx_XDECREF(__pyx_v_v_lateral); __Pyx_XDECREF(__pyx_v_v_inFromCl); __Pyx_XDECREF(__pyx_v_v_securityQuals); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":412 * * * cdef create_RTEPermissionInfo(structs.RTEPermissionInfo* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_inh = bool(data.inh) * cdef object v_requiredPerms = data.requiredPerms */ static PyObject *__pyx_f_6pglast_6parser_create_RTEPermissionInfo(RTEPermissionInfo *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_inh = 0; PyObject *__pyx_v_v_requiredPerms = 0; PyObject *__pyx_v_v_selectedCols = 0; PyObject *__pyx_v_v_insertedCols = 0; PyObject *__pyx_v_v_updatedCols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RTEPermissionInfo", 1); /* "pglast/ast.pyx":413 * * cdef create_RTEPermissionInfo(structs.RTEPermissionInfo* data, offset_to_index): * cdef object v_inh = bool(data.inh) # <<<<<<<<<<<<<< * cdef object v_requiredPerms = data.requiredPerms * cdef set v_selectedCols = _pg_bitmapset_to_set(data.selectedCols) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->inh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inh = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":414 * cdef create_RTEPermissionInfo(structs.RTEPermissionInfo* data, offset_to_index): * cdef object v_inh = bool(data.inh) * cdef object v_requiredPerms = data.requiredPerms # <<<<<<<<<<<<<< * cdef set v_selectedCols = _pg_bitmapset_to_set(data.selectedCols) * cdef set v_insertedCols = _pg_bitmapset_to_set(data.insertedCols) */ __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_data->requiredPerms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_requiredPerms = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":415 * cdef object v_inh = bool(data.inh) * cdef object v_requiredPerms = data.requiredPerms * cdef set v_selectedCols = _pg_bitmapset_to_set(data.selectedCols) # <<<<<<<<<<<<<< * cdef set v_insertedCols = _pg_bitmapset_to_set(data.insertedCols) * cdef set v_updatedCols = _pg_bitmapset_to_set(data.updatedCols) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_bitmapset_to_set(__pyx_v_data->selectedCols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 415, __pyx_L1_error) __pyx_v_v_selectedCols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":416 * cdef object v_requiredPerms = data.requiredPerms * cdef set v_selectedCols = _pg_bitmapset_to_set(data.selectedCols) * cdef set v_insertedCols = _pg_bitmapset_to_set(data.insertedCols) # <<<<<<<<<<<<<< * cdef set v_updatedCols = _pg_bitmapset_to_set(data.updatedCols) * return ast.RTEPermissionInfo(v_inh, v_requiredPerms, v_selectedCols, v_insertedCols, v_updatedCols) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_bitmapset_to_set(__pyx_v_data->insertedCols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 416, __pyx_L1_error) __pyx_v_v_insertedCols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":417 * cdef set v_selectedCols = _pg_bitmapset_to_set(data.selectedCols) * cdef set v_insertedCols = _pg_bitmapset_to_set(data.insertedCols) * cdef set v_updatedCols = _pg_bitmapset_to_set(data.updatedCols) # <<<<<<<<<<<<<< * return ast.RTEPermissionInfo(v_inh, v_requiredPerms, v_selectedCols, v_insertedCols, v_updatedCols) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_bitmapset_to_set(__pyx_v_data->updatedCols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 417, __pyx_L1_error) __pyx_v_v_updatedCols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":418 * cdef set v_insertedCols = _pg_bitmapset_to_set(data.insertedCols) * cdef set v_updatedCols = _pg_bitmapset_to_set(data.updatedCols) * return ast.RTEPermissionInfo(v_inh, v_requiredPerms, v_selectedCols, v_insertedCols, v_updatedCols) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RTEPermissionInfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_inh, __pyx_v_v_requiredPerms, __pyx_v_v_selectedCols, __pyx_v_v_insertedCols, __pyx_v_v_updatedCols}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":412 * * * cdef create_RTEPermissionInfo(structs.RTEPermissionInfo* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_inh = bool(data.inh) * cdef object v_requiredPerms = data.requiredPerms */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RTEPermissionInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_inh); __Pyx_XDECREF(__pyx_v_v_requiredPerms); __Pyx_XDECREF(__pyx_v_v_selectedCols); __Pyx_XDECREF(__pyx_v_v_insertedCols); __Pyx_XDECREF(__pyx_v_v_updatedCols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":421 * * * cdef create_RangeTblFunction(structs.RangeTblFunction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef object v_funccolcount = data.funccolcount */ static PyObject *__pyx_f_6pglast_6parser_create_RangeTblFunction(RangeTblFunction *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_funcexpr = 0; PyObject *__pyx_v_v_funccolcount = 0; PyObject *__pyx_v_v_funccolnames = 0; PyObject *__pyx_v_v_funccoltypes = 0; PyObject *__pyx_v_v_funccoltypmods = 0; PyObject *__pyx_v_v_funccolcollations = 0; PyObject *__pyx_v_v_funcparams = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeTblFunction", 1); /* "pglast/ast.pyx":422 * * cdef create_RangeTblFunction(structs.RangeTblFunction* data, offset_to_index): * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_funccolcount = data.funccolcount * cdef tuple v_funccolnames = _pg_list_to_tuple(data.funccolnames, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->funcexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->funcexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_funcexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":423 * cdef create_RangeTblFunction(structs.RangeTblFunction* data, offset_to_index): * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef object v_funccolcount = data.funccolcount # <<<<<<<<<<<<<< * cdef tuple v_funccolnames = _pg_list_to_tuple(data.funccolnames, offset_to_index) * cdef tuple v_funccoltypes = _pg_list_to_tuple(data.funccoltypes, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->funccolcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_funccolcount = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":424 * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef object v_funccolcount = data.funccolcount * cdef tuple v_funccolnames = _pg_list_to_tuple(data.funccolnames, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_funccoltypes = _pg_list_to_tuple(data.funccoltypes, offset_to_index) * cdef tuple v_funccoltypmods = _pg_list_to_tuple(data.funccoltypmods, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funccolnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 424, __pyx_L1_error) __pyx_v_v_funccolnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":425 * cdef object v_funccolcount = data.funccolcount * cdef tuple v_funccolnames = _pg_list_to_tuple(data.funccolnames, offset_to_index) * cdef tuple v_funccoltypes = _pg_list_to_tuple(data.funccoltypes, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_funccoltypmods = _pg_list_to_tuple(data.funccoltypmods, offset_to_index) * cdef tuple v_funccolcollations = _pg_list_to_tuple(data.funccolcollations, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funccoltypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 425, __pyx_L1_error) __pyx_v_v_funccoltypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":426 * cdef tuple v_funccolnames = _pg_list_to_tuple(data.funccolnames, offset_to_index) * cdef tuple v_funccoltypes = _pg_list_to_tuple(data.funccoltypes, offset_to_index) * cdef tuple v_funccoltypmods = _pg_list_to_tuple(data.funccoltypmods, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_funccolcollations = _pg_list_to_tuple(data.funccolcollations, offset_to_index) * cdef set v_funcparams = _pg_bitmapset_to_set(data.funcparams) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funccoltypmods, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 426, __pyx_L1_error) __pyx_v_v_funccoltypmods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":427 * cdef tuple v_funccoltypes = _pg_list_to_tuple(data.funccoltypes, offset_to_index) * cdef tuple v_funccoltypmods = _pg_list_to_tuple(data.funccoltypmods, offset_to_index) * cdef tuple v_funccolcollations = _pg_list_to_tuple(data.funccolcollations, offset_to_index) # <<<<<<<<<<<<<< * cdef set v_funcparams = _pg_bitmapset_to_set(data.funcparams) * return ast.RangeTblFunction(v_funcexpr, v_funccolcount, v_funccolnames, v_funccoltypes, v_funccoltypmods, v_funccolcollations, v_funcparams) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funccolcollations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 427, __pyx_L1_error) __pyx_v_v_funccolcollations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":428 * cdef tuple v_funccoltypmods = _pg_list_to_tuple(data.funccoltypmods, offset_to_index) * cdef tuple v_funccolcollations = _pg_list_to_tuple(data.funccolcollations, offset_to_index) * cdef set v_funcparams = _pg_bitmapset_to_set(data.funcparams) # <<<<<<<<<<<<<< * return ast.RangeTblFunction(v_funcexpr, v_funccolcount, v_funccolnames, v_funccoltypes, v_funccoltypmods, v_funccolcollations, v_funcparams) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_bitmapset_to_set(__pyx_v_data->funcparams); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 428, __pyx_L1_error) __pyx_v_v_funcparams = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":429 * cdef tuple v_funccolcollations = _pg_list_to_tuple(data.funccolcollations, offset_to_index) * cdef set v_funcparams = _pg_bitmapset_to_set(data.funcparams) * return ast.RangeTblFunction(v_funcexpr, v_funccolcount, v_funccolnames, v_funccoltypes, v_funccoltypmods, v_funccolcollations, v_funcparams) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RangeTblFunction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_v_v_funcexpr, __pyx_v_v_funccolcount, __pyx_v_v_funccolnames, __pyx_v_v_funccoltypes, __pyx_v_v_funccoltypmods, __pyx_v_v_funccolcollations, __pyx_v_v_funcparams}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 7+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":421 * * * cdef create_RangeTblFunction(structs.RangeTblFunction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef object v_funccolcount = data.funccolcount */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RangeTblFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_funcexpr); __Pyx_XDECREF(__pyx_v_v_funccolcount); __Pyx_XDECREF(__pyx_v_v_funccolnames); __Pyx_XDECREF(__pyx_v_v_funccoltypes); __Pyx_XDECREF(__pyx_v_v_funccoltypmods); __Pyx_XDECREF(__pyx_v_v_funccolcollations); __Pyx_XDECREF(__pyx_v_v_funcparams); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":432 * * * cdef create_TableSampleClause(structs.TableSampleClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_TableSampleClause(TableSampleClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_repeatable = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TableSampleClause", 1); /* "pglast/ast.pyx":433 * * cdef create_TableSampleClause(structs.TableSampleClause* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None * return ast.TableSampleClause(v_args, v_repeatable) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 433, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":434 * cdef create_TableSampleClause(structs.TableSampleClause* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None # <<<<<<<<<<<<<< * return ast.TableSampleClause(v_args, v_repeatable) * */ __pyx_t_2 = (__pyx_v_data->repeatable != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->repeatable, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_repeatable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":435 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None * return ast.TableSampleClause(v_args, v_repeatable) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TableSampleClause); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_args, __pyx_v_v_repeatable}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":432 * * * cdef create_TableSampleClause(structs.TableSampleClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_repeatable = create(data.repeatable, offset_to_index) if data.repeatable is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_TableSampleClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_repeatable); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":438 * * * cdef create_WithCheckOption(structs.WithCheckOption* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'WCOKind')(data.kind) * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_WithCheckOption(WithCheckOption *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_relname = 0; PyObject *__pyx_v_v_polname = 0; PyObject *__pyx_v_v_qual = 0; PyObject *__pyx_v_v_cascaded = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_WithCheckOption", 1); /* "pglast/ast.pyx":439 * * cdef create_WithCheckOption(structs.WithCheckOption* data, offset_to_index): * cdef object v_kind = getattr(enums, 'WCOKind')(data.kind) # <<<<<<<<<<<<<< * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None * cdef object v_polname = data.polname.decode("utf-8") if data.polname is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_WCOKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_WCOKind(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":440 * cdef create_WithCheckOption(structs.WithCheckOption* data, offset_to_index): * cdef object v_kind = getattr(enums, 'WCOKind')(data.kind) * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_polname = data.polname.decode("utf-8") if data.polname is not NULL else None * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None */ __pyx_t_6 = (__pyx_v_data->relname != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->relname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 440, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":441 * cdef object v_kind = getattr(enums, 'WCOKind')(data.kind) * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None * cdef object v_polname = data.polname.decode("utf-8") if data.polname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_cascaded = bool(data.cascaded) */ __pyx_t_6 = (__pyx_v_data->polname != NULL); if (__pyx_t_6) { __pyx_t_9 = __pyx_v_data->polname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 441, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_polname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":442 * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None * cdef object v_polname = data.polname.decode("utf-8") if data.polname is not NULL else None * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cascaded = bool(data.cascaded) * return ast.WithCheckOption(v_kind, v_relname, v_polname, v_qual, v_cascaded) */ __pyx_t_6 = (__pyx_v_data->qual != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->qual, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_qual = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":443 * cdef object v_polname = data.polname.decode("utf-8") if data.polname is not NULL else None * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_cascaded = bool(data.cascaded) # <<<<<<<<<<<<<< * return ast.WithCheckOption(v_kind, v_relname, v_polname, v_qual, v_cascaded) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->cascaded); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_cascaded = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":444 * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_cascaded = bool(data.cascaded) * return ast.WithCheckOption(v_kind, v_relname, v_polname, v_qual, v_cascaded) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_WithCheckOption); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_kind, __pyx_v_v_relname, __pyx_v_v_polname, __pyx_v_v_qual, __pyx_v_v_cascaded}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":438 * * * cdef create_WithCheckOption(structs.WithCheckOption* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'WCOKind')(data.kind) * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_WithCheckOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_relname); __Pyx_XDECREF(__pyx_v_v_polname); __Pyx_XDECREF(__pyx_v_v_qual); __Pyx_XDECREF(__pyx_v_v_cascaded); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":447 * * * cdef create_SortGroupClause(structs.SortGroupClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tleSortGroupRef = data.tleSortGroupRef * cdef object v_nulls_first = bool(data.nulls_first) */ static PyObject *__pyx_f_6pglast_6parser_create_SortGroupClause(SortGroupClause *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_tleSortGroupRef = 0; PyObject *__pyx_v_v_nulls_first = 0; PyObject *__pyx_v_v_hashable = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SortGroupClause", 1); /* "pglast/ast.pyx":448 * * cdef create_SortGroupClause(structs.SortGroupClause* data, offset_to_index): * cdef object v_tleSortGroupRef = data.tleSortGroupRef # <<<<<<<<<<<<<< * cdef object v_nulls_first = bool(data.nulls_first) * cdef object v_hashable = bool(data.hashable) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->tleSortGroupRef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_tleSortGroupRef = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":449 * cdef create_SortGroupClause(structs.SortGroupClause* data, offset_to_index): * cdef object v_tleSortGroupRef = data.tleSortGroupRef * cdef object v_nulls_first = bool(data.nulls_first) # <<<<<<<<<<<<<< * cdef object v_hashable = bool(data.hashable) * return ast.SortGroupClause(v_tleSortGroupRef, v_nulls_first, v_hashable) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->nulls_first); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_nulls_first = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":450 * cdef object v_tleSortGroupRef = data.tleSortGroupRef * cdef object v_nulls_first = bool(data.nulls_first) * cdef object v_hashable = bool(data.hashable) # <<<<<<<<<<<<<< * return ast.SortGroupClause(v_tleSortGroupRef, v_nulls_first, v_hashable) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->hashable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_hashable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":451 * cdef object v_nulls_first = bool(data.nulls_first) * cdef object v_hashable = bool(data.hashable) * return ast.SortGroupClause(v_tleSortGroupRef, v_nulls_first, v_hashable) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SortGroupClause); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_tleSortGroupRef, __pyx_v_v_nulls_first, __pyx_v_v_hashable}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":447 * * * cdef create_SortGroupClause(structs.SortGroupClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tleSortGroupRef = data.tleSortGroupRef * cdef object v_nulls_first = bool(data.nulls_first) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SortGroupClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_tleSortGroupRef); __Pyx_XDECREF(__pyx_v_v_nulls_first); __Pyx_XDECREF(__pyx_v_v_hashable); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":454 * * * cdef create_GroupingSet(structs.GroupingSet* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'GroupingSetKind')(data.kind) * cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_GroupingSet(GroupingSet *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_content = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_GroupingSet", 1); /* "pglast/ast.pyx":455 * * cdef create_GroupingSet(structs.GroupingSet* data, offset_to_index): * cdef object v_kind = getattr(enums, 'GroupingSetKind')(data.kind) # <<<<<<<<<<<<<< * cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_GroupingSetKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_GroupingSetKind(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":456 * cdef create_GroupingSet(structs.GroupingSet* data, offset_to_index): * cdef object v_kind = getattr(enums, 'GroupingSetKind')(data.kind) * cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.GroupingSet(v_kind, v_content, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->content, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 456, __pyx_L1_error) __pyx_v_v_content = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":457 * cdef object v_kind = getattr(enums, 'GroupingSetKind')(data.kind) * cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.GroupingSet(v_kind, v_content, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":458 * cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.GroupingSet(v_kind, v_content, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GroupingSet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_kind, __pyx_v_v_content, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":454 * * * cdef create_GroupingSet(structs.GroupingSet* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'GroupingSetKind')(data.kind) * cdef tuple v_content = _pg_list_to_tuple(data.content, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_GroupingSet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_content); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":461 * * * cdef create_WindowClause(structs.WindowClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_WindowClause(WindowClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_refname = 0; PyObject *__pyx_v_v_partitionClause = 0; PyObject *__pyx_v_v_orderClause = 0; PyObject *__pyx_v_v_frameOptions = 0; PyObject *__pyx_v_v_startOffset = 0; PyObject *__pyx_v_v_endOffset = 0; PyObject *__pyx_v_v_inRangeAsc = 0; PyObject *__pyx_v_v_inRangeNullsFirst = 0; PyObject *__pyx_v_v_winref = 0; PyObject *__pyx_v_v_copiedOrder = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_WindowClause", 1); /* "pglast/ast.pyx":462 * * cdef create_WindowClause(structs.WindowClause* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 462, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":463 * cdef create_WindowClause(structs.WindowClause* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->refname != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->refname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 463, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_refname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":464 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) * cdef object v_frameOptions = data.frameOptions */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->partitionClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 464, __pyx_L1_error) __pyx_v_v_partitionClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":465 * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_frameOptions = data.frameOptions * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->orderClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 465, __pyx_L1_error) __pyx_v_v_orderClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":466 * cdef tuple v_partitionClause = _pg_list_to_tuple(data.partitionClause, offset_to_index) * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) * cdef object v_frameOptions = data.frameOptions # <<<<<<<<<<<<<< * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->frameOptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_frameOptions = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":467 * cdef tuple v_orderClause = _pg_list_to_tuple(data.orderClause, offset_to_index) * cdef object v_frameOptions = data.frameOptions * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None # <<<<<<<<<<<<<< * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None * cdef object v_inRangeAsc = bool(data.inRangeAsc) */ __pyx_t_2 = (__pyx_v_data->startOffset != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->startOffset, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_startOffset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":468 * cdef object v_frameOptions = data.frameOptions * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None # <<<<<<<<<<<<<< * cdef object v_inRangeAsc = bool(data.inRangeAsc) * cdef object v_inRangeNullsFirst = bool(data.inRangeNullsFirst) */ __pyx_t_2 = (__pyx_v_data->endOffset != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->endOffset, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_endOffset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":469 * cdef object v_startOffset = create(data.startOffset, offset_to_index) if data.startOffset is not NULL else None * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None * cdef object v_inRangeAsc = bool(data.inRangeAsc) # <<<<<<<<<<<<<< * cdef object v_inRangeNullsFirst = bool(data.inRangeNullsFirst) * cdef object v_winref = data.winref */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->inRangeAsc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inRangeAsc = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":470 * cdef object v_endOffset = create(data.endOffset, offset_to_index) if data.endOffset is not NULL else None * cdef object v_inRangeAsc = bool(data.inRangeAsc) * cdef object v_inRangeNullsFirst = bool(data.inRangeNullsFirst) # <<<<<<<<<<<<<< * cdef object v_winref = data.winref * cdef object v_copiedOrder = bool(data.copiedOrder) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->inRangeNullsFirst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inRangeNullsFirst = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":471 * cdef object v_inRangeAsc = bool(data.inRangeAsc) * cdef object v_inRangeNullsFirst = bool(data.inRangeNullsFirst) * cdef object v_winref = data.winref # <<<<<<<<<<<<<< * cdef object v_copiedOrder = bool(data.copiedOrder) * return ast.WindowClause(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_inRangeAsc, v_inRangeNullsFirst, v_winref, v_copiedOrder) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->winref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_winref = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":472 * cdef object v_inRangeNullsFirst = bool(data.inRangeNullsFirst) * cdef object v_winref = data.winref * cdef object v_copiedOrder = bool(data.copiedOrder) # <<<<<<<<<<<<<< * return ast.WindowClause(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_inRangeAsc, v_inRangeNullsFirst, v_winref, v_copiedOrder) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->copiedOrder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_copiedOrder = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":473 * cdef object v_winref = data.winref * cdef object v_copiedOrder = bool(data.copiedOrder) * return ast.WindowClause(v_name, v_refname, v_partitionClause, v_orderClause, v_frameOptions, v_startOffset, v_endOffset, v_inRangeAsc, v_inRangeNullsFirst, v_winref, v_copiedOrder) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_WindowClause); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[12] = {__pyx_t_5, __pyx_v_v_name, __pyx_v_v_refname, __pyx_v_v_partitionClause, __pyx_v_v_orderClause, __pyx_v_v_frameOptions, __pyx_v_v_startOffset, __pyx_v_v_endOffset, __pyx_v_v_inRangeAsc, __pyx_v_v_inRangeNullsFirst, __pyx_v_v_winref, __pyx_v_v_copiedOrder}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 11+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":461 * * * cdef create_WindowClause(structs.WindowClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_refname = data.refname.decode("utf-8") if data.refname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_WindowClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_refname); __Pyx_XDECREF(__pyx_v_v_partitionClause); __Pyx_XDECREF(__pyx_v_v_orderClause); __Pyx_XDECREF(__pyx_v_v_frameOptions); __Pyx_XDECREF(__pyx_v_v_startOffset); __Pyx_XDECREF(__pyx_v_v_endOffset); __Pyx_XDECREF(__pyx_v_v_inRangeAsc); __Pyx_XDECREF(__pyx_v_v_inRangeNullsFirst); __Pyx_XDECREF(__pyx_v_v_winref); __Pyx_XDECREF(__pyx_v_v_copiedOrder); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":476 * * * cdef create_RowMarkClause(structs.RowMarkClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rti = data.rti * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) */ static PyObject *__pyx_f_6pglast_6parser_create_RowMarkClause(RowMarkClause *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_rti = 0; PyObject *__pyx_v_v_strength = 0; PyObject *__pyx_v_v_waitPolicy = 0; PyObject *__pyx_v_v_pushedDown = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RowMarkClause", 1); /* "pglast/ast.pyx":477 * * cdef create_RowMarkClause(structs.RowMarkClause* data, offset_to_index): * cdef object v_rti = data.rti # <<<<<<<<<<<<<< * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->rti); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_rti = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":478 * cdef create_RowMarkClause(structs.RowMarkClause* data, offset_to_index): * cdef object v_rti = data.rti * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) # <<<<<<<<<<<<<< * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) * cdef object v_pushedDown = bool(data.pushedDown) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_LockClauseStrength); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_LockClauseStrength(__pyx_v_data->strength); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_strength = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":479 * cdef object v_rti = data.rti * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) # <<<<<<<<<<<<<< * cdef object v_pushedDown = bool(data.pushedDown) * return ast.RowMarkClause(v_rti, v_strength, v_waitPolicy, v_pushedDown) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_LockWaitPolicy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_LockWaitPolicy(__pyx_v_data->waitPolicy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_waitPolicy = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":480 * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) * cdef object v_pushedDown = bool(data.pushedDown) # <<<<<<<<<<<<<< * return ast.RowMarkClause(v_rti, v_strength, v_waitPolicy, v_pushedDown) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->pushedDown); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_pushedDown = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":481 * cdef object v_waitPolicy = getattr(enums, 'LockWaitPolicy')(data.waitPolicy) * cdef object v_pushedDown = bool(data.pushedDown) * return ast.RowMarkClause(v_rti, v_strength, v_waitPolicy, v_pushedDown) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RowMarkClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_v_rti, __pyx_v_v_strength, __pyx_v_v_waitPolicy, __pyx_v_v_pushedDown}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":476 * * * cdef create_RowMarkClause(structs.RowMarkClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rti = data.rti * cdef object v_strength = getattr(enums, 'LockClauseStrength')(data.strength) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RowMarkClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_rti); __Pyx_XDECREF(__pyx_v_v_strength); __Pyx_XDECREF(__pyx_v_v_waitPolicy); __Pyx_XDECREF(__pyx_v_v_pushedDown); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":484 * * * cdef create_WithClause(structs.WithClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_ctes = _pg_list_to_tuple(data.ctes, offset_to_index) * cdef object v_recursive = bool(data.recursive) */ static PyObject *__pyx_f_6pglast_6parser_create_WithClause(WithClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_ctes = 0; PyObject *__pyx_v_v_recursive = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_WithClause", 1); /* "pglast/ast.pyx":485 * * cdef create_WithClause(structs.WithClause* data, offset_to_index): * cdef tuple v_ctes = _pg_list_to_tuple(data.ctes, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_recursive = bool(data.recursive) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ctes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 485, __pyx_L1_error) __pyx_v_v_ctes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":486 * cdef create_WithClause(structs.WithClause* data, offset_to_index): * cdef tuple v_ctes = _pg_list_to_tuple(data.ctes, offset_to_index) * cdef object v_recursive = bool(data.recursive) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.WithClause(v_ctes, v_recursive, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->recursive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_recursive = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":487 * cdef tuple v_ctes = _pg_list_to_tuple(data.ctes, offset_to_index) * cdef object v_recursive = bool(data.recursive) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.WithClause(v_ctes, v_recursive, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":488 * cdef object v_recursive = bool(data.recursive) * cdef object v_location = offset_to_index(data.location) * return ast.WithClause(v_ctes, v_recursive, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_WithClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_ctes, __pyx_v_v_recursive, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":484 * * * cdef create_WithClause(structs.WithClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_ctes = _pg_list_to_tuple(data.ctes, offset_to_index) * cdef object v_recursive = bool(data.recursive) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_WithClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_ctes); __Pyx_XDECREF(__pyx_v_v_recursive); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":491 * * * cdef create_InferClause(structs.InferClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_indexElems = _pg_list_to_tuple(data.indexElems, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_InferClause(InferClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_indexElems = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_conname = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_InferClause", 1); /* "pglast/ast.pyx":492 * * cdef create_InferClause(structs.InferClause* data, offset_to_index): * cdef tuple v_indexElems = _pg_list_to_tuple(data.indexElems, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->indexElems, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 492, __pyx_L1_error) __pyx_v_v_indexElems = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":493 * cdef create_InferClause(structs.InferClause* data, offset_to_index): * cdef tuple v_indexElems = _pg_list_to_tuple(data.indexElems, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":494 * cdef tuple v_indexElems = _pg_list_to_tuple(data.indexElems, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.InferClause(v_indexElems, v_whereClause, v_conname, v_location) */ __pyx_t_2 = (__pyx_v_data->conname != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->conname; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 494, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":495 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.InferClause(v_indexElems, v_whereClause, v_conname, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":496 * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.InferClause(v_indexElems, v_whereClause, v_conname, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InferClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_v_indexElems, __pyx_v_v_whereClause, __pyx_v_v_conname, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":491 * * * cdef create_InferClause(structs.InferClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_indexElems = _pg_list_to_tuple(data.indexElems, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_InferClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_indexElems); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_conname); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":499 * * * cdef create_OnConflictClause(structs.OnConflictClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_OnConflictClause(OnConflictClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_action = 0; PyObject *__pyx_v_v_infer = 0; PyObject *__pyx_v_v_targetList = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_OnConflictClause", 1); /* "pglast/ast.pyx":500 * * cdef create_OnConflictClause(structs.OnConflictClause* data, offset_to_index): * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) # <<<<<<<<<<<<<< * cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_OnConflictAction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_OnConflictAction(__pyx_v_data->action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":501 * cdef create_OnConflictClause(structs.OnConflictClause* data, offset_to_index): * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_6 = (__pyx_v_data->infer != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->infer, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_infer = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":502 * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->targetList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 502, __pyx_L1_error) __pyx_v_v_targetList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":503 * cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.OnConflictClause(v_action, v_infer, v_targetList, v_whereClause, v_location) */ __pyx_t_6 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":504 * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.OnConflictClause(v_action, v_infer, v_targetList, v_whereClause, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":505 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.OnConflictClause(v_action, v_infer, v_targetList, v_whereClause, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_OnConflictClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_v_action, __pyx_v_v_infer, __pyx_v_v_targetList, __pyx_v_v_whereClause, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":499 * * * cdef create_OnConflictClause(structs.OnConflictClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef object v_infer = create(data.infer, offset_to_index) if data.infer is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_OnConflictClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_action); __Pyx_XDECREF(__pyx_v_v_infer); __Pyx_XDECREF(__pyx_v_v_targetList); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":508 * * * cdef create_CTESearchClause(structs.CTESearchClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_search_col_list = _pg_list_to_tuple(data.search_col_list, offset_to_index) * cdef object v_search_breadth_first = bool(data.search_breadth_first) */ static PyObject *__pyx_f_6pglast_6parser_create_CTESearchClause(CTESearchClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_search_col_list = 0; PyObject *__pyx_v_v_search_breadth_first = 0; PyObject *__pyx_v_v_search_seq_column = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CTESearchClause", 1); /* "pglast/ast.pyx":509 * * cdef create_CTESearchClause(structs.CTESearchClause* data, offset_to_index): * cdef tuple v_search_col_list = _pg_list_to_tuple(data.search_col_list, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_search_breadth_first = bool(data.search_breadth_first) * cdef object v_search_seq_column = data.search_seq_column.decode("utf-8") if data.search_seq_column is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->search_col_list, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 509, __pyx_L1_error) __pyx_v_v_search_col_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":510 * cdef create_CTESearchClause(structs.CTESearchClause* data, offset_to_index): * cdef tuple v_search_col_list = _pg_list_to_tuple(data.search_col_list, offset_to_index) * cdef object v_search_breadth_first = bool(data.search_breadth_first) # <<<<<<<<<<<<<< * cdef object v_search_seq_column = data.search_seq_column.decode("utf-8") if data.search_seq_column is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->search_breadth_first); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_search_breadth_first = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":511 * cdef tuple v_search_col_list = _pg_list_to_tuple(data.search_col_list, offset_to_index) * cdef object v_search_breadth_first = bool(data.search_breadth_first) * cdef object v_search_seq_column = data.search_seq_column.decode("utf-8") if data.search_seq_column is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CTESearchClause(v_search_col_list, v_search_breadth_first, v_search_seq_column, v_location) */ __pyx_t_2 = (__pyx_v_data->search_seq_column != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->search_seq_column; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 511, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_search_seq_column = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":512 * cdef object v_search_breadth_first = bool(data.search_breadth_first) * cdef object v_search_seq_column = data.search_seq_column.decode("utf-8") if data.search_seq_column is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CTESearchClause(v_search_col_list, v_search_breadth_first, v_search_seq_column, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":513 * cdef object v_search_seq_column = data.search_seq_column.decode("utf-8") if data.search_seq_column is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.CTESearchClause(v_search_col_list, v_search_breadth_first, v_search_seq_column, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_CTESearchClause); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_v_search_col_list, __pyx_v_v_search_breadth_first, __pyx_v_v_search_seq_column, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":508 * * * cdef create_CTESearchClause(structs.CTESearchClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_search_col_list = _pg_list_to_tuple(data.search_col_list, offset_to_index) * cdef object v_search_breadth_first = bool(data.search_breadth_first) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CTESearchClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_search_col_list); __Pyx_XDECREF(__pyx_v_v_search_breadth_first); __Pyx_XDECREF(__pyx_v_v_search_seq_column); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":516 * * * cdef create_CTECycleClause(structs.CTECycleClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_cycle_col_list = _pg_list_to_tuple(data.cycle_col_list, offset_to_index) * cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CTECycleClause(CTECycleClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_cycle_col_list = 0; PyObject *__pyx_v_v_cycle_mark_column = 0; PyObject *__pyx_v_v_cycle_mark_value = 0; PyObject *__pyx_v_v_cycle_mark_default = 0; PyObject *__pyx_v_v_cycle_path_column = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_v_v_cycle_mark_typmod = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CTECycleClause", 1); /* "pglast/ast.pyx":517 * * cdef create_CTECycleClause(structs.CTECycleClause* data, offset_to_index): * cdef tuple v_cycle_col_list = _pg_list_to_tuple(data.cycle_col_list, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None * cdef object v_cycle_mark_value = create(data.cycle_mark_value, offset_to_index) if data.cycle_mark_value is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->cycle_col_list, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 517, __pyx_L1_error) __pyx_v_v_cycle_col_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":518 * cdef create_CTECycleClause(structs.CTECycleClause* data, offset_to_index): * cdef tuple v_cycle_col_list = _pg_list_to_tuple(data.cycle_col_list, offset_to_index) * cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cycle_mark_value = create(data.cycle_mark_value, offset_to_index) if data.cycle_mark_value is not NULL else None * cdef object v_cycle_mark_default = create(data.cycle_mark_default, offset_to_index) if data.cycle_mark_default is not NULL else None */ __pyx_t_2 = (__pyx_v_data->cycle_mark_column != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->cycle_mark_column; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 518, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cycle_mark_column = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":519 * cdef tuple v_cycle_col_list = _pg_list_to_tuple(data.cycle_col_list, offset_to_index) * cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None * cdef object v_cycle_mark_value = create(data.cycle_mark_value, offset_to_index) if data.cycle_mark_value is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cycle_mark_default = create(data.cycle_mark_default, offset_to_index) if data.cycle_mark_default is not NULL else None * cdef object v_cycle_path_column = data.cycle_path_column.decode("utf-8") if data.cycle_path_column is not NULL else None */ __pyx_t_2 = (__pyx_v_data->cycle_mark_value != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->cycle_mark_value, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cycle_mark_value = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":520 * cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None * cdef object v_cycle_mark_value = create(data.cycle_mark_value, offset_to_index) if data.cycle_mark_value is not NULL else None * cdef object v_cycle_mark_default = create(data.cycle_mark_default, offset_to_index) if data.cycle_mark_default is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cycle_path_column = data.cycle_path_column.decode("utf-8") if data.cycle_path_column is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->cycle_mark_default != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->cycle_mark_default, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cycle_mark_default = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":521 * cdef object v_cycle_mark_value = create(data.cycle_mark_value, offset_to_index) if data.cycle_mark_value is not NULL else None * cdef object v_cycle_mark_default = create(data.cycle_mark_default, offset_to_index) if data.cycle_mark_default is not NULL else None * cdef object v_cycle_path_column = data.cycle_path_column.decode("utf-8") if data.cycle_path_column is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * cdef object v_cycle_mark_typmod = data.cycle_mark_typmod */ __pyx_t_2 = (__pyx_v_data->cycle_path_column != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->cycle_path_column; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 521, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cycle_path_column = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":522 * cdef object v_cycle_mark_default = create(data.cycle_mark_default, offset_to_index) if data.cycle_mark_default is not NULL else None * cdef object v_cycle_path_column = data.cycle_path_column.decode("utf-8") if data.cycle_path_column is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * cdef object v_cycle_mark_typmod = data.cycle_mark_typmod * return ast.CTECycleClause(v_cycle_col_list, v_cycle_mark_column, v_cycle_mark_value, v_cycle_mark_default, v_cycle_path_column, v_location, v_cycle_mark_typmod) */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_7 = __pyx_v_offset_to_index; __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":523 * cdef object v_cycle_path_column = data.cycle_path_column.decode("utf-8") if data.cycle_path_column is not NULL else None * cdef object v_location = offset_to_index(data.location) * cdef object v_cycle_mark_typmod = data.cycle_mark_typmod # <<<<<<<<<<<<<< * return ast.CTECycleClause(v_cycle_col_list, v_cycle_mark_column, v_cycle_mark_value, v_cycle_mark_default, v_cycle_path_column, v_location, v_cycle_mark_typmod) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->cycle_mark_typmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_cycle_mark_typmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":524 * cdef object v_location = offset_to_index(data.location) * cdef object v_cycle_mark_typmod = data.cycle_mark_typmod * return ast.CTECycleClause(v_cycle_col_list, v_cycle_mark_column, v_cycle_mark_value, v_cycle_mark_default, v_cycle_path_column, v_location, v_cycle_mark_typmod) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ast); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_CTECycleClause); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_7, __pyx_v_v_cycle_col_list, __pyx_v_v_cycle_mark_column, __pyx_v_v_cycle_mark_value, __pyx_v_v_cycle_mark_default, __pyx_v_v_cycle_path_column, __pyx_v_v_location, __pyx_v_v_cycle_mark_typmod}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 7+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":516 * * * cdef create_CTECycleClause(structs.CTECycleClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_cycle_col_list = _pg_list_to_tuple(data.cycle_col_list, offset_to_index) * cdef object v_cycle_mark_column = data.cycle_mark_column.decode("utf-8") if data.cycle_mark_column is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.create_CTECycleClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_cycle_col_list); __Pyx_XDECREF(__pyx_v_v_cycle_mark_column); __Pyx_XDECREF(__pyx_v_v_cycle_mark_value); __Pyx_XDECREF(__pyx_v_v_cycle_mark_default); __Pyx_XDECREF(__pyx_v_v_cycle_path_column); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XDECREF(__pyx_v_v_cycle_mark_typmod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":527 * * * cdef create_CommonTableExpr(structs.CommonTableExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CommonTableExpr(CommonTableExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_ctename = 0; PyObject *__pyx_v_v_aliascolnames = 0; PyObject *__pyx_v_v_ctematerialized = 0; PyObject *__pyx_v_v_ctequery = 0; PyObject *__pyx_v_v_search_clause = 0; PyObject *__pyx_v_v_cycle_clause = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_v_v_cterecursive = 0; PyObject *__pyx_v_v_cterefcount = 0; PyObject *__pyx_v_v_ctecolnames = 0; PyObject *__pyx_v_v_ctecoltypes = 0; PyObject *__pyx_v_v_ctecoltypmods = 0; PyObject *__pyx_v_v_ctecolcollations = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CommonTableExpr", 1); /* "pglast/ast.pyx":528 * * cdef create_CommonTableExpr(structs.CommonTableExpr* data, offset_to_index): * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) * cdef object v_ctematerialized = getattr(enums, 'CTEMaterialize')(data.ctematerialized) */ __pyx_t_2 = (__pyx_v_data->ctename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->ctename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 528, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_ctename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":529 * cdef create_CommonTableExpr(structs.CommonTableExpr* data, offset_to_index): * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_ctematerialized = getattr(enums, 'CTEMaterialize')(data.ctematerialized) * cdef object v_ctequery = create(data.ctequery, offset_to_index) if data.ctequery is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->aliascolnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 529, __pyx_L1_error) __pyx_v_v_aliascolnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":530 * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) * cdef object v_ctematerialized = getattr(enums, 'CTEMaterialize')(data.ctematerialized) # <<<<<<<<<<<<<< * cdef object v_ctequery = create(data.ctequery, offset_to_index) if data.ctequery is not NULL else None * cdef object v_search_clause = create(data.search_clause, offset_to_index) if data.search_clause is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_CTEMaterialize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_CTEMaterialize(__pyx_v_data->ctematerialized); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_ctematerialized = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":531 * cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) * cdef object v_ctematerialized = getattr(enums, 'CTEMaterialize')(data.ctematerialized) * cdef object v_ctequery = create(data.ctequery, offset_to_index) if data.ctequery is not NULL else None # <<<<<<<<<<<<<< * cdef object v_search_clause = create(data.search_clause, offset_to_index) if data.search_clause is not NULL else None * cdef object v_cycle_clause = create(data.cycle_clause, offset_to_index) if data.cycle_clause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->ctequery != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_f_6pglast_6parser_create(__pyx_v_data->ctequery, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_ctequery = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":532 * cdef object v_ctematerialized = getattr(enums, 'CTEMaterialize')(data.ctematerialized) * cdef object v_ctequery = create(data.ctequery, offset_to_index) if data.ctequery is not NULL else None * cdef object v_search_clause = create(data.search_clause, offset_to_index) if data.search_clause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cycle_clause = create(data.cycle_clause, offset_to_index) if data.cycle_clause is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->search_clause != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_f_6pglast_6parser_create(__pyx_v_data->search_clause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_search_clause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":533 * cdef object v_ctequery = create(data.ctequery, offset_to_index) if data.ctequery is not NULL else None * cdef object v_search_clause = create(data.search_clause, offset_to_index) if data.search_clause is not NULL else None * cdef object v_cycle_clause = create(data.cycle_clause, offset_to_index) if data.cycle_clause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * cdef object v_cterecursive = bool(data.cterecursive) */ __pyx_t_2 = (__pyx_v_data->cycle_clause != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_f_6pglast_6parser_create(__pyx_v_data->cycle_clause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cycle_clause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":534 * cdef object v_search_clause = create(data.search_clause, offset_to_index) if data.search_clause is not NULL else None * cdef object v_cycle_clause = create(data.cycle_clause, offset_to_index) if data.cycle_clause is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * cdef object v_cterecursive = bool(data.cterecursive) * cdef object v_cterefcount = data.cterefcount */ __pyx_t_6 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_5 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":535 * cdef object v_cycle_clause = create(data.cycle_clause, offset_to_index) if data.cycle_clause is not NULL else None * cdef object v_location = offset_to_index(data.location) * cdef object v_cterecursive = bool(data.cterecursive) # <<<<<<<<<<<<<< * cdef object v_cterefcount = data.cterefcount * cdef tuple v_ctecolnames = _pg_list_to_tuple(data.ctecolnames, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->cterecursive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_cterecursive = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":536 * cdef object v_location = offset_to_index(data.location) * cdef object v_cterecursive = bool(data.cterecursive) * cdef object v_cterefcount = data.cterefcount # <<<<<<<<<<<<<< * cdef tuple v_ctecolnames = _pg_list_to_tuple(data.ctecolnames, offset_to_index) * cdef tuple v_ctecoltypes = _pg_list_to_tuple(data.ctecoltypes, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->cterefcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_cterefcount = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":537 * cdef object v_cterecursive = bool(data.cterecursive) * cdef object v_cterefcount = data.cterefcount * cdef tuple v_ctecolnames = _pg_list_to_tuple(data.ctecolnames, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_ctecoltypes = _pg_list_to_tuple(data.ctecoltypes, offset_to_index) * cdef tuple v_ctecoltypmods = _pg_list_to_tuple(data.ctecoltypmods, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ctecolnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 537, __pyx_L1_error) __pyx_v_v_ctecolnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":538 * cdef object v_cterefcount = data.cterefcount * cdef tuple v_ctecolnames = _pg_list_to_tuple(data.ctecolnames, offset_to_index) * cdef tuple v_ctecoltypes = _pg_list_to_tuple(data.ctecoltypes, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_ctecoltypmods = _pg_list_to_tuple(data.ctecoltypmods, offset_to_index) * cdef tuple v_ctecolcollations = _pg_list_to_tuple(data.ctecolcollations, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ctecoltypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 538, __pyx_L1_error) __pyx_v_v_ctecoltypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":539 * cdef tuple v_ctecolnames = _pg_list_to_tuple(data.ctecolnames, offset_to_index) * cdef tuple v_ctecoltypes = _pg_list_to_tuple(data.ctecoltypes, offset_to_index) * cdef tuple v_ctecoltypmods = _pg_list_to_tuple(data.ctecoltypmods, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_ctecolcollations = _pg_list_to_tuple(data.ctecolcollations, offset_to_index) * return ast.CommonTableExpr(v_ctename, v_aliascolnames, v_ctematerialized, v_ctequery, v_search_clause, v_cycle_clause, v_location, v_cterecursive, v_cterefcount, v_ctecolnames, v_ctecoltypes, v_ctecoltypmods, v_ctecolcollations) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ctecoltypmods, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 539, __pyx_L1_error) __pyx_v_v_ctecoltypmods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":540 * cdef tuple v_ctecoltypes = _pg_list_to_tuple(data.ctecoltypes, offset_to_index) * cdef tuple v_ctecoltypmods = _pg_list_to_tuple(data.ctecoltypmods, offset_to_index) * cdef tuple v_ctecolcollations = _pg_list_to_tuple(data.ctecolcollations, offset_to_index) # <<<<<<<<<<<<<< * return ast.CommonTableExpr(v_ctename, v_aliascolnames, v_ctematerialized, v_ctequery, v_search_clause, v_cycle_clause, v_location, v_cterecursive, v_cterefcount, v_ctecolnames, v_ctecoltypes, v_ctecoltypmods, v_ctecolcollations) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ctecolcollations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 540, __pyx_L1_error) __pyx_v_v_ctecolcollations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":541 * cdef tuple v_ctecoltypmods = _pg_list_to_tuple(data.ctecoltypmods, offset_to_index) * cdef tuple v_ctecolcollations = _pg_list_to_tuple(data.ctecolcollations, offset_to_index) * return ast.CommonTableExpr(v_ctename, v_aliascolnames, v_ctematerialized, v_ctequery, v_search_clause, v_cycle_clause, v_location, v_cterecursive, v_cterefcount, v_ctecolnames, v_ctecoltypes, v_ctecoltypmods, v_ctecolcollations) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CommonTableExpr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[14] = {__pyx_t_5, __pyx_v_v_ctename, __pyx_v_v_aliascolnames, __pyx_v_v_ctematerialized, __pyx_v_v_ctequery, __pyx_v_v_search_clause, __pyx_v_v_cycle_clause, __pyx_v_v_location, __pyx_v_v_cterecursive, __pyx_v_v_cterefcount, __pyx_v_v_ctecolnames, __pyx_v_v_ctecoltypes, __pyx_v_v_ctecoltypmods, __pyx_v_v_ctecolcollations}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 13+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":527 * * * cdef create_CommonTableExpr(structs.CommonTableExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_ctename = data.ctename.decode("utf-8") if data.ctename is not NULL else None * cdef tuple v_aliascolnames = _pg_list_to_tuple(data.aliascolnames, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CommonTableExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_ctename); __Pyx_XDECREF(__pyx_v_v_aliascolnames); __Pyx_XDECREF(__pyx_v_v_ctematerialized); __Pyx_XDECREF(__pyx_v_v_ctequery); __Pyx_XDECREF(__pyx_v_v_search_clause); __Pyx_XDECREF(__pyx_v_v_cycle_clause); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XDECREF(__pyx_v_v_cterecursive); __Pyx_XDECREF(__pyx_v_v_cterefcount); __Pyx_XDECREF(__pyx_v_v_ctecolnames); __Pyx_XDECREF(__pyx_v_v_ctecoltypes); __Pyx_XDECREF(__pyx_v_v_ctecoltypmods); __Pyx_XDECREF(__pyx_v_v_ctecolcollations); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":544 * * * cdef create_MergeWhenClause(structs.MergeWhenClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) */ static PyObject *__pyx_f_6pglast_6parser_create_MergeWhenClause(MergeWhenClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_matchKind = 0; PyObject *__pyx_v_v_commandType = 0; PyObject *__pyx_v_v_override = 0; PyObject *__pyx_v_v_condition = 0; PyObject *__pyx_v_v_targetList = 0; PyObject *__pyx_v_v_values = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_MergeWhenClause", 1); /* "pglast/ast.pyx":545 * * cdef create_MergeWhenClause(structs.MergeWhenClause* data, offset_to_index): * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) # <<<<<<<<<<<<<< * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_MergeMatchKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_MergeMatchKind(__pyx_v_data->matchKind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_matchKind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":546 * cdef create_MergeWhenClause(structs.MergeWhenClause* data, offset_to_index): * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) # <<<<<<<<<<<<<< * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_condition = create(data.condition, offset_to_index) if data.condition is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CmdType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CmdType(__pyx_v_data->commandType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_commandType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":547 * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) # <<<<<<<<<<<<<< * cdef object v_condition = create(data.condition, offset_to_index) if data.condition is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_OverridingKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_OverridingKind(__pyx_v_data->override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_override = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":548 * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_condition = create(data.condition, offset_to_index) if data.condition is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_values = _pg_list_to_tuple(data.values, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->condition != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->condition, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_condition = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":549 * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_condition = create(data.condition, offset_to_index) if data.condition is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_values = _pg_list_to_tuple(data.values, offset_to_index) * return ast.MergeWhenClause(v_matchKind, v_commandType, v_override, v_condition, v_targetList, v_values) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->targetList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 549, __pyx_L1_error) __pyx_v_v_targetList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":550 * cdef object v_condition = create(data.condition, offset_to_index) if data.condition is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_values = _pg_list_to_tuple(data.values, offset_to_index) # <<<<<<<<<<<<<< * return ast.MergeWhenClause(v_matchKind, v_commandType, v_override, v_condition, v_targetList, v_values) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->values, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 550, __pyx_L1_error) __pyx_v_v_values = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":551 * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_values = _pg_list_to_tuple(data.values, offset_to_index) * return ast.MergeWhenClause(v_matchKind, v_commandType, v_override, v_condition, v_targetList, v_values) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MergeWhenClause); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_matchKind, __pyx_v_v_commandType, __pyx_v_v_override, __pyx_v_v_condition, __pyx_v_v_targetList, __pyx_v_v_values}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":544 * * * cdef create_MergeWhenClause(structs.MergeWhenClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_MergeWhenClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_matchKind); __Pyx_XDECREF(__pyx_v_v_commandType); __Pyx_XDECREF(__pyx_v_v_override); __Pyx_XDECREF(__pyx_v_v_condition); __Pyx_XDECREF(__pyx_v_v_targetList); __Pyx_XDECREF(__pyx_v_v_values); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":554 * * * cdef create_TriggerTransition(structs.TriggerTransition* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isNew = bool(data.isNew) */ static PyObject *__pyx_f_6pglast_6parser_create_TriggerTransition(TriggerTransition *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_isNew = 0; PyObject *__pyx_v_v_isTable = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TriggerTransition", 1); /* "pglast/ast.pyx":555 * * cdef create_TriggerTransition(structs.TriggerTransition* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_isNew = bool(data.isNew) * cdef object v_isTable = bool(data.isTable) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 555, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":556 * cdef create_TriggerTransition(structs.TriggerTransition* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isNew = bool(data.isNew) # <<<<<<<<<<<<<< * cdef object v_isTable = bool(data.isTable) * return ast.TriggerTransition(v_name, v_isNew, v_isTable) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isNew); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isNew = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":557 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isNew = bool(data.isNew) * cdef object v_isTable = bool(data.isTable) # <<<<<<<<<<<<<< * return ast.TriggerTransition(v_name, v_isNew, v_isTable) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isTable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":558 * cdef object v_isNew = bool(data.isNew) * cdef object v_isTable = bool(data.isTable) * return ast.TriggerTransition(v_name, v_isNew, v_isTable) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_TriggerTransition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_name, __pyx_v_v_isNew, __pyx_v_v_isTable}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":554 * * * cdef create_TriggerTransition(structs.TriggerTransition* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isNew = bool(data.isNew) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_TriggerTransition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_isNew); __Pyx_XDECREF(__pyx_v_v_isTable); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":561 * * * cdef create_JsonOutput(structs.JsonOutput* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonOutput(JsonOutput *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_returning = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonOutput", 1); /* "pglast/ast.pyx":562 * * cdef create_JsonOutput(structs.JsonOutput* data, offset_to_index): * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * return ast.JsonOutput(v_typeName, v_returning) */ __pyx_t_2 = (__pyx_v_data->typeName != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":563 * cdef create_JsonOutput(structs.JsonOutput* data, offset_to_index): * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None # <<<<<<<<<<<<<< * return ast.JsonOutput(v_typeName, v_returning) * */ __pyx_t_2 = (__pyx_v_data->returning != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->returning, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_returning = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":564 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * return ast.JsonOutput(v_typeName, v_returning) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonOutput); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_typeName, __pyx_v_v_returning}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":561 * * * cdef create_JsonOutput(structs.JsonOutput* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_returning); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":567 * * * cdef create_JsonArgument(structs.JsonArgument* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonArgument(JsonArgument *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_val = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonArgument", 1); /* "pglast/ast.pyx":568 * * cdef create_JsonArgument(structs.JsonArgument* data, offset_to_index): * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.JsonArgument(v_val, v_name) */ __pyx_t_2 = (__pyx_v_data->val != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->val, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":569 * cdef create_JsonArgument(structs.JsonArgument* data, offset_to_index): * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * return ast.JsonArgument(v_val, v_name) * */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 569, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":570 * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.JsonArgument(v_val, v_name) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_val, __pyx_v_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":567 * * * cdef create_JsonArgument(structs.JsonArgument* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_JsonArgument", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_val); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":573 * * * cdef create_JsonFuncExpr(structs.JsonFuncExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonFuncExpr(JsonFuncExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_column_name = 0; PyObject *__pyx_v_v_context_item = 0; PyObject *__pyx_v_v_pathspec = 0; PyObject *__pyx_v_v_passing = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_on_empty = 0; PyObject *__pyx_v_v_on_error = 0; PyObject *__pyx_v_v_wrapper = 0; PyObject *__pyx_v_v_quotes = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonFuncExpr", 1); /* "pglast/ast.pyx":574 * * cdef create_JsonFuncExpr(structs.JsonFuncExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) # <<<<<<<<<<<<<< * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonExprOp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonExprOp(__pyx_v_data->op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":575 * cdef create_JsonFuncExpr(structs.JsonFuncExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None */ __pyx_t_6 = (__pyx_v_data->column_name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->column_name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 575, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_column_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":576 * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None # <<<<<<<<<<<<<< * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->context_item != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->context_item, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_context_item = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":577 * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ __pyx_t_6 = (__pyx_v_data->pathspec != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->pathspec, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_pathspec = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":578 * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->passing, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 578, __pyx_L1_error) __pyx_v_v_passing = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":579 * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None */ __pyx_t_6 = (__pyx_v_data->output != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":580 * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None # <<<<<<<<<<<<<< * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) */ __pyx_t_6 = (__pyx_v_data->on_empty != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_empty, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_empty = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":581 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None # <<<<<<<<<<<<<< * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) */ __pyx_t_6 = (__pyx_v_data->on_error != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_error, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_error = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":582 * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) # <<<<<<<<<<<<<< * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_JsonWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_JsonWrapper(__pyx_v_data->wrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_wrapper = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":583 * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonFuncExpr(v_op, v_column_name, v_context_item, v_pathspec, v_passing, v_output, v_on_empty, v_on_error, v_wrapper, v_quotes, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonQuotes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonQuotes(__pyx_v_data->quotes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_quotes = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":584 * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonFuncExpr(v_op, v_column_name, v_context_item, v_pathspec, v_passing, v_output, v_on_empty, v_on_error, v_wrapper, v_quotes, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":585 * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) * cdef object v_location = offset_to_index(data.location) * return ast.JsonFuncExpr(v_op, v_column_name, v_context_item, v_pathspec, v_passing, v_output, v_on_empty, v_on_error, v_wrapper, v_quotes, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_JsonFuncExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[12] = {__pyx_t_2, __pyx_v_v_op, __pyx_v_v_column_name, __pyx_v_v_context_item, __pyx_v_v_pathspec, __pyx_v_v_passing, __pyx_v_v_output, __pyx_v_v_on_empty, __pyx_v_v_on_error, __pyx_v_v_wrapper, __pyx_v_v_quotes, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 11+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":573 * * * cdef create_JsonFuncExpr(structs.JsonFuncExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonFuncExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_column_name); __Pyx_XDECREF(__pyx_v_v_context_item); __Pyx_XDECREF(__pyx_v_v_pathspec); __Pyx_XDECREF(__pyx_v_v_passing); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_on_empty); __Pyx_XDECREF(__pyx_v_v_on_error); __Pyx_XDECREF(__pyx_v_v_wrapper); __Pyx_XDECREF(__pyx_v_v_quotes); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":588 * * * cdef create_JsonTablePathSpec(structs.JsonTablePathSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_string = create(data.string, offset_to_index) if data.string is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonTablePathSpec(JsonTablePathSpec *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_string = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_name_location = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonTablePathSpec", 1); /* "pglast/ast.pyx":589 * * cdef create_JsonTablePathSpec(structs.JsonTablePathSpec* data, offset_to_index): * cdef object v_string = create(data.string, offset_to_index) if data.string is not NULL else None # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_name_location = offset_to_index(data.name_location) */ __pyx_t_2 = (__pyx_v_data->string != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->string, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_string = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":590 * cdef create_JsonTablePathSpec(structs.JsonTablePathSpec* data, offset_to_index): * cdef object v_string = create(data.string, offset_to_index) if data.string is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_name_location = offset_to_index(data.name_location) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 590, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":591 * cdef object v_string = create(data.string, offset_to_index) if data.string is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_name_location = offset_to_index(data.name_location) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonTablePathSpec(v_string, v_name, v_name_location, v_location) */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->name_location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_name_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":592 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_name_location = offset_to_index(data.name_location) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonTablePathSpec(v_string, v_name, v_name_location, v_location) * */ __pyx_t_6 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":593 * cdef object v_name_location = offset_to_index(data.name_location) * cdef object v_location = offset_to_index(data.location) * return ast.JsonTablePathSpec(v_string, v_name, v_name_location, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonTablePathSpec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_string, __pyx_v_v_name, __pyx_v_v_name_location, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":588 * * * cdef create_JsonTablePathSpec(structs.JsonTablePathSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_string = create(data.string, offset_to_index) if data.string is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_JsonTablePathSpec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_string); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_name_location); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":596 * * * cdef create_JsonTable(structs.JsonTable* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonTable(JsonTable *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_context_item = 0; PyObject *__pyx_v_v_pathspec = 0; PyObject *__pyx_v_v_passing = 0; PyObject *__pyx_v_v_columns = 0; PyObject *__pyx_v_v_on_error = 0; PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_v_v_lateral = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonTable", 1); /* "pglast/ast.pyx":597 * * cdef create_JsonTable(structs.JsonTable* data, offset_to_index): * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None # <<<<<<<<<<<<<< * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->context_item != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->context_item, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_context_item = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":598 * cdef create_JsonTable(structs.JsonTable* data, offset_to_index): * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->pathspec != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->pathspec, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_pathspec = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":599 * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->passing, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 599, __pyx_L1_error) __pyx_v_v_passing = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":600 * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->columns, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 600, __pyx_L1_error) __pyx_v_v_columns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":601 * cdef tuple v_passing = _pg_list_to_tuple(data.passing, offset_to_index) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_lateral = bool(data.lateral) */ __pyx_t_2 = (__pyx_v_data->on_error != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_error, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_error = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":602 * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * cdef object v_lateral = bool(data.lateral) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->alias != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":603 * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_lateral = bool(data.lateral) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonTable(v_context_item, v_pathspec, v_passing, v_columns, v_on_error, v_alias, v_lateral, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->lateral); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_lateral = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":604 * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_lateral = bool(data.lateral) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonTable(v_context_item, v_pathspec, v_passing, v_columns, v_on_error, v_alias, v_lateral, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":605 * cdef object v_lateral = bool(data.lateral) * cdef object v_location = offset_to_index(data.location) * return ast.JsonTable(v_context_item, v_pathspec, v_passing, v_columns, v_on_error, v_alias, v_lateral, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonTable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_4, __pyx_v_v_context_item, __pyx_v_v_pathspec, __pyx_v_v_passing, __pyx_v_v_columns, __pyx_v_v_on_error, __pyx_v_v_alias, __pyx_v_v_lateral, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 8+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":596 * * * cdef create_JsonTable(structs.JsonTable* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_context_item = create(data.context_item, offset_to_index) if data.context_item is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonTable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_context_item); __Pyx_XDECREF(__pyx_v_v_pathspec); __Pyx_XDECREF(__pyx_v_v_passing); __Pyx_XDECREF(__pyx_v_v_columns); __Pyx_XDECREF(__pyx_v_v_on_error); __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XDECREF(__pyx_v_v_lateral); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":608 * * * cdef create_JsonTableColumn(structs.JsonTableColumn* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_coltype = getattr(enums, 'JsonTableColumnType')(data.coltype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonTableColumn(JsonTableColumn *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_coltype = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_pathspec = 0; PyObject *__pyx_v_v_format = 0; PyObject *__pyx_v_v_wrapper = 0; PyObject *__pyx_v_v_quotes = 0; PyObject *__pyx_v_v_columns = 0; PyObject *__pyx_v_v_on_empty = 0; PyObject *__pyx_v_v_on_error = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonTableColumn", 1); /* "pglast/ast.pyx":609 * * cdef create_JsonTableColumn(structs.JsonTableColumn* data, offset_to_index): * cdef object v_coltype = getattr(enums, 'JsonTableColumnType')(data.coltype) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonTableColumnType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonTableColumnType(__pyx_v_data->coltype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_coltype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":610 * cdef create_JsonTableColumn(structs.JsonTableColumn* data, offset_to_index): * cdef object v_coltype = getattr(enums, 'JsonTableColumnType')(data.coltype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None */ __pyx_t_6 = (__pyx_v_data->name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 610, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":611 * cdef object v_coltype = getattr(enums, 'JsonTableColumnType')(data.coltype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None */ __pyx_t_6 = (__pyx_v_data->typeName != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":612 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) */ __pyx_t_6 = (__pyx_v_data->pathspec != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->pathspec, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_pathspec = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":613 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None # <<<<<<<<<<<<<< * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) */ __pyx_t_6 = (__pyx_v_data->format != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->format, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":614 * cdef object v_pathspec = create(data.pathspec, offset_to_index) if data.pathspec is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) # <<<<<<<<<<<<<< * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_JsonWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_JsonWrapper(__pyx_v_data->wrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_wrapper = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":615 * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) # <<<<<<<<<<<<<< * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonQuotes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonQuotes(__pyx_v_data->quotes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_quotes = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":616 * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->columns, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 616, __pyx_L1_error) __pyx_v_v_columns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":617 * cdef object v_quotes = getattr(enums, 'JsonQuotes')(data.quotes) * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None # <<<<<<<<<<<<<< * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->on_empty != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_empty, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_empty = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":618 * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonTableColumn(v_coltype, v_name, v_typeName, v_pathspec, v_format, v_wrapper, v_quotes, v_columns, v_on_empty, v_on_error, v_location) */ __pyx_t_6 = (__pyx_v_data->on_error != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_error, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_error = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":619 * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonTableColumn(v_coltype, v_name, v_typeName, v_pathspec, v_format, v_wrapper, v_quotes, v_columns, v_on_empty, v_on_error, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":620 * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.JsonTableColumn(v_coltype, v_name, v_typeName, v_pathspec, v_format, v_wrapper, v_quotes, v_columns, v_on_empty, v_on_error, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_JsonTableColumn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[12] = {__pyx_t_2, __pyx_v_v_coltype, __pyx_v_v_name, __pyx_v_v_typeName, __pyx_v_v_pathspec, __pyx_v_v_format, __pyx_v_v_wrapper, __pyx_v_v_quotes, __pyx_v_v_columns, __pyx_v_v_on_empty, __pyx_v_v_on_error, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 11+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":608 * * * cdef create_JsonTableColumn(structs.JsonTableColumn* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_coltype = getattr(enums, 'JsonTableColumnType')(data.coltype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonTableColumn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_coltype); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_pathspec); __Pyx_XDECREF(__pyx_v_v_format); __Pyx_XDECREF(__pyx_v_v_wrapper); __Pyx_XDECREF(__pyx_v_v_quotes); __Pyx_XDECREF(__pyx_v_v_columns); __Pyx_XDECREF(__pyx_v_v_on_empty); __Pyx_XDECREF(__pyx_v_v_on_error); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":623 * * * cdef create_JsonKeyValue(structs.JsonKeyValue* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_key = create(data.key, offset_to_index) if data.key is not NULL else None * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonKeyValue(JsonKeyValue *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_key = 0; PyObject *__pyx_v_v_value = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonKeyValue", 1); /* "pglast/ast.pyx":624 * * cdef create_JsonKeyValue(structs.JsonKeyValue* data, offset_to_index): * cdef object v_key = create(data.key, offset_to_index) if data.key is not NULL else None # <<<<<<<<<<<<<< * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None * return ast.JsonKeyValue(v_key, v_value) */ __pyx_t_2 = (__pyx_v_data->key != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->key, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":625 * cdef create_JsonKeyValue(structs.JsonKeyValue* data, offset_to_index): * cdef object v_key = create(data.key, offset_to_index) if data.key is not NULL else None * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None # <<<<<<<<<<<<<< * return ast.JsonKeyValue(v_key, v_value) * */ __pyx_t_2 = (__pyx_v_data->value != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->value, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_value = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":626 * cdef object v_key = create(data.key, offset_to_index) if data.key is not NULL else None * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None * return ast.JsonKeyValue(v_key, v_value) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonKeyValue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_key, __pyx_v_v_value}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":623 * * * cdef create_JsonKeyValue(structs.JsonKeyValue* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_key = create(data.key, offset_to_index) if data.key is not NULL else None * cdef object v_value = create(data.value, offset_to_index) if data.value is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonKeyValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_key); __Pyx_XDECREF(__pyx_v_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":629 * * * cdef create_JsonParseExpr(structs.JsonParseExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonParseExpr(JsonParseExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_unique_keys = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonParseExpr", 1); /* "pglast/ast.pyx":630 * * cdef create_JsonParseExpr(structs.JsonParseExpr* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_unique_keys = bool(data.unique_keys) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":631 * cdef create_JsonParseExpr(structs.JsonParseExpr* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_unique_keys = bool(data.unique_keys) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":632 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_unique_keys = bool(data.unique_keys) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonParseExpr(v_expr, v_output, v_unique_keys, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unique_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unique_keys = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":633 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_unique_keys = bool(data.unique_keys) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonParseExpr(v_expr, v_output, v_unique_keys, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":634 * cdef object v_unique_keys = bool(data.unique_keys) * cdef object v_location = offset_to_index(data.location) * return ast.JsonParseExpr(v_expr, v_output, v_unique_keys, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonParseExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_v_expr, __pyx_v_v_output, __pyx_v_v_unique_keys, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":629 * * * cdef create_JsonParseExpr(structs.JsonParseExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonParseExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_unique_keys); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":637 * * * cdef create_JsonScalarExpr(structs.JsonScalarExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonScalarExpr(JsonScalarExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonScalarExpr", 1); /* "pglast/ast.pyx":638 * * cdef create_JsonScalarExpr(structs.JsonScalarExpr* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":639 * cdef create_JsonScalarExpr(structs.JsonScalarExpr* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonScalarExpr(v_expr, v_output, v_location) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":640 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonScalarExpr(v_expr, v_output, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":641 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.JsonScalarExpr(v_expr, v_output, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonScalarExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_expr, __pyx_v_v_output, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":637 * * * cdef create_JsonScalarExpr(structs.JsonScalarExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonScalarExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":644 * * * cdef create_JsonSerializeExpr(structs.JsonSerializeExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonSerializeExpr(JsonSerializeExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonSerializeExpr", 1); /* "pglast/ast.pyx":645 * * cdef create_JsonSerializeExpr(structs.JsonSerializeExpr* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":646 * cdef create_JsonSerializeExpr(structs.JsonSerializeExpr* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonSerializeExpr(v_expr, v_output, v_location) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":647 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonSerializeExpr(v_expr, v_output, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":648 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.JsonSerializeExpr(v_expr, v_output, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonSerializeExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_expr, __pyx_v_v_output, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":644 * * * cdef create_JsonSerializeExpr(structs.JsonSerializeExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonSerializeExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":651 * * * cdef create_JsonObjectConstructor(structs.JsonObjectConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonObjectConstructor(JsonObjectConstructor *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_exprs = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_absent_on_null = 0; PyObject *__pyx_v_v_unique = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonObjectConstructor", 1); /* "pglast/ast.pyx":652 * * cdef create_JsonObjectConstructor(structs.JsonObjectConstructor* data, offset_to_index): * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->exprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 652, __pyx_L1_error) __pyx_v_v_exprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":653 * cdef create_JsonObjectConstructor(structs.JsonObjectConstructor* data, offset_to_index): * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":654 * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) # <<<<<<<<<<<<<< * cdef object v_unique = bool(data.unique) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->absent_on_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_absent_on_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":655 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonObjectConstructor(v_exprs, v_output, v_absent_on_null, v_unique, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unique = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":656 * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonObjectConstructor(v_exprs, v_output, v_absent_on_null, v_unique, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":657 * cdef object v_unique = bool(data.unique) * cdef object v_location = offset_to_index(data.location) * return ast.JsonObjectConstructor(v_exprs, v_output, v_absent_on_null, v_unique, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonObjectConstructor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_exprs, __pyx_v_v_output, __pyx_v_v_absent_on_null, __pyx_v_v_unique, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":651 * * * cdef create_JsonObjectConstructor(structs.JsonObjectConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonObjectConstructor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_exprs); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_absent_on_null); __Pyx_XDECREF(__pyx_v_v_unique); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":660 * * * cdef create_JsonArrayConstructor(structs.JsonArrayConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonArrayConstructor(JsonArrayConstructor *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_exprs = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_absent_on_null = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonArrayConstructor", 1); /* "pglast/ast.pyx":661 * * cdef create_JsonArrayConstructor(structs.JsonArrayConstructor* data, offset_to_index): * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->exprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 661, __pyx_L1_error) __pyx_v_v_exprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":662 * cdef create_JsonArrayConstructor(structs.JsonArrayConstructor* data, offset_to_index): * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":663 * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonArrayConstructor(v_exprs, v_output, v_absent_on_null, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->absent_on_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_absent_on_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":664 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonArrayConstructor(v_exprs, v_output, v_absent_on_null, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":665 * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_location = offset_to_index(data.location) * return ast.JsonArrayConstructor(v_exprs, v_output, v_absent_on_null, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonArrayConstructor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_v_exprs, __pyx_v_v_output, __pyx_v_v_absent_on_null, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":660 * * * cdef create_JsonArrayConstructor(structs.JsonArrayConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonArrayConstructor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_exprs); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_absent_on_null); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":668 * * * cdef create_JsonArrayQueryConstructor(structs.JsonArrayQueryConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonArrayQueryConstructor(JsonArrayQueryConstructor *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_query = 0; PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_format = 0; PyObject *__pyx_v_v_absent_on_null = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonArrayQueryConstructor", 1); /* "pglast/ast.pyx":669 * * cdef create_JsonArrayQueryConstructor(structs.JsonArrayQueryConstructor* data, offset_to_index): * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":670 * cdef create_JsonArrayQueryConstructor(structs.JsonArrayQueryConstructor* data, offset_to_index): * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":671 * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None # <<<<<<<<<<<<<< * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->format != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->format, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":672 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonArrayQueryConstructor(v_query, v_output, v_format, v_absent_on_null, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->absent_on_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_absent_on_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":673 * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonArrayQueryConstructor(v_query, v_output, v_format, v_absent_on_null, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":674 * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_location = offset_to_index(data.location) * return ast.JsonArrayQueryConstructor(v_query, v_output, v_format, v_absent_on_null, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonArrayQueryConstructor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_query, __pyx_v_v_output, __pyx_v_v_format, __pyx_v_v_absent_on_null, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":668 * * * cdef create_JsonArrayQueryConstructor(structs.JsonArrayQueryConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonArrayQueryConstructor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_format); __Pyx_XDECREF(__pyx_v_v_absent_on_null); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":677 * * * cdef create_JsonAggConstructor(structs.JsonAggConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonAggConstructor(JsonAggConstructor *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_output = 0; PyObject *__pyx_v_v_agg_filter = 0; PyObject *__pyx_v_v_agg_order = 0; PyObject *__pyx_v_v_over = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonAggConstructor", 1); /* "pglast/ast.pyx":678 * * cdef create_JsonAggConstructor(structs.JsonAggConstructor* data, offset_to_index): * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None # <<<<<<<<<<<<<< * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->output != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->output, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_output = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":679 * cdef create_JsonAggConstructor(structs.JsonAggConstructor* data, offset_to_index): * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None */ __pyx_t_2 = (__pyx_v_data->agg_filter != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->agg_filter, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_agg_filter = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":680 * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->agg_order, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 680, __pyx_L1_error) __pyx_v_v_agg_order = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":681 * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonAggConstructor(v_output, v_agg_filter, v_agg_order, v_over, v_location) */ __pyx_t_2 = (__pyx_v_data->over != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->over, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_over = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":682 * cdef tuple v_agg_order = _pg_list_to_tuple(data.agg_order, offset_to_index) * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonAggConstructor(v_output, v_agg_filter, v_agg_order, v_over, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":683 * cdef object v_over = create(data.over, offset_to_index) if data.over is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.JsonAggConstructor(v_output, v_agg_filter, v_agg_order, v_over, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JsonAggConstructor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_output, __pyx_v_v_agg_filter, __pyx_v_v_agg_order, __pyx_v_v_over, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":677 * * * cdef create_JsonAggConstructor(structs.JsonAggConstructor* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_output = create(data.output, offset_to_index) if data.output is not NULL else None * cdef object v_agg_filter = create(data.agg_filter, offset_to_index) if data.agg_filter is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonAggConstructor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_output); __Pyx_XDECREF(__pyx_v_v_agg_filter); __Pyx_XDECREF(__pyx_v_v_agg_order); __Pyx_XDECREF(__pyx_v_v_over); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":686 * * * cdef create_JsonObjectAgg(structs.JsonObjectAgg* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonObjectAgg(JsonObjectAgg *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_constructor = 0; PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_absent_on_null = 0; PyObject *__pyx_v_v_unique = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonObjectAgg", 1); /* "pglast/ast.pyx":687 * * cdef create_JsonObjectAgg(structs.JsonObjectAgg* data, offset_to_index): * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) */ __pyx_t_2 = (__pyx_v_data->constructor != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->constructor, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_constructor = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":688 * cdef create_JsonObjectAgg(structs.JsonObjectAgg* data, offset_to_index): * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":689 * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) # <<<<<<<<<<<<<< * cdef object v_unique = bool(data.unique) * return ast.JsonObjectAgg(v_constructor, v_arg, v_absent_on_null, v_unique) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->absent_on_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_absent_on_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":690 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) # <<<<<<<<<<<<<< * return ast.JsonObjectAgg(v_constructor, v_arg, v_absent_on_null, v_unique) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unique = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":691 * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) * return ast.JsonObjectAgg(v_constructor, v_arg, v_absent_on_null, v_unique) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonObjectAgg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_constructor, __pyx_v_v_arg, __pyx_v_v_absent_on_null, __pyx_v_v_unique}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":686 * * * cdef create_JsonObjectAgg(structs.JsonObjectAgg* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonObjectAgg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_constructor); __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_absent_on_null); __Pyx_XDECREF(__pyx_v_v_unique); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":694 * * * cdef create_JsonArrayAgg(structs.JsonArrayAgg* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonArrayAgg(JsonArrayAgg *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_constructor = 0; PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_absent_on_null = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonArrayAgg", 1); /* "pglast/ast.pyx":695 * * cdef create_JsonArrayAgg(structs.JsonArrayAgg* data, offset_to_index): * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) */ __pyx_t_2 = (__pyx_v_data->constructor != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->constructor, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_constructor = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":696 * cdef create_JsonArrayAgg(structs.JsonArrayAgg* data, offset_to_index): * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_absent_on_null = bool(data.absent_on_null) * return ast.JsonArrayAgg(v_constructor, v_arg, v_absent_on_null) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":697 * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) # <<<<<<<<<<<<<< * return ast.JsonArrayAgg(v_constructor, v_arg, v_absent_on_null) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->absent_on_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_absent_on_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":698 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) * return ast.JsonArrayAgg(v_constructor, v_arg, v_absent_on_null) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonArrayAgg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_constructor, __pyx_v_v_arg, __pyx_v_v_absent_on_null}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":694 * * * cdef create_JsonArrayAgg(structs.JsonArrayAgg* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_constructor = create(data.constructor, offset_to_index) if data.constructor is not NULL else None * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonArrayAgg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_constructor); __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_absent_on_null); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":701 * * * cdef create_RawStmt(structs.RawStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_stmt = create(data.stmt, offset_to_index) if data.stmt is not NULL else None * cdef object v_stmt_location = offset_to_index(data.stmt_location) */ static PyObject *__pyx_f_6pglast_6parser_create_RawStmt(RawStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_stmt = 0; PyObject *__pyx_v_v_stmt_location = 0; PyObject *__pyx_v_v_stmt_len = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RawStmt", 1); /* "pglast/ast.pyx":702 * * cdef create_RawStmt(structs.RawStmt* data, offset_to_index): * cdef object v_stmt = create(data.stmt, offset_to_index) if data.stmt is not NULL else None # <<<<<<<<<<<<<< * cdef object v_stmt_location = offset_to_index(data.stmt_location) * cdef object v_stmt_len = offset_to_index(data.stmt_len) */ __pyx_t_2 = (__pyx_v_data->stmt != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->stmt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_stmt = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":703 * cdef create_RawStmt(structs.RawStmt* data, offset_to_index): * cdef object v_stmt = create(data.stmt, offset_to_index) if data.stmt is not NULL else None * cdef object v_stmt_location = offset_to_index(data.stmt_location) # <<<<<<<<<<<<<< * cdef object v_stmt_len = offset_to_index(data.stmt_len) * return ast.RawStmt(v_stmt, v_stmt_location, v_stmt_len) */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->stmt_location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_stmt_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":704 * cdef object v_stmt = create(data.stmt, offset_to_index) if data.stmt is not NULL else None * cdef object v_stmt_location = offset_to_index(data.stmt_location) * cdef object v_stmt_len = offset_to_index(data.stmt_len) # <<<<<<<<<<<<<< * return ast.RawStmt(v_stmt, v_stmt_location, v_stmt_len) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->stmt_len); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_stmt_len = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":705 * cdef object v_stmt_location = offset_to_index(data.stmt_location) * cdef object v_stmt_len = offset_to_index(data.stmt_len) * return ast.RawStmt(v_stmt, v_stmt_location, v_stmt_len) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RawStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_stmt, __pyx_v_v_stmt_location, __pyx_v_v_stmt_len}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":701 * * * cdef create_RawStmt(structs.RawStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_stmt = create(data.stmt, offset_to_index) if data.stmt is not NULL else None * cdef object v_stmt_location = offset_to_index(data.stmt_location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_RawStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_stmt); __Pyx_XDECREF(__pyx_v_v_stmt_location); __Pyx_XDECREF(__pyx_v_v_stmt_len); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":708 * * * cdef create_InsertStmt(structs.InsertStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_InsertStmt(InsertStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_cols = 0; PyObject *__pyx_v_v_selectStmt = 0; PyObject *__pyx_v_v_onConflictClause = 0; PyObject *__pyx_v_v_returningList = 0; PyObject *__pyx_v_v_withClause = 0; PyObject *__pyx_v_v_override = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_InsertStmt", 1); /* "pglast/ast.pyx":709 * * cdef create_InsertStmt(structs.InsertStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) * cdef object v_selectStmt = create(data.selectStmt, offset_to_index) if data.selectStmt is not NULL else None */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":710 * cdef create_InsertStmt(structs.InsertStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_selectStmt = create(data.selectStmt, offset_to_index) if data.selectStmt is not NULL else None * cdef object v_onConflictClause = create(data.onConflictClause, offset_to_index) if data.onConflictClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->cols, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_v_v_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":711 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) * cdef object v_selectStmt = create(data.selectStmt, offset_to_index) if data.selectStmt is not NULL else None # <<<<<<<<<<<<<< * cdef object v_onConflictClause = create(data.onConflictClause, offset_to_index) if data.onConflictClause is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->selectStmt != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->selectStmt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_selectStmt = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":712 * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) * cdef object v_selectStmt = create(data.selectStmt, offset_to_index) if data.selectStmt is not NULL else None * cdef object v_onConflictClause = create(data.onConflictClause, offset_to_index) if data.onConflictClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->onConflictClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->onConflictClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_onConflictClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":713 * cdef object v_selectStmt = create(data.selectStmt, offset_to_index) if data.selectStmt is not NULL else None * cdef object v_onConflictClause = create(data.onConflictClause, offset_to_index) if data.onConflictClause is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->returningList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 713, __pyx_L1_error) __pyx_v_v_returningList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":714 * cdef object v_onConflictClause = create(data.onConflictClause, offset_to_index) if data.onConflictClause is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * return ast.InsertStmt(v_relation, v_cols, v_selectStmt, v_onConflictClause, v_returningList, v_withClause, v_override) */ __pyx_t_2 = (__pyx_v_data->withClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->withClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_withClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":715 * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) # <<<<<<<<<<<<<< * return ast.InsertStmt(v_relation, v_cols, v_selectStmt, v_onConflictClause, v_returningList, v_withClause, v_override) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_OverridingKind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_OverridingKind(__pyx_v_data->override); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_override = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":716 * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * return ast.InsertStmt(v_relation, v_cols, v_selectStmt, v_onConflictClause, v_returningList, v_withClause, v_override) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InsertStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_v_v_relation, __pyx_v_v_cols, __pyx_v_v_selectStmt, __pyx_v_v_onConflictClause, __pyx_v_v_returningList, __pyx_v_v_withClause, __pyx_v_v_override}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 7+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":708 * * * cdef create_InsertStmt(structs.InsertStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_InsertStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_cols); __Pyx_XDECREF(__pyx_v_v_selectStmt); __Pyx_XDECREF(__pyx_v_v_onConflictClause); __Pyx_XDECREF(__pyx_v_v_returningList); __Pyx_XDECREF(__pyx_v_v_withClause); __Pyx_XDECREF(__pyx_v_v_override); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":719 * * * cdef create_DeleteStmt(structs.DeleteStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_DeleteStmt(DeleteStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_usingClause = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_returningList = 0; PyObject *__pyx_v_v_withClause = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DeleteStmt", 1); /* "pglast/ast.pyx":720 * * cdef create_DeleteStmt(structs.DeleteStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":721 * cdef create_DeleteStmt(structs.DeleteStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->usingClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 721, __pyx_L1_error) __pyx_v_v_usingClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":722 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":723 * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * return ast.DeleteStmt(v_relation, v_usingClause, v_whereClause, v_returningList, v_withClause) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->returningList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 723, __pyx_L1_error) __pyx_v_v_returningList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":724 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None # <<<<<<<<<<<<<< * return ast.DeleteStmt(v_relation, v_usingClause, v_whereClause, v_returningList, v_withClause) * */ __pyx_t_2 = (__pyx_v_data->withClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->withClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_withClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":725 * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * return ast.DeleteStmt(v_relation, v_usingClause, v_whereClause, v_returningList, v_withClause) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DeleteStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_usingClause, __pyx_v_v_whereClause, __pyx_v_v_returningList, __pyx_v_v_withClause}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":719 * * * cdef create_DeleteStmt(structs.DeleteStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_DeleteStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_usingClause); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_returningList); __Pyx_XDECREF(__pyx_v_v_withClause); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":728 * * * cdef create_UpdateStmt(structs.UpdateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_UpdateStmt(UpdateStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_targetList = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_fromClause = 0; PyObject *__pyx_v_v_returningList = 0; PyObject *__pyx_v_v_withClause = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_UpdateStmt", 1); /* "pglast/ast.pyx":729 * * cdef create_UpdateStmt(structs.UpdateStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":730 * cdef create_UpdateStmt(structs.UpdateStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->targetList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 730, __pyx_L1_error) __pyx_v_v_targetList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":731 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":732 * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fromClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 732, __pyx_L1_error) __pyx_v_v_fromClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":733 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * return ast.UpdateStmt(v_relation, v_targetList, v_whereClause, v_fromClause, v_returningList, v_withClause) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->returningList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 733, __pyx_L1_error) __pyx_v_v_returningList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":734 * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None # <<<<<<<<<<<<<< * return ast.UpdateStmt(v_relation, v_targetList, v_whereClause, v_fromClause, v_returningList, v_withClause) * */ __pyx_t_2 = (__pyx_v_data->withClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->withClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_withClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":735 * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * return ast.UpdateStmt(v_relation, v_targetList, v_whereClause, v_fromClause, v_returningList, v_withClause) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UpdateStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_targetList, __pyx_v_v_whereClause, __pyx_v_v_fromClause, __pyx_v_v_returningList, __pyx_v_v_withClause}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":728 * * * cdef create_UpdateStmt(structs.UpdateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_UpdateStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_targetList); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_fromClause); __Pyx_XDECREF(__pyx_v_v_returningList); __Pyx_XDECREF(__pyx_v_v_withClause); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":738 * * * cdef create_MergeStmt(structs.MergeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_MergeStmt(MergeStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_sourceRelation = 0; PyObject *__pyx_v_v_joinCondition = 0; PyObject *__pyx_v_v_mergeWhenClauses = 0; PyObject *__pyx_v_v_returningList = 0; PyObject *__pyx_v_v_withClause = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_MergeStmt", 1); /* "pglast/ast.pyx":739 * * cdef create_MergeStmt(structs.MergeStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None * cdef object v_joinCondition = create(data.joinCondition, offset_to_index) if data.joinCondition is not NULL else None */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":740 * cdef create_MergeStmt(structs.MergeStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_joinCondition = create(data.joinCondition, offset_to_index) if data.joinCondition is not NULL else None * cdef tuple v_mergeWhenClauses = _pg_list_to_tuple(data.mergeWhenClauses, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->sourceRelation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->sourceRelation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_sourceRelation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":741 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None * cdef object v_joinCondition = create(data.joinCondition, offset_to_index) if data.joinCondition is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_mergeWhenClauses = _pg_list_to_tuple(data.mergeWhenClauses, offset_to_index) * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->joinCondition != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->joinCondition, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_joinCondition = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":742 * cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None * cdef object v_joinCondition = create(data.joinCondition, offset_to_index) if data.joinCondition is not NULL else None * cdef tuple v_mergeWhenClauses = _pg_list_to_tuple(data.mergeWhenClauses, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->mergeWhenClauses, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 742, __pyx_L1_error) __pyx_v_v_mergeWhenClauses = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":743 * cdef object v_joinCondition = create(data.joinCondition, offset_to_index) if data.joinCondition is not NULL else None * cdef tuple v_mergeWhenClauses = _pg_list_to_tuple(data.mergeWhenClauses, offset_to_index) * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * return ast.MergeStmt(v_relation, v_sourceRelation, v_joinCondition, v_mergeWhenClauses, v_returningList, v_withClause) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->returningList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 743, __pyx_L1_error) __pyx_v_v_returningList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":744 * cdef tuple v_mergeWhenClauses = _pg_list_to_tuple(data.mergeWhenClauses, offset_to_index) * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None # <<<<<<<<<<<<<< * return ast.MergeStmt(v_relation, v_sourceRelation, v_joinCondition, v_mergeWhenClauses, v_returningList, v_withClause) * */ __pyx_t_2 = (__pyx_v_data->withClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->withClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_withClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":745 * cdef tuple v_returningList = _pg_list_to_tuple(data.returningList, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * return ast.MergeStmt(v_relation, v_sourceRelation, v_joinCondition, v_mergeWhenClauses, v_returningList, v_withClause) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MergeStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_sourceRelation, __pyx_v_v_joinCondition, __pyx_v_v_mergeWhenClauses, __pyx_v_v_returningList, __pyx_v_v_withClause}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":738 * * * cdef create_MergeStmt(structs.MergeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_sourceRelation = create(data.sourceRelation, offset_to_index) if data.sourceRelation is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_MergeStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_sourceRelation); __Pyx_XDECREF(__pyx_v_v_joinCondition); __Pyx_XDECREF(__pyx_v_v_mergeWhenClauses); __Pyx_XDECREF(__pyx_v_v_returningList); __Pyx_XDECREF(__pyx_v_v_withClause); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":748 * * * cdef create_SelectStmt(structs.SelectStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_SelectStmt(SelectStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_distinctClause = 0; PyObject *__pyx_v_v_intoClause = 0; PyObject *__pyx_v_v_targetList = 0; PyObject *__pyx_v_v_fromClause = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_groupClause = 0; PyObject *__pyx_v_v_groupDistinct = 0; PyObject *__pyx_v_v_havingClause = 0; PyObject *__pyx_v_v_windowClause = 0; PyObject *__pyx_v_v_valuesLists = 0; PyObject *__pyx_v_v_sortClause = 0; PyObject *__pyx_v_v_limitOffset = 0; PyObject *__pyx_v_v_limitCount = 0; PyObject *__pyx_v_v_limitOption = 0; PyObject *__pyx_v_v_lockingClause = 0; PyObject *__pyx_v_v_withClause = 0; PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_all = 0; PyObject *__pyx_v_v_larg = 0; PyObject *__pyx_v_v_rarg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SelectStmt", 1); /* "pglast/ast.pyx":749 * * cdef create_SelectStmt(structs.SelectStmt* data, offset_to_index): * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->distinctClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 749, __pyx_L1_error) __pyx_v_v_distinctClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":750 * cdef create_SelectStmt(structs.SelectStmt* data, offset_to_index): * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->intoClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->intoClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_intoClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":751 * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->targetList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 751, __pyx_L1_error) __pyx_v_v_targetList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":752 * cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fromClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 752, __pyx_L1_error) __pyx_v_v_fromClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":753 * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) * cdef object v_groupDistinct = bool(data.groupDistinct) */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":754 * cdef tuple v_fromClause = _pg_list_to_tuple(data.fromClause, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_groupDistinct = bool(data.groupDistinct) * cdef object v_havingClause = create(data.havingClause, offset_to_index) if data.havingClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->groupClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 754, __pyx_L1_error) __pyx_v_v_groupClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":755 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) * cdef object v_groupDistinct = bool(data.groupDistinct) # <<<<<<<<<<<<<< * cdef object v_havingClause = create(data.havingClause, offset_to_index) if data.havingClause is not NULL else None * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->groupDistinct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_groupDistinct = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":756 * cdef tuple v_groupClause = _pg_list_to_tuple(data.groupClause, offset_to_index) * cdef object v_groupDistinct = bool(data.groupDistinct) * cdef object v_havingClause = create(data.havingClause, offset_to_index) if data.havingClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) * cdef tuple v_valuesLists = _pg_list_to_tuple(data.valuesLists, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->havingClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->havingClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_havingClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":757 * cdef object v_groupDistinct = bool(data.groupDistinct) * cdef object v_havingClause = create(data.havingClause, offset_to_index) if data.havingClause is not NULL else None * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_valuesLists = _pg_list_to_tuple(data.valuesLists, offset_to_index) * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->windowClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 757, __pyx_L1_error) __pyx_v_v_windowClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":758 * cdef object v_havingClause = create(data.havingClause, offset_to_index) if data.havingClause is not NULL else None * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) * cdef tuple v_valuesLists = _pg_list_to_tuple(data.valuesLists, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->valuesLists, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 758, __pyx_L1_error) __pyx_v_v_valuesLists = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":759 * cdef tuple v_windowClause = _pg_list_to_tuple(data.windowClause, offset_to_index) * cdef tuple v_valuesLists = _pg_list_to_tuple(data.valuesLists, offset_to_index) * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->sortClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 759, __pyx_L1_error) __pyx_v_v_sortClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":760 * cdef tuple v_valuesLists = _pg_list_to_tuple(data.valuesLists, offset_to_index) * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None # <<<<<<<<<<<<<< * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) */ __pyx_t_2 = (__pyx_v_data->limitOffset != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->limitOffset, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_limitOffset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":761 * cdef tuple v_sortClause = _pg_list_to_tuple(data.sortClause, offset_to_index) * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None # <<<<<<<<<<<<<< * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) * cdef tuple v_lockingClause = _pg_list_to_tuple(data.lockingClause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->limitCount != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->limitCount, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_limitCount = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":762 * cdef object v_limitOffset = create(data.limitOffset, offset_to_index) if data.limitOffset is not NULL else None * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) # <<<<<<<<<<<<<< * cdef tuple v_lockingClause = _pg_list_to_tuple(data.lockingClause, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_LimitOption); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_LimitOption(__pyx_v_data->limitOption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_limitOption = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":763 * cdef object v_limitCount = create(data.limitCount, offset_to_index) if data.limitCount is not NULL else None * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) * cdef tuple v_lockingClause = _pg_list_to_tuple(data.lockingClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * cdef object v_op = getattr(enums, 'SetOperation')(data.op) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->lockingClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 763, __pyx_L1_error) __pyx_v_v_lockingClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":764 * cdef object v_limitOption = getattr(enums, 'LimitOption')(data.limitOption) * cdef tuple v_lockingClause = _pg_list_to_tuple(data.lockingClause, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) */ __pyx_t_2 = (__pyx_v_data->withClause != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_f_6pglast_6parser_create(__pyx_v_data->withClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_withClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":765 * cdef tuple v_lockingClause = _pg_list_to_tuple(data.lockingClause, offset_to_index) * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * cdef object v_op = getattr(enums, 'SetOperation')(data.op) # <<<<<<<<<<<<<< * cdef object v_all = bool(data.all) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_n_u_SetOperation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_SetOperation(__pyx_v_data->op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":766 * cdef object v_withClause = create(data.withClause, offset_to_index) if data.withClause is not NULL else None * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) # <<<<<<<<<<<<<< * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_all = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":767 * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * return ast.SelectStmt(v_distinctClause, v_intoClause, v_targetList, v_fromClause, v_whereClause, v_groupClause, v_groupDistinct, v_havingClause, v_windowClause, v_valuesLists, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_lockingClause, v_withClause, v_op, v_all, v_larg, v_rarg) */ __pyx_t_2 = (__pyx_v_data->larg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->larg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_larg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":768 * cdef object v_all = bool(data.all) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None # <<<<<<<<<<<<<< * return ast.SelectStmt(v_distinctClause, v_intoClause, v_targetList, v_fromClause, v_whereClause, v_groupClause, v_groupDistinct, v_havingClause, v_windowClause, v_valuesLists, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_lockingClause, v_withClause, v_op, v_all, v_larg, v_rarg) * */ __pyx_t_2 = (__pyx_v_data->rarg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rarg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rarg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":769 * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * return ast.SelectStmt(v_distinctClause, v_intoClause, v_targetList, v_fromClause, v_whereClause, v_groupClause, v_groupDistinct, v_havingClause, v_windowClause, v_valuesLists, v_sortClause, v_limitOffset, v_limitCount, v_limitOption, v_lockingClause, v_withClause, v_op, v_all, v_larg, v_rarg) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SelectStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[21] = {__pyx_t_3, __pyx_v_v_distinctClause, __pyx_v_v_intoClause, __pyx_v_v_targetList, __pyx_v_v_fromClause, __pyx_v_v_whereClause, __pyx_v_v_groupClause, __pyx_v_v_groupDistinct, __pyx_v_v_havingClause, __pyx_v_v_windowClause, __pyx_v_v_valuesLists, __pyx_v_v_sortClause, __pyx_v_v_limitOffset, __pyx_v_v_limitCount, __pyx_v_v_limitOption, __pyx_v_v_lockingClause, __pyx_v_v_withClause, __pyx_v_v_op, __pyx_v_v_all, __pyx_v_v_larg, __pyx_v_v_rarg}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 20+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":748 * * * cdef create_SelectStmt(structs.SelectStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_distinctClause = _pg_list_to_tuple(data.distinctClause, offset_to_index) * cdef object v_intoClause = create(data.intoClause, offset_to_index) if data.intoClause is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_SelectStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_distinctClause); __Pyx_XDECREF(__pyx_v_v_intoClause); __Pyx_XDECREF(__pyx_v_v_targetList); __Pyx_XDECREF(__pyx_v_v_fromClause); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_groupClause); __Pyx_XDECREF(__pyx_v_v_groupDistinct); __Pyx_XDECREF(__pyx_v_v_havingClause); __Pyx_XDECREF(__pyx_v_v_windowClause); __Pyx_XDECREF(__pyx_v_v_valuesLists); __Pyx_XDECREF(__pyx_v_v_sortClause); __Pyx_XDECREF(__pyx_v_v_limitOffset); __Pyx_XDECREF(__pyx_v_v_limitCount); __Pyx_XDECREF(__pyx_v_v_limitOption); __Pyx_XDECREF(__pyx_v_v_lockingClause); __Pyx_XDECREF(__pyx_v_v_withClause); __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_all); __Pyx_XDECREF(__pyx_v_v_larg); __Pyx_XDECREF(__pyx_v_v_rarg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":772 * * * cdef create_SetOperationStmt(structs.SetOperationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) */ static PyObject *__pyx_f_6pglast_6parser_create_SetOperationStmt(SetOperationStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_all = 0; PyObject *__pyx_v_v_larg = 0; PyObject *__pyx_v_v_rarg = 0; PyObject *__pyx_v_v_colTypes = 0; PyObject *__pyx_v_v_colTypmods = 0; PyObject *__pyx_v_v_colCollations = 0; PyObject *__pyx_v_v_groupClauses = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SetOperationStmt", 1); /* "pglast/ast.pyx":773 * * cdef create_SetOperationStmt(structs.SetOperationStmt* data, offset_to_index): * cdef object v_op = getattr(enums, 'SetOperation')(data.op) # <<<<<<<<<<<<<< * cdef object v_all = bool(data.all) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_SetOperation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_SetOperation(__pyx_v_data->op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":774 * cdef create_SetOperationStmt(structs.SetOperationStmt* data, offset_to_index): * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) # <<<<<<<<<<<<<< * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->all); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_all = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":775 * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * cdef tuple v_colTypes = _pg_list_to_tuple(data.colTypes, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->larg != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->larg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_larg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":776 * cdef object v_all = bool(data.all) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_colTypes = _pg_list_to_tuple(data.colTypes, offset_to_index) * cdef tuple v_colTypmods = _pg_list_to_tuple(data.colTypmods, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->rarg != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rarg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rarg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":777 * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * cdef tuple v_colTypes = _pg_list_to_tuple(data.colTypes, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_colTypmods = _pg_list_to_tuple(data.colTypmods, offset_to_index) * cdef tuple v_colCollations = _pg_list_to_tuple(data.colCollations, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colTypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 777, __pyx_L1_error) __pyx_v_v_colTypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":778 * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * cdef tuple v_colTypes = _pg_list_to_tuple(data.colTypes, offset_to_index) * cdef tuple v_colTypmods = _pg_list_to_tuple(data.colTypmods, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_colCollations = _pg_list_to_tuple(data.colCollations, offset_to_index) * cdef tuple v_groupClauses = _pg_list_to_tuple(data.groupClauses, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colTypmods, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 778, __pyx_L1_error) __pyx_v_v_colTypmods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":779 * cdef tuple v_colTypes = _pg_list_to_tuple(data.colTypes, offset_to_index) * cdef tuple v_colTypmods = _pg_list_to_tuple(data.colTypmods, offset_to_index) * cdef tuple v_colCollations = _pg_list_to_tuple(data.colCollations, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_groupClauses = _pg_list_to_tuple(data.groupClauses, offset_to_index) * return ast.SetOperationStmt(v_op, v_all, v_larg, v_rarg, v_colTypes, v_colTypmods, v_colCollations, v_groupClauses) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colCollations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 779, __pyx_L1_error) __pyx_v_v_colCollations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":780 * cdef tuple v_colTypmods = _pg_list_to_tuple(data.colTypmods, offset_to_index) * cdef tuple v_colCollations = _pg_list_to_tuple(data.colCollations, offset_to_index) * cdef tuple v_groupClauses = _pg_list_to_tuple(data.groupClauses, offset_to_index) # <<<<<<<<<<<<<< * return ast.SetOperationStmt(v_op, v_all, v_larg, v_rarg, v_colTypes, v_colTypmods, v_colCollations, v_groupClauses) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->groupClauses, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 780, __pyx_L1_error) __pyx_v_v_groupClauses = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":781 * cdef tuple v_colCollations = _pg_list_to_tuple(data.colCollations, offset_to_index) * cdef tuple v_groupClauses = _pg_list_to_tuple(data.groupClauses, offset_to_index) * return ast.SetOperationStmt(v_op, v_all, v_larg, v_rarg, v_colTypes, v_colTypmods, v_colCollations, v_groupClauses) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SetOperationStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_3, __pyx_v_v_op, __pyx_v_v_all, __pyx_v_v_larg, __pyx_v_v_rarg, __pyx_v_v_colTypes, __pyx_v_v_colTypmods, __pyx_v_v_colCollations, __pyx_v_v_groupClauses}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 8+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":772 * * * cdef create_SetOperationStmt(structs.SetOperationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'SetOperation')(data.op) * cdef object v_all = bool(data.all) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SetOperationStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_all); __Pyx_XDECREF(__pyx_v_v_larg); __Pyx_XDECREF(__pyx_v_v_rarg); __Pyx_XDECREF(__pyx_v_v_colTypes); __Pyx_XDECREF(__pyx_v_v_colTypmods); __Pyx_XDECREF(__pyx_v_v_colCollations); __Pyx_XDECREF(__pyx_v_v_groupClauses); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":784 * * * cdef create_ReturnStmt(structs.ReturnStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_returnval = create(data.returnval, offset_to_index) if data.returnval is not NULL else None * return ast.ReturnStmt(v_returnval) */ static PyObject *__pyx_f_6pglast_6parser_create_ReturnStmt(ReturnStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_returnval = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ReturnStmt", 1); /* "pglast/ast.pyx":785 * * cdef create_ReturnStmt(structs.ReturnStmt* data, offset_to_index): * cdef object v_returnval = create(data.returnval, offset_to_index) if data.returnval is not NULL else None # <<<<<<<<<<<<<< * return ast.ReturnStmt(v_returnval) * */ __pyx_t_2 = (__pyx_v_data->returnval != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->returnval, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_returnval = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":786 * cdef create_ReturnStmt(structs.ReturnStmt* data, offset_to_index): * cdef object v_returnval = create(data.returnval, offset_to_index) if data.returnval is not NULL else None * return ast.ReturnStmt(v_returnval) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ReturnStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_returnval}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":784 * * * cdef create_ReturnStmt(structs.ReturnStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_returnval = create(data.returnval, offset_to_index) if data.returnval is not NULL else None * return ast.ReturnStmt(v_returnval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ReturnStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_returnval); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":789 * * * cdef create_PLAssignStmt(structs.PLAssignStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_PLAssignStmt(PLAssignStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_indirection = 0; PyObject *__pyx_v_v_nnames = 0; PyObject *__pyx_v_v_val = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PLAssignStmt", 1); /* "pglast/ast.pyx":790 * * cdef create_PLAssignStmt(structs.PLAssignStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * cdef object v_nnames = data.nnames */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 790, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":791 * cdef create_PLAssignStmt(structs.PLAssignStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_nnames = data.nnames * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->indirection, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 791, __pyx_L1_error) __pyx_v_v_indirection = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":792 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * cdef object v_nnames = data.nnames # <<<<<<<<<<<<<< * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->nnames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_nnames = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":793 * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) * cdef object v_nnames = data.nnames * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.PLAssignStmt(v_name, v_indirection, v_nnames, v_val, v_location) */ __pyx_t_2 = (__pyx_v_data->val != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->val, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":794 * cdef object v_nnames = data.nnames * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.PLAssignStmt(v_name, v_indirection, v_nnames, v_val, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":795 * cdef object v_val = create(data.val, offset_to_index) if data.val is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.PLAssignStmt(v_name, v_indirection, v_nnames, v_val, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_PLAssignStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_6, __pyx_v_v_name, __pyx_v_v_indirection, __pyx_v_v_nnames, __pyx_v_v_val, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":789 * * * cdef create_PLAssignStmt(structs.PLAssignStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_indirection = _pg_list_to_tuple(data.indirection, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_PLAssignStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_indirection); __Pyx_XDECREF(__pyx_v_v_nnames); __Pyx_XDECREF(__pyx_v_v_val); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":798 * * * cdef create_CreateSchemaStmt(structs.CreateSchemaStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateSchemaStmt(CreateSchemaStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_schemaname = 0; PyObject *__pyx_v_v_authrole = 0; PyObject *__pyx_v_v_schemaElts = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateSchemaStmt", 1); /* "pglast/ast.pyx":799 * * cdef create_CreateSchemaStmt(structs.CreateSchemaStmt* data, offset_to_index): * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None * cdef tuple v_schemaElts = _pg_list_to_tuple(data.schemaElts, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->schemaname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->schemaname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 799, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_schemaname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":800 * cdef create_CreateSchemaStmt(structs.CreateSchemaStmt* data, offset_to_index): * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_schemaElts = _pg_list_to_tuple(data.schemaElts, offset_to_index) * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_2 = (__pyx_v_data->authrole != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->authrole, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_authrole = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":801 * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None * cdef tuple v_schemaElts = _pg_list_to_tuple(data.schemaElts, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateSchemaStmt(v_schemaname, v_authrole, v_schemaElts, v_if_not_exists) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->schemaElts, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 801, __pyx_L1_error) __pyx_v_v_schemaElts = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":802 * cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None * cdef tuple v_schemaElts = _pg_list_to_tuple(data.schemaElts, offset_to_index) * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * return ast.CreateSchemaStmt(v_schemaname, v_authrole, v_schemaElts, v_if_not_exists) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":803 * cdef tuple v_schemaElts = _pg_list_to_tuple(data.schemaElts, offset_to_index) * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateSchemaStmt(v_schemaname, v_authrole, v_schemaElts, v_if_not_exists) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateSchemaStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_schemaname, __pyx_v_v_authrole, __pyx_v_v_schemaElts, __pyx_v_v_if_not_exists}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":798 * * * cdef create_CreateSchemaStmt(structs.CreateSchemaStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_authrole = create(data.authrole, offset_to_index) if data.authrole is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateSchemaStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_schemaname); __Pyx_XDECREF(__pyx_v_v_authrole); __Pyx_XDECREF(__pyx_v_v_schemaElts); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":806 * * * cdef create_AlterTableStmt(structs.AlterTableStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableStmt(AlterTableStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_cmds = 0; PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTableStmt", 1); /* "pglast/ast.pyx":807 * * cdef create_AlterTableStmt(structs.AlterTableStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":808 * cdef create_AlterTableStmt(structs.AlterTableStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->cmds, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 808, __pyx_L1_error) __pyx_v_v_cmds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":809 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterTableStmt(v_relation, v_cmds, v_objtype, v_missing_ok) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":810 * cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.AlterTableStmt(v_relation, v_cmds, v_objtype, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":811 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterTableStmt(v_relation, v_cmds, v_objtype, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_AlterTableStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_v_relation, __pyx_v_v_cmds, __pyx_v_v_objtype, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":806 * * * cdef create_AlterTableStmt(structs.AlterTableStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_cmds = _pg_list_to_tuple(data.cmds, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_AlterTableStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_cmds); __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":814 * * * cdef create_ReplicaIdentityStmt(structs.ReplicaIdentityStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_identity_type = chr(data.identity_type) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ReplicaIdentityStmt(ReplicaIdentityStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_identity_type = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ReplicaIdentityStmt", 1); /* "pglast/ast.pyx":815 * * cdef create_ReplicaIdentityStmt(structs.ReplicaIdentityStmt* data, offset_to_index): * cdef object v_identity_type = chr(data.identity_type) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.ReplicaIdentityStmt(v_identity_type, v_name) */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->identity_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_identity_type = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":816 * cdef create_ReplicaIdentityStmt(structs.ReplicaIdentityStmt* data, offset_to_index): * cdef object v_identity_type = chr(data.identity_type) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * return ast.ReplicaIdentityStmt(v_identity_type, v_name) * */ __pyx_t_3 = (__pyx_v_data->name != NULL); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_data->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 816, __pyx_L1_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_2 = Py_None; } __pyx_v_v_name = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":817 * cdef object v_identity_type = chr(data.identity_type) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.ReplicaIdentityStmt(v_identity_type, v_name) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ReplicaIdentityStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_v_identity_type, __pyx_v_v_name}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":814 * * * cdef create_ReplicaIdentityStmt(structs.ReplicaIdentityStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_identity_type = chr(data.identity_type) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_ReplicaIdentityStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_identity_type); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":820 * * * cdef create_AlterTableCmd(structs.AlterTableCmd* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subtype = getattr(enums, 'AlterTableType')(data.subtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableCmd(AlterTableCmd *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subtype = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_num = 0; PyObject *__pyx_v_v_newowner = 0; PyObject *__pyx_v_v_def_ = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_v_v_recurse = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTableCmd", 1); /* "pglast/ast.pyx":821 * * cdef create_AlterTableCmd(structs.AlterTableCmd* data, offset_to_index): * cdef object v_subtype = getattr(enums, 'AlterTableType')(data.subtype) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_num = data.num */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_AlterTableType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_AlterTableType(__pyx_v_data->subtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_subtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":822 * cdef create_AlterTableCmd(structs.AlterTableCmd* data, offset_to_index): * cdef object v_subtype = getattr(enums, 'AlterTableType')(data.subtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_num = data.num * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None */ __pyx_t_6 = (__pyx_v_data->name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 822, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":823 * cdef object v_subtype = getattr(enums, 'AlterTableType')(data.subtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_num = data.num # <<<<<<<<<<<<<< * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_data->num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_num = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":824 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_num = data.num * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None # <<<<<<<<<<<<<< * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_6 = (__pyx_v_data->newowner != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->newowner, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newowner = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":825 * cdef object v_num = data.num * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_6 = (__pyx_v_data->def != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->def, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_def_ = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":826 * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_recurse = bool(data.recurse) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":827 * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * cdef object v_recurse = bool(data.recurse) * return ast.AlterTableCmd(v_subtype, v_name, v_num, v_newowner, v_def_, v_behavior, v_missing_ok, v_recurse) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":828 * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_recurse = bool(data.recurse) # <<<<<<<<<<<<<< * return ast.AlterTableCmd(v_subtype, v_name, v_num, v_newowner, v_def_, v_behavior, v_missing_ok, v_recurse) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->recurse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_recurse = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":829 * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_recurse = bool(data.recurse) * return ast.AlterTableCmd(v_subtype, v_name, v_num, v_newowner, v_def_, v_behavior, v_missing_ok, v_recurse) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AlterTableCmd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_2, __pyx_v_v_subtype, __pyx_v_v_name, __pyx_v_v_num, __pyx_v_v_newowner, __pyx_v_v_def_, __pyx_v_v_behavior, __pyx_v_v_missing_ok, __pyx_v_v_recurse}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 8+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":820 * * * cdef create_AlterTableCmd(structs.AlterTableCmd* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subtype = getattr(enums, 'AlterTableType')(data.subtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterTableCmd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subtype); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_num); __Pyx_XDECREF(__pyx_v_v_newowner); __Pyx_XDECREF(__pyx_v_v_def_); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XDECREF(__pyx_v_v_recurse); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":832 * * * cdef create_AlterCollationStmt(structs.AlterCollationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) * return ast.AlterCollationStmt(v_collname) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterCollationStmt(AlterCollationStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_collname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterCollationStmt", 1); /* "pglast/ast.pyx":833 * * cdef create_AlterCollationStmt(structs.AlterCollationStmt* data, offset_to_index): * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterCollationStmt(v_collname) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->collname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 833, __pyx_L1_error) __pyx_v_v_collname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":834 * cdef create_AlterCollationStmt(structs.AlterCollationStmt* data, offset_to_index): * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) * return ast.AlterCollationStmt(v_collname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AlterCollationStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v_collname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":832 * * * cdef create_AlterCollationStmt(structs.AlterCollationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_collname = _pg_list_to_tuple(data.collname, offset_to_index) * return ast.AlterCollationStmt(v_collname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_AlterCollationStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_collname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":837 * * * cdef create_AlterDomainStmt(structs.AlterDomainStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subtype = chr(data.subtype) * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterDomainStmt(AlterDomainStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subtype = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_def_ = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterDomainStmt", 1); /* "pglast/ast.pyx":838 * * cdef create_AlterDomainStmt(structs.AlterDomainStmt* data, offset_to_index): * cdef object v_subtype = chr(data.subtype) # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->subtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_subtype = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":839 * cdef create_AlterDomainStmt(structs.AlterDomainStmt* data, offset_to_index): * cdef object v_subtype = chr(data.subtype) * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None */ __pyx_t_2 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_2))) __PYX_ERR(0, 839, __pyx_L1_error) __pyx_v_v_typeName = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":840 * cdef object v_subtype = chr(data.subtype) * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_3 = (__pyx_v_data->name != NULL); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_data->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 840, __pyx_L1_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_2 = Py_None; } __pyx_v_v_name = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":841 * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_3 = (__pyx_v_data->def != NULL); if (__pyx_t_3) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->def, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_2 = Py_None; } __pyx_v_v_def_ = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":842 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterDomainStmt(v_subtype, v_typeName, v_name, v_def_, v_behavior, v_missing_ok) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_enums); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_1, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_behavior = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":843 * cdef object v_def_ = create(data.def_, offset_to_index) if data.def_ is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.AlterDomainStmt(v_subtype, v_typeName, v_name, v_def_, v_behavior, v_missing_ok) * */ __pyx_t_2 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_v_missing_ok = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/ast.pyx":844 * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterDomainStmt(v_subtype, v_typeName, v_name, v_def_, v_behavior, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_AlterDomainStmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_6, __pyx_v_v_subtype, __pyx_v_v_typeName, __pyx_v_v_name, __pyx_v_v_def_, __pyx_v_v_behavior, __pyx_v_v_missing_ok}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 6+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":837 * * * cdef create_AlterDomainStmt(structs.AlterDomainStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subtype = chr(data.subtype) * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_AlterDomainStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subtype); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_def_); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":847 * * * cdef create_GrantStmt(structs.GrantStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_is_grant = bool(data.is_grant) * cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) */ static PyObject *__pyx_f_6pglast_6parser_create_GrantStmt(GrantStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_is_grant = 0; PyObject *__pyx_v_v_targtype = 0; PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_objects = 0; PyObject *__pyx_v_v_privileges = 0; PyObject *__pyx_v_v_grantees = 0; PyObject *__pyx_v_v_grant_option = 0; PyObject *__pyx_v_v_grantor = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_GrantStmt", 1); /* "pglast/ast.pyx":848 * * cdef create_GrantStmt(structs.GrantStmt* data, offset_to_index): * cdef object v_is_grant = bool(data.is_grant) # <<<<<<<<<<<<<< * cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_grant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_grant = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":849 * cdef create_GrantStmt(structs.GrantStmt* data, offset_to_index): * cdef object v_is_grant = bool(data.is_grant) * cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_GrantTargetType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_GrantTargetType(__pyx_v_data->targtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_targtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":850 * cdef object v_is_grant = bool(data.is_grant) * cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef tuple v_privileges = _pg_list_to_tuple(data.privileges, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_4, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":851 * cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_privileges = _pg_list_to_tuple(data.privileges, offset_to_index) * cdef tuple v_grantees = _pg_list_to_tuple(data.grantees, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->objects, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 851, __pyx_L1_error) __pyx_v_v_objects = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":852 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef tuple v_privileges = _pg_list_to_tuple(data.privileges, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_grantees = _pg_list_to_tuple(data.grantees, offset_to_index) * cdef object v_grant_option = bool(data.grant_option) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->privileges, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 852, __pyx_L1_error) __pyx_v_v_privileges = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":853 * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef tuple v_privileges = _pg_list_to_tuple(data.privileges, offset_to_index) * cdef tuple v_grantees = _pg_list_to_tuple(data.grantees, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_grant_option = bool(data.grant_option) * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->grantees, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 853, __pyx_L1_error) __pyx_v_v_grantees = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":854 * cdef tuple v_privileges = _pg_list_to_tuple(data.privileges, offset_to_index) * cdef tuple v_grantees = _pg_list_to_tuple(data.grantees, offset_to_index) * cdef object v_grant_option = bool(data.grant_option) # <<<<<<<<<<<<<< * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->grant_option); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_grant_option = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":855 * cdef tuple v_grantees = _pg_list_to_tuple(data.grantees, offset_to_index) * cdef object v_grant_option = bool(data.grant_option) * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.GrantStmt(v_is_grant, v_targtype, v_objtype, v_objects, v_privileges, v_grantees, v_grant_option, v_grantor, v_behavior) */ __pyx_t_2 = (__pyx_v_data->grantor != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->grantor, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_grantor = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":856 * cdef object v_grant_option = bool(data.grant_option) * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * return ast.GrantStmt(v_is_grant, v_targtype, v_objtype, v_objects, v_privileges, v_grantees, v_grant_option, v_grantor, v_behavior) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":857 * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.GrantStmt(v_is_grant, v_targtype, v_objtype, v_objects, v_privileges, v_grantees, v_grant_option, v_grantor, v_behavior) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_GrantStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[10] = {__pyx_t_4, __pyx_v_v_is_grant, __pyx_v_v_targtype, __pyx_v_v_objtype, __pyx_v_v_objects, __pyx_v_v_privileges, __pyx_v_v_grantees, __pyx_v_v_grant_option, __pyx_v_v_grantor, __pyx_v_v_behavior}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 9+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":847 * * * cdef create_GrantStmt(structs.GrantStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_is_grant = bool(data.is_grant) * cdef object v_targtype = getattr(enums, 'GrantTargetType')(data.targtype) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_GrantStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_is_grant); __Pyx_XDECREF(__pyx_v_v_targtype); __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_objects); __Pyx_XDECREF(__pyx_v_v_privileges); __Pyx_XDECREF(__pyx_v_v_grantees); __Pyx_XDECREF(__pyx_v_v_grant_option); __Pyx_XDECREF(__pyx_v_v_grantor); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":860 * * * cdef create_ObjectWithArgs(structs.ObjectWithArgs* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_objname = _pg_list_to_tuple(data.objname, offset_to_index) * cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_ObjectWithArgs(ObjectWithArgs *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objname = 0; PyObject *__pyx_v_v_objargs = 0; PyObject *__pyx_v_v_objfuncargs = 0; PyObject *__pyx_v_v_args_unspecified = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ObjectWithArgs", 1); /* "pglast/ast.pyx":861 * * cdef create_ObjectWithArgs(structs.ObjectWithArgs* data, offset_to_index): * cdef tuple v_objname = _pg_list_to_tuple(data.objname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) * cdef tuple v_objfuncargs = _pg_list_to_tuple(data.objfuncargs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->objname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 861, __pyx_L1_error) __pyx_v_v_objname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":862 * cdef create_ObjectWithArgs(structs.ObjectWithArgs* data, offset_to_index): * cdef tuple v_objname = _pg_list_to_tuple(data.objname, offset_to_index) * cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_objfuncargs = _pg_list_to_tuple(data.objfuncargs, offset_to_index) * cdef object v_args_unspecified = bool(data.args_unspecified) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->objargs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 862, __pyx_L1_error) __pyx_v_v_objargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":863 * cdef tuple v_objname = _pg_list_to_tuple(data.objname, offset_to_index) * cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) * cdef tuple v_objfuncargs = _pg_list_to_tuple(data.objfuncargs, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_args_unspecified = bool(data.args_unspecified) * return ast.ObjectWithArgs(v_objname, v_objargs, v_objfuncargs, v_args_unspecified) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->objfuncargs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 863, __pyx_L1_error) __pyx_v_v_objfuncargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":864 * cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) * cdef tuple v_objfuncargs = _pg_list_to_tuple(data.objfuncargs, offset_to_index) * cdef object v_args_unspecified = bool(data.args_unspecified) # <<<<<<<<<<<<<< * return ast.ObjectWithArgs(v_objname, v_objargs, v_objfuncargs, v_args_unspecified) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->args_unspecified); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_args_unspecified = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":865 * cdef tuple v_objfuncargs = _pg_list_to_tuple(data.objfuncargs, offset_to_index) * cdef object v_args_unspecified = bool(data.args_unspecified) * return ast.ObjectWithArgs(v_objname, v_objargs, v_objfuncargs, v_args_unspecified) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ObjectWithArgs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_objname, __pyx_v_v_objargs, __pyx_v_v_objfuncargs, __pyx_v_v_args_unspecified}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":860 * * * cdef create_ObjectWithArgs(structs.ObjectWithArgs* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_objname = _pg_list_to_tuple(data.objname, offset_to_index) * cdef tuple v_objargs = _pg_list_to_tuple(data.objargs, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ObjectWithArgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objname); __Pyx_XDECREF(__pyx_v_v_objargs); __Pyx_XDECREF(__pyx_v_v_objfuncargs); __Pyx_XDECREF(__pyx_v_v_args_unspecified); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":868 * * * cdef create_AccessPriv(structs.AccessPriv* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_priv_name = data.priv_name.decode("utf-8") if data.priv_name is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AccessPriv(AccessPriv *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_priv_name = 0; PyObject *__pyx_v_v_cols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AccessPriv", 1); /* "pglast/ast.pyx":869 * * cdef create_AccessPriv(structs.AccessPriv* data, offset_to_index): * cdef object v_priv_name = data.priv_name.decode("utf-8") if data.priv_name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) * return ast.AccessPriv(v_priv_name, v_cols) */ __pyx_t_2 = (__pyx_v_data->priv_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->priv_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 869, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_priv_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":870 * cdef create_AccessPriv(structs.AccessPriv* data, offset_to_index): * cdef object v_priv_name = data.priv_name.decode("utf-8") if data.priv_name is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) # <<<<<<<<<<<<<< * return ast.AccessPriv(v_priv_name, v_cols) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->cols, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 870, __pyx_L1_error) __pyx_v_v_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":871 * cdef object v_priv_name = data.priv_name.decode("utf-8") if data.priv_name is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) * return ast.AccessPriv(v_priv_name, v_cols) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AccessPriv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_priv_name, __pyx_v_v_cols}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":868 * * * cdef create_AccessPriv(structs.AccessPriv* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_priv_name = data.priv_name.decode("utf-8") if data.priv_name is not NULL else None * cdef tuple v_cols = _pg_list_to_tuple(data.cols, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AccessPriv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_priv_name); __Pyx_XDECREF(__pyx_v_v_cols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":874 * * * cdef create_GrantRoleStmt(structs.GrantRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_granted_roles = _pg_list_to_tuple(data.granted_roles, offset_to_index) * cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_GrantRoleStmt(GrantRoleStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_granted_roles = 0; PyObject *__pyx_v_v_grantee_roles = 0; PyObject *__pyx_v_v_is_grant = 0; PyObject *__pyx_v_v_opt = 0; PyObject *__pyx_v_v_grantor = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_GrantRoleStmt", 1); /* "pglast/ast.pyx":875 * * cdef create_GrantRoleStmt(structs.GrantRoleStmt* data, offset_to_index): * cdef tuple v_granted_roles = _pg_list_to_tuple(data.granted_roles, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) * cdef object v_is_grant = bool(data.is_grant) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->granted_roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 875, __pyx_L1_error) __pyx_v_v_granted_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":876 * cdef create_GrantRoleStmt(structs.GrantRoleStmt* data, offset_to_index): * cdef tuple v_granted_roles = _pg_list_to_tuple(data.granted_roles, offset_to_index) * cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_is_grant = bool(data.is_grant) * cdef tuple v_opt = _pg_list_to_tuple(data.opt, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->grantee_roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 876, __pyx_L1_error) __pyx_v_v_grantee_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":877 * cdef tuple v_granted_roles = _pg_list_to_tuple(data.granted_roles, offset_to_index) * cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) * cdef object v_is_grant = bool(data.is_grant) # <<<<<<<<<<<<<< * cdef tuple v_opt = _pg_list_to_tuple(data.opt, offset_to_index) * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_grant); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_grant = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":878 * cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) * cdef object v_is_grant = bool(data.is_grant) * cdef tuple v_opt = _pg_list_to_tuple(data.opt, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 878, __pyx_L1_error) __pyx_v_v_opt = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":879 * cdef object v_is_grant = bool(data.is_grant) * cdef tuple v_opt = _pg_list_to_tuple(data.opt, offset_to_index) * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.GrantRoleStmt(v_granted_roles, v_grantee_roles, v_is_grant, v_opt, v_grantor, v_behavior) */ __pyx_t_2 = (__pyx_v_data->grantor != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->grantor, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_grantor = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":880 * cdef tuple v_opt = _pg_list_to_tuple(data.opt, offset_to_index) * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * return ast.GrantRoleStmt(v_granted_roles, v_grantee_roles, v_is_grant, v_opt, v_grantor, v_behavior) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":881 * cdef object v_grantor = create(data.grantor, offset_to_index) if data.grantor is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.GrantRoleStmt(v_granted_roles, v_grantee_roles, v_is_grant, v_opt, v_grantor, v_behavior) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_GrantRoleStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_4, __pyx_v_v_granted_roles, __pyx_v_v_grantee_roles, __pyx_v_v_is_grant, __pyx_v_v_opt, __pyx_v_v_grantor, __pyx_v_v_behavior}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":874 * * * cdef create_GrantRoleStmt(structs.GrantRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_granted_roles = _pg_list_to_tuple(data.granted_roles, offset_to_index) * cdef tuple v_grantee_roles = _pg_list_to_tuple(data.grantee_roles, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_GrantRoleStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_granted_roles); __Pyx_XDECREF(__pyx_v_v_grantee_roles); __Pyx_XDECREF(__pyx_v_v_is_grant); __Pyx_XDECREF(__pyx_v_v_opt); __Pyx_XDECREF(__pyx_v_v_grantor); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":884 * * * cdef create_AlterDefaultPrivilegesStmt(structs.AlterDefaultPrivilegesStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = create(data.action, offset_to_index) if data.action is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterDefaultPrivilegesStmt(AlterDefaultPrivilegesStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_action = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterDefaultPrivilegesStmt", 1); /* "pglast/ast.pyx":885 * * cdef create_AlterDefaultPrivilegesStmt(structs.AlterDefaultPrivilegesStmt* data, offset_to_index): * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_action = create(data.action, offset_to_index) if data.action is not NULL else None * return ast.AlterDefaultPrivilegesStmt(v_options, v_action) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 885, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":886 * cdef create_AlterDefaultPrivilegesStmt(structs.AlterDefaultPrivilegesStmt* data, offset_to_index): * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = create(data.action, offset_to_index) if data.action is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterDefaultPrivilegesStmt(v_options, v_action) * */ __pyx_t_2 = (__pyx_v_data->action != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->action, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":887 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = create(data.action, offset_to_index) if data.action is not NULL else None * return ast.AlterDefaultPrivilegesStmt(v_options, v_action) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterDefaultPrivilegesStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_options, __pyx_v_v_action}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":884 * * * cdef create_AlterDefaultPrivilegesStmt(structs.AlterDefaultPrivilegesStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = create(data.action, offset_to_index) if data.action is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterDefaultPrivilegesStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_action); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":890 * * * cdef create_CopyStmt(structs.CopyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CopyStmt(CopyStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_query = 0; PyObject *__pyx_v_v_attlist = 0; PyObject *__pyx_v_v_is_from = 0; PyObject *__pyx_v_v_is_program = 0; PyObject *__pyx_v_v_filename = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CopyStmt", 1); /* "pglast/ast.pyx":891 * * cdef create_CopyStmt(structs.CopyStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_attlist = _pg_list_to_tuple(data.attlist, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":892 * cdef create_CopyStmt(structs.CopyStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_attlist = _pg_list_to_tuple(data.attlist, offset_to_index) * cdef object v_is_from = bool(data.is_from) */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":893 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_attlist = _pg_list_to_tuple(data.attlist, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_is_from = bool(data.is_from) * cdef object v_is_program = bool(data.is_program) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->attlist, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 893, __pyx_L1_error) __pyx_v_v_attlist = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":894 * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_attlist = _pg_list_to_tuple(data.attlist, offset_to_index) * cdef object v_is_from = bool(data.is_from) # <<<<<<<<<<<<<< * cdef object v_is_program = bool(data.is_program) * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_from = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":895 * cdef tuple v_attlist = _pg_list_to_tuple(data.attlist, offset_to_index) * cdef object v_is_from = bool(data.is_from) * cdef object v_is_program = bool(data.is_program) # <<<<<<<<<<<<<< * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_program); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_program = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":896 * cdef object v_is_from = bool(data.is_from) * cdef object v_is_program = bool(data.is_program) * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->filename != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->filename; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 896, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_filename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":897 * cdef object v_is_program = bool(data.is_program) * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * return ast.CopyStmt(v_relation, v_query, v_attlist, v_is_from, v_is_program, v_filename, v_options, v_whereClause) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 897, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":898 * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * return ast.CopyStmt(v_relation, v_query, v_attlist, v_is_from, v_is_program, v_filename, v_options, v_whereClause) * */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":899 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * return ast.CopyStmt(v_relation, v_query, v_attlist, v_is_from, v_is_program, v_filename, v_options, v_whereClause) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CopyStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_query, __pyx_v_v_attlist, __pyx_v_v_is_from, __pyx_v_v_is_program, __pyx_v_v_filename, __pyx_v_v_options, __pyx_v_v_whereClause}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 8+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":890 * * * cdef create_CopyStmt(structs.CopyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CopyStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XDECREF(__pyx_v_v_attlist); __Pyx_XDECREF(__pyx_v_v_is_from); __Pyx_XDECREF(__pyx_v_v_is_program); __Pyx_XDECREF(__pyx_v_v_filename); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":902 * * * cdef create_VariableSetStmt(structs.VariableSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'VariableSetKind')(data.kind) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_VariableSetStmt(VariableSetStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_is_local = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_VariableSetStmt", 1); /* "pglast/ast.pyx":903 * * cdef create_VariableSetStmt(structs.VariableSetStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'VariableSetKind')(data.kind) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_VariableSetKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_VariableSetKind(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":904 * cdef create_VariableSetStmt(structs.VariableSetStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'VariableSetKind')(data.kind) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_is_local = bool(data.is_local) */ __pyx_t_6 = (__pyx_v_data->name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 904, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":905 * cdef object v_kind = getattr(enums, 'VariableSetKind')(data.kind) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_is_local = bool(data.is_local) * return ast.VariableSetStmt(v_kind, v_name, v_args, v_is_local) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 905, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":906 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_is_local = bool(data.is_local) # <<<<<<<<<<<<<< * return ast.VariableSetStmt(v_kind, v_name, v_args, v_is_local) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_local = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":907 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_is_local = bool(data.is_local) * return ast.VariableSetStmt(v_kind, v_name, v_args, v_is_local) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_VariableSetStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_kind, __pyx_v_v_name, __pyx_v_v_args, __pyx_v_v_is_local}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":902 * * * cdef create_VariableSetStmt(structs.VariableSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'VariableSetKind')(data.kind) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_VariableSetStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_is_local); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":910 * * * cdef create_VariableShowStmt(structs.VariableShowStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.VariableShowStmt(v_name) */ static PyObject *__pyx_f_6pglast_6parser_create_VariableShowStmt(VariableShowStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_VariableShowStmt", 1); /* "pglast/ast.pyx":911 * * cdef create_VariableShowStmt(structs.VariableShowStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * return ast.VariableShowStmt(v_name) * */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 911, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":912 * cdef create_VariableShowStmt(structs.VariableShowStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.VariableShowStmt(v_name) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_VariableShowStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_name}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":910 * * * cdef create_VariableShowStmt(structs.VariableShowStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * return ast.VariableShowStmt(v_name) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_VariableShowStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":915 * * * cdef create_CreateStmt(structs.CreateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateStmt(CreateStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_tableElts = 0; PyObject *__pyx_v_v_inhRelations = 0; PyObject *__pyx_v_v_partbound = 0; PyObject *__pyx_v_v_partspec = 0; PyObject *__pyx_v_v_ofTypename = 0; PyObject *__pyx_v_v_constraints = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_oncommit = 0; PyObject *__pyx_v_v_tablespacename = 0; PyObject *__pyx_v_v_accessMethod = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateStmt", 1); /* "pglast/ast.pyx":916 * * cdef create_CreateStmt(structs.CreateStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) * cdef tuple v_inhRelations = _pg_list_to_tuple(data.inhRelations, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":917 * cdef create_CreateStmt(structs.CreateStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_inhRelations = _pg_list_to_tuple(data.inhRelations, offset_to_index) * cdef object v_partbound = create(data.partbound, offset_to_index) if data.partbound is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->tableElts, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 917, __pyx_L1_error) __pyx_v_v_tableElts = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":918 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) * cdef tuple v_inhRelations = _pg_list_to_tuple(data.inhRelations, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_partbound = create(data.partbound, offset_to_index) if data.partbound is not NULL else None * cdef object v_partspec = create(data.partspec, offset_to_index) if data.partspec is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->inhRelations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 918, __pyx_L1_error) __pyx_v_v_inhRelations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":919 * cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) * cdef tuple v_inhRelations = _pg_list_to_tuple(data.inhRelations, offset_to_index) * cdef object v_partbound = create(data.partbound, offset_to_index) if data.partbound is not NULL else None # <<<<<<<<<<<<<< * cdef object v_partspec = create(data.partspec, offset_to_index) if data.partspec is not NULL else None * cdef object v_ofTypename = create(data.ofTypename, offset_to_index) if data.ofTypename is not NULL else None */ __pyx_t_2 = (__pyx_v_data->partbound != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->partbound, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_partbound = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":920 * cdef tuple v_inhRelations = _pg_list_to_tuple(data.inhRelations, offset_to_index) * cdef object v_partbound = create(data.partbound, offset_to_index) if data.partbound is not NULL else None * cdef object v_partspec = create(data.partspec, offset_to_index) if data.partspec is not NULL else None # <<<<<<<<<<<<<< * cdef object v_ofTypename = create(data.ofTypename, offset_to_index) if data.ofTypename is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->partspec != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->partspec, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_partspec = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":921 * cdef object v_partbound = create(data.partbound, offset_to_index) if data.partbound is not NULL else None * cdef object v_partspec = create(data.partspec, offset_to_index) if data.partspec is not NULL else None * cdef object v_ofTypename = create(data.ofTypename, offset_to_index) if data.ofTypename is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->ofTypename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->ofTypename, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_ofTypename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":922 * cdef object v_partspec = create(data.partspec, offset_to_index) if data.partspec is not NULL else None * cdef object v_ofTypename = create(data.ofTypename, offset_to_index) if data.ofTypename is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_oncommit = getattr(enums, 'OnCommitAction')(data.oncommit) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->constraints, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 922, __pyx_L1_error) __pyx_v_v_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":923 * cdef object v_ofTypename = create(data.ofTypename, offset_to_index) if data.ofTypename is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_oncommit = getattr(enums, 'OnCommitAction')(data.oncommit) * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 923, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":924 * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_oncommit = getattr(enums, 'OnCommitAction')(data.oncommit) # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_OnCommitAction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_OnCommitAction(__pyx_v_data->oncommit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_oncommit = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":925 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_oncommit = getattr(enums, 'OnCommitAction')(data.oncommit) * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_2 = (__pyx_v_data->tablespacename != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->tablespacename; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 925, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tablespacename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":926 * cdef object v_oncommit = getattr(enums, 'OnCommitAction')(data.oncommit) * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateStmt(v_relation, v_tableElts, v_inhRelations, v_partbound, v_partspec, v_ofTypename, v_constraints, v_options, v_oncommit, v_tablespacename, v_accessMethod, v_if_not_exists) */ __pyx_t_2 = (__pyx_v_data->accessMethod != NULL); if (__pyx_t_2) { __pyx_t_9 = __pyx_v_data->accessMethod; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 926, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_accessMethod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":927 * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * return ast.CreateStmt(v_relation, v_tableElts, v_inhRelations, v_partbound, v_partspec, v_ofTypename, v_constraints, v_options, v_oncommit, v_tablespacename, v_accessMethod, v_if_not_exists) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":928 * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateStmt(v_relation, v_tableElts, v_inhRelations, v_partbound, v_partspec, v_ofTypename, v_constraints, v_options, v_oncommit, v_tablespacename, v_accessMethod, v_if_not_exists) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CreateStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[13] = {__pyx_t_4, __pyx_v_v_relation, __pyx_v_v_tableElts, __pyx_v_v_inhRelations, __pyx_v_v_partbound, __pyx_v_v_partspec, __pyx_v_v_ofTypename, __pyx_v_v_constraints, __pyx_v_v_options, __pyx_v_v_oncommit, __pyx_v_v_tablespacename, __pyx_v_v_accessMethod, __pyx_v_v_if_not_exists}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 12+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":915 * * * cdef create_CreateStmt(structs.CreateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_tableElts = _pg_list_to_tuple(data.tableElts, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CreateStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_tableElts); __Pyx_XDECREF(__pyx_v_v_inhRelations); __Pyx_XDECREF(__pyx_v_v_partbound); __Pyx_XDECREF(__pyx_v_v_partspec); __Pyx_XDECREF(__pyx_v_v_ofTypename); __Pyx_XDECREF(__pyx_v_v_constraints); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_oncommit); __Pyx_XDECREF(__pyx_v_v_tablespacename); __Pyx_XDECREF(__pyx_v_v_accessMethod); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":931 * * * cdef create_Constraint(structs.Constraint* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_contype = getattr(enums, 'ConstrType')(data.contype) * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_Constraint(Constraint *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_contype = 0; PyObject *__pyx_v_v_conname = 0; PyObject *__pyx_v_v_deferrable = 0; PyObject *__pyx_v_v_initdeferred = 0; PyObject *__pyx_v_v_skip_validation = 0; PyObject *__pyx_v_v_initially_valid = 0; PyObject *__pyx_v_v_is_no_inherit = 0; PyObject *__pyx_v_v_raw_expr = 0; PyObject *__pyx_v_v_cooked_expr = 0; PyObject *__pyx_v_v_generated_when = 0; PyObject *__pyx_v_v_inhcount = 0; PyObject *__pyx_v_v_nulls_not_distinct = 0; PyObject *__pyx_v_v_keys = 0; PyObject *__pyx_v_v_including = 0; PyObject *__pyx_v_v_exclusions = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_indexname = 0; PyObject *__pyx_v_v_indexspace = 0; PyObject *__pyx_v_v_reset_default_tblspc = 0; PyObject *__pyx_v_v_access_method = 0; PyObject *__pyx_v_v_where_clause = 0; PyObject *__pyx_v_v_pktable = 0; PyObject *__pyx_v_v_fk_attrs = 0; PyObject *__pyx_v_v_pk_attrs = 0; PyObject *__pyx_v_v_fk_matchtype = 0; PyObject *__pyx_v_v_fk_upd_action = 0; PyObject *__pyx_v_v_fk_del_action = 0; PyObject *__pyx_v_v_fk_del_set_cols = 0; PyObject *__pyx_v_v_old_conpfeqop = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; char const *__pyx_t_10; char const *__pyx_t_11; char const *__pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Constraint", 1); /* "pglast/ast.pyx":932 * * cdef create_Constraint(structs.Constraint* data, offset_to_index): * cdef object v_contype = getattr(enums, 'ConstrType')(data.contype) # <<<<<<<<<<<<<< * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None * cdef object v_deferrable = bool(data.deferrable) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ConstrType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ConstrType(__pyx_v_data->contype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_contype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":933 * cdef create_Constraint(structs.Constraint* data, offset_to_index): * cdef object v_contype = getattr(enums, 'ConstrType')(data.contype) * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) */ __pyx_t_6 = (__pyx_v_data->conname != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->conname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 933, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":934 * cdef object v_contype = getattr(enums, 'ConstrType')(data.contype) * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None * cdef object v_deferrable = bool(data.deferrable) # <<<<<<<<<<<<<< * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_skip_validation = bool(data.skip_validation) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->deferrable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_deferrable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":935 * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) # <<<<<<<<<<<<<< * cdef object v_skip_validation = bool(data.skip_validation) * cdef object v_initially_valid = bool(data.initially_valid) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->initdeferred); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_initdeferred = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":936 * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_skip_validation = bool(data.skip_validation) # <<<<<<<<<<<<<< * cdef object v_initially_valid = bool(data.initially_valid) * cdef object v_is_no_inherit = bool(data.is_no_inherit) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->skip_validation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_skip_validation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":937 * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_skip_validation = bool(data.skip_validation) * cdef object v_initially_valid = bool(data.initially_valid) # <<<<<<<<<<<<<< * cdef object v_is_no_inherit = bool(data.is_no_inherit) * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->initially_valid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_initially_valid = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":938 * cdef object v_skip_validation = bool(data.skip_validation) * cdef object v_initially_valid = bool(data.initially_valid) * cdef object v_is_no_inherit = bool(data.is_no_inherit) # <<<<<<<<<<<<<< * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_cooked_expr = data.cooked_expr.decode("utf-8") if data.cooked_expr is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_no_inherit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_no_inherit = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":939 * cdef object v_initially_valid = bool(data.initially_valid) * cdef object v_is_no_inherit = bool(data.is_no_inherit) * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cooked_expr = data.cooked_expr.decode("utf-8") if data.cooked_expr is not NULL else None * cdef object v_generated_when = chr(data.generated_when) */ __pyx_t_6 = (__pyx_v_data->raw_expr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->raw_expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_raw_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":940 * cdef object v_is_no_inherit = bool(data.is_no_inherit) * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_cooked_expr = data.cooked_expr.decode("utf-8") if data.cooked_expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_generated_when = chr(data.generated_when) * cdef object v_inhcount = data.inhcount */ __pyx_t_6 = (__pyx_v_data->cooked_expr != NULL); if (__pyx_t_6) { __pyx_t_9 = __pyx_v_data->cooked_expr; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 940, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cooked_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":941 * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_cooked_expr = data.cooked_expr.decode("utf-8") if data.cooked_expr is not NULL else None * cdef object v_generated_when = chr(data.generated_when) # <<<<<<<<<<<<<< * cdef object v_inhcount = data.inhcount * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->generated_when); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_generated_when = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":942 * cdef object v_cooked_expr = data.cooked_expr.decode("utf-8") if data.cooked_expr is not NULL else None * cdef object v_generated_when = chr(data.generated_when) * cdef object v_inhcount = data.inhcount # <<<<<<<<<<<<<< * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) * cdef tuple v_keys = _pg_list_to_tuple(data.keys, offset_to_index) */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_data->inhcount); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_v_inhcount = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":943 * cdef object v_generated_when = chr(data.generated_when) * cdef object v_inhcount = data.inhcount * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) # <<<<<<<<<<<<<< * cdef tuple v_keys = _pg_list_to_tuple(data.keys, offset_to_index) * cdef tuple v_including = _pg_list_to_tuple(data.including, offset_to_index) */ __pyx_t_3 = __Pyx_PyInt_From_bool(__pyx_v_data->nulls_not_distinct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_v_nulls_not_distinct = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":944 * cdef object v_inhcount = data.inhcount * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) * cdef tuple v_keys = _pg_list_to_tuple(data.keys, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_including = _pg_list_to_tuple(data.including, offset_to_index) * cdef tuple v_exclusions = _pg_list_to_tuple(data.exclusions, offset_to_index) */ __pyx_t_3 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->keys, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(0, 944, __pyx_L1_error) __pyx_v_v_keys = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pglast/ast.pyx":945 * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) * cdef tuple v_keys = _pg_list_to_tuple(data.keys, offset_to_index) * cdef tuple v_including = _pg_list_to_tuple(data.including, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_exclusions = _pg_list_to_tuple(data.exclusions, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_3 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->including, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(0, 945, __pyx_L1_error) __pyx_v_v_including = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pglast/ast.pyx":946 * cdef tuple v_keys = _pg_list_to_tuple(data.keys, offset_to_index) * cdef tuple v_including = _pg_list_to_tuple(data.including, offset_to_index) * cdef tuple v_exclusions = _pg_list_to_tuple(data.exclusions, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None */ __pyx_t_3 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->exclusions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(0, 946, __pyx_L1_error) __pyx_v_v_exclusions = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pglast/ast.pyx":947 * cdef tuple v_including = _pg_list_to_tuple(data.including, offset_to_index) * cdef tuple v_exclusions = _pg_list_to_tuple(data.exclusions, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None * cdef object v_indexspace = data.indexspace.decode("utf-8") if data.indexspace is not NULL else None */ __pyx_t_3 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(0, 947, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pglast/ast.pyx":948 * cdef tuple v_exclusions = _pg_list_to_tuple(data.exclusions, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_indexspace = data.indexspace.decode("utf-8") if data.indexspace is not NULL else None * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) */ __pyx_t_6 = (__pyx_v_data->indexname != NULL); if (__pyx_t_6) { __pyx_t_10 = __pyx_v_data->indexname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_10); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 948, __pyx_L1_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_10, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_v_indexname = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":949 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None * cdef object v_indexspace = data.indexspace.decode("utf-8") if data.indexspace is not NULL else None # <<<<<<<<<<<<<< * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) * cdef object v_access_method = data.access_method.decode("utf-8") if data.access_method is not NULL else None */ __pyx_t_6 = (__pyx_v_data->indexspace != NULL); if (__pyx_t_6) { __pyx_t_11 = __pyx_v_data->indexspace; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_11); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 949, __pyx_L1_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_11, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_v_indexspace = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":950 * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None * cdef object v_indexspace = data.indexspace.decode("utf-8") if data.indexspace is not NULL else None * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) # <<<<<<<<<<<<<< * cdef object v_access_method = data.access_method.decode("utf-8") if data.access_method is not NULL else None * cdef object v_where_clause = create(data.where_clause, offset_to_index) if data.where_clause is not NULL else None */ __pyx_t_3 = __Pyx_PyInt_From_bool(__pyx_v_data->reset_default_tblspc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_v_reset_default_tblspc = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":951 * cdef object v_indexspace = data.indexspace.decode("utf-8") if data.indexspace is not NULL else None * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) * cdef object v_access_method = data.access_method.decode("utf-8") if data.access_method is not NULL else None # <<<<<<<<<<<<<< * cdef object v_where_clause = create(data.where_clause, offset_to_index) if data.where_clause is not NULL else None * cdef object v_pktable = create(data.pktable, offset_to_index) if data.pktable is not NULL else None */ __pyx_t_6 = (__pyx_v_data->access_method != NULL); if (__pyx_t_6) { __pyx_t_12 = __pyx_v_data->access_method; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_12); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 951, __pyx_L1_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_12, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_v_access_method = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":952 * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) * cdef object v_access_method = data.access_method.decode("utf-8") if data.access_method is not NULL else None * cdef object v_where_clause = create(data.where_clause, offset_to_index) if data.where_clause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_pktable = create(data.pktable, offset_to_index) if data.pktable is not NULL else None * cdef tuple v_fk_attrs = _pg_list_to_tuple(data.fk_attrs, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->where_clause != NULL); if (__pyx_t_6) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->where_clause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_v_where_clause = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":953 * cdef object v_access_method = data.access_method.decode("utf-8") if data.access_method is not NULL else None * cdef object v_where_clause = create(data.where_clause, offset_to_index) if data.where_clause is not NULL else None * cdef object v_pktable = create(data.pktable, offset_to_index) if data.pktable is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_fk_attrs = _pg_list_to_tuple(data.fk_attrs, offset_to_index) * cdef tuple v_pk_attrs = _pg_list_to_tuple(data.pk_attrs, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->pktable != NULL); if (__pyx_t_6) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->pktable, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_v_pktable = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":954 * cdef object v_where_clause = create(data.where_clause, offset_to_index) if data.where_clause is not NULL else None * cdef object v_pktable = create(data.pktable, offset_to_index) if data.pktable is not NULL else None * cdef tuple v_fk_attrs = _pg_list_to_tuple(data.fk_attrs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_pk_attrs = _pg_list_to_tuple(data.pk_attrs, offset_to_index) * cdef object v_fk_matchtype = chr(data.fk_matchtype) */ __pyx_t_3 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fk_attrs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(0, 954, __pyx_L1_error) __pyx_v_v_fk_attrs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pglast/ast.pyx":955 * cdef object v_pktable = create(data.pktable, offset_to_index) if data.pktable is not NULL else None * cdef tuple v_fk_attrs = _pg_list_to_tuple(data.fk_attrs, offset_to_index) * cdef tuple v_pk_attrs = _pg_list_to_tuple(data.pk_attrs, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_fk_matchtype = chr(data.fk_matchtype) * cdef object v_fk_upd_action = chr(data.fk_upd_action) */ __pyx_t_3 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->pk_attrs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_3))) __PYX_ERR(0, 955, __pyx_L1_error) __pyx_v_v_pk_attrs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "pglast/ast.pyx":956 * cdef tuple v_fk_attrs = _pg_list_to_tuple(data.fk_attrs, offset_to_index) * cdef tuple v_pk_attrs = _pg_list_to_tuple(data.pk_attrs, offset_to_index) * cdef object v_fk_matchtype = chr(data.fk_matchtype) # <<<<<<<<<<<<<< * cdef object v_fk_upd_action = chr(data.fk_upd_action) * cdef object v_fk_del_action = chr(data.fk_del_action) */ __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_data->fk_matchtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_v_fk_matchtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":957 * cdef tuple v_pk_attrs = _pg_list_to_tuple(data.pk_attrs, offset_to_index) * cdef object v_fk_matchtype = chr(data.fk_matchtype) * cdef object v_fk_upd_action = chr(data.fk_upd_action) # <<<<<<<<<<<<<< * cdef object v_fk_del_action = chr(data.fk_del_action) * cdef tuple v_fk_del_set_cols = _pg_list_to_tuple(data.fk_del_set_cols, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->fk_upd_action); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_fk_upd_action = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":958 * cdef object v_fk_matchtype = chr(data.fk_matchtype) * cdef object v_fk_upd_action = chr(data.fk_upd_action) * cdef object v_fk_del_action = chr(data.fk_del_action) # <<<<<<<<<<<<<< * cdef tuple v_fk_del_set_cols = _pg_list_to_tuple(data.fk_del_set_cols, offset_to_index) * cdef tuple v_old_conpfeqop = _pg_list_to_tuple(data.old_conpfeqop, offset_to_index) */ __pyx_t_3 = __Pyx_PyInt_From_char(__pyx_v_data->fk_del_action); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_v_fk_del_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":959 * cdef object v_fk_upd_action = chr(data.fk_upd_action) * cdef object v_fk_del_action = chr(data.fk_del_action) * cdef tuple v_fk_del_set_cols = _pg_list_to_tuple(data.fk_del_set_cols, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_old_conpfeqop = _pg_list_to_tuple(data.old_conpfeqop, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fk_del_set_cols, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 959, __pyx_L1_error) __pyx_v_v_fk_del_set_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":960 * cdef object v_fk_del_action = chr(data.fk_del_action) * cdef tuple v_fk_del_set_cols = _pg_list_to_tuple(data.fk_del_set_cols, offset_to_index) * cdef tuple v_old_conpfeqop = _pg_list_to_tuple(data.old_conpfeqop, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.Constraint(v_contype, v_conname, v_deferrable, v_initdeferred, v_skip_validation, v_initially_valid, v_is_no_inherit, v_raw_expr, v_cooked_expr, v_generated_when, v_inhcount, v_nulls_not_distinct, v_keys, v_including, v_exclusions, v_options, v_indexname, v_indexspace, v_reset_default_tblspc, v_access_method, v_where_clause, v_pktable, v_fk_attrs, v_pk_attrs, v_fk_matchtype, v_fk_upd_action, v_fk_del_action, v_fk_del_set_cols, v_old_conpfeqop, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->old_conpfeqop, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 960, __pyx_L1_error) __pyx_v_v_old_conpfeqop = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":961 * cdef tuple v_fk_del_set_cols = _pg_list_to_tuple(data.fk_del_set_cols, offset_to_index) * cdef tuple v_old_conpfeqop = _pg_list_to_tuple(data.old_conpfeqop, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.Constraint(v_contype, v_conname, v_deferrable, v_initdeferred, v_skip_validation, v_initially_valid, v_is_no_inherit, v_raw_expr, v_cooked_expr, v_generated_when, v_inhcount, v_nulls_not_distinct, v_keys, v_including, v_exclusions, v_options, v_indexname, v_indexspace, v_reset_default_tblspc, v_access_method, v_where_clause, v_pktable, v_fk_attrs, v_pk_attrs, v_fk_matchtype, v_fk_upd_action, v_fk_del_action, v_fk_del_set_cols, v_old_conpfeqop, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":962 * cdef tuple v_old_conpfeqop = _pg_list_to_tuple(data.old_conpfeqop, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.Constraint(v_contype, v_conname, v_deferrable, v_initdeferred, v_skip_validation, v_initially_valid, v_is_no_inherit, v_raw_expr, v_cooked_expr, v_generated_when, v_inhcount, v_nulls_not_distinct, v_keys, v_including, v_exclusions, v_options, v_indexname, v_indexspace, v_reset_default_tblspc, v_access_method, v_where_clause, v_pktable, v_fk_attrs, v_pk_attrs, v_fk_matchtype, v_fk_upd_action, v_fk_del_action, v_fk_del_set_cols, v_old_conpfeqop, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[31] = {__pyx_t_2, __pyx_v_v_contype, __pyx_v_v_conname, __pyx_v_v_deferrable, __pyx_v_v_initdeferred, __pyx_v_v_skip_validation, __pyx_v_v_initially_valid, __pyx_v_v_is_no_inherit, __pyx_v_v_raw_expr, __pyx_v_v_cooked_expr, __pyx_v_v_generated_when, __pyx_v_v_inhcount, __pyx_v_v_nulls_not_distinct, __pyx_v_v_keys, __pyx_v_v_including, __pyx_v_v_exclusions, __pyx_v_v_options, __pyx_v_v_indexname, __pyx_v_v_indexspace, __pyx_v_v_reset_default_tblspc, __pyx_v_v_access_method, __pyx_v_v_where_clause, __pyx_v_v_pktable, __pyx_v_v_fk_attrs, __pyx_v_v_pk_attrs, __pyx_v_v_fk_matchtype, __pyx_v_v_fk_upd_action, __pyx_v_v_fk_del_action, __pyx_v_v_fk_del_set_cols, __pyx_v_v_old_conpfeqop, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 30+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":931 * * * cdef create_Constraint(structs.Constraint* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_contype = getattr(enums, 'ConstrType')(data.contype) * cdef object v_conname = data.conname.decode("utf-8") if data.conname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_Constraint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_contype); __Pyx_XDECREF(__pyx_v_v_conname); __Pyx_XDECREF(__pyx_v_v_deferrable); __Pyx_XDECREF(__pyx_v_v_initdeferred); __Pyx_XDECREF(__pyx_v_v_skip_validation); __Pyx_XDECREF(__pyx_v_v_initially_valid); __Pyx_XDECREF(__pyx_v_v_is_no_inherit); __Pyx_XDECREF(__pyx_v_v_raw_expr); __Pyx_XDECREF(__pyx_v_v_cooked_expr); __Pyx_XDECREF(__pyx_v_v_generated_when); __Pyx_XDECREF(__pyx_v_v_inhcount); __Pyx_XDECREF(__pyx_v_v_nulls_not_distinct); __Pyx_XDECREF(__pyx_v_v_keys); __Pyx_XDECREF(__pyx_v_v_including); __Pyx_XDECREF(__pyx_v_v_exclusions); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_indexname); __Pyx_XDECREF(__pyx_v_v_indexspace); __Pyx_XDECREF(__pyx_v_v_reset_default_tblspc); __Pyx_XDECREF(__pyx_v_v_access_method); __Pyx_XDECREF(__pyx_v_v_where_clause); __Pyx_XDECREF(__pyx_v_v_pktable); __Pyx_XDECREF(__pyx_v_v_fk_attrs); __Pyx_XDECREF(__pyx_v_v_pk_attrs); __Pyx_XDECREF(__pyx_v_v_fk_matchtype); __Pyx_XDECREF(__pyx_v_v_fk_upd_action); __Pyx_XDECREF(__pyx_v_v_fk_del_action); __Pyx_XDECREF(__pyx_v_v_fk_del_set_cols); __Pyx_XDECREF(__pyx_v_v_old_conpfeqop); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":965 * * * cdef create_CreateTableSpaceStmt(structs.CreateTableSpaceStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateTableSpaceStmt(CreateTableSpaceStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_tablespacename = 0; PyObject *__pyx_v_v_owner = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateTableSpaceStmt", 1); /* "pglast/ast.pyx":966 * * cdef create_CreateTableSpaceStmt(structs.CreateTableSpaceStmt* data, offset_to_index): * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None * cdef object v_location = data.location.decode("utf-8") if data.location is not NULL else None */ __pyx_t_2 = (__pyx_v_data->tablespacename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->tablespacename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 966, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tablespacename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":967 * cdef create_CreateTableSpaceStmt(structs.CreateTableSpaceStmt* data, offset_to_index): * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = data.location.decode("utf-8") if data.location is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->owner != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->owner, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_owner = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":968 * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None * cdef object v_location = data.location.decode("utf-8") if data.location is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateTableSpaceStmt(v_tablespacename, v_owner, v_location, v_options) */ __pyx_t_2 = (__pyx_v_data->location != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->location; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 968, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":969 * cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None * cdef object v_location = data.location.decode("utf-8") if data.location is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateTableSpaceStmt(v_tablespacename, v_owner, v_location, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 969, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":970 * cdef object v_location = data.location.decode("utf-8") if data.location is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateTableSpaceStmt(v_tablespacename, v_owner, v_location, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateTableSpaceStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_tablespacename, __pyx_v_v_owner, __pyx_v_v_location, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":965 * * * cdef create_CreateTableSpaceStmt(structs.CreateTableSpaceStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_owner = create(data.owner, offset_to_index) if data.owner is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CreateTableSpaceStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_tablespacename); __Pyx_XDECREF(__pyx_v_v_owner); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":973 * * * cdef create_DropTableSpaceStmt(structs.DropTableSpaceStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ static PyObject *__pyx_f_6pglast_6parser_create_DropTableSpaceStmt(DropTableSpaceStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_tablespacename = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropTableSpaceStmt", 1); /* "pglast/ast.pyx":974 * * cdef create_DropTableSpaceStmt(structs.DropTableSpaceStmt* data, offset_to_index): * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.DropTableSpaceStmt(v_tablespacename, v_missing_ok) */ __pyx_t_2 = (__pyx_v_data->tablespacename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->tablespacename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 974, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tablespacename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":975 * cdef create_DropTableSpaceStmt(structs.DropTableSpaceStmt* data, offset_to_index): * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.DropTableSpaceStmt(v_tablespacename, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":976 * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) * return ast.DropTableSpaceStmt(v_tablespacename, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DropTableSpaceStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_tablespacename, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":973 * * * cdef create_DropTableSpaceStmt(structs.DropTableSpaceStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_DropTableSpaceStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_tablespacename); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":979 * * * cdef create_AlterTableSpaceOptionsStmt(structs.AlterTableSpaceOptionsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableSpaceOptionsStmt(AlterTableSpaceOptionsStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_tablespacename = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_isReset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTableSpaceOptionsStmt", 1); /* "pglast/ast.pyx":980 * * cdef create_AlterTableSpaceOptionsStmt(structs.AlterTableSpaceOptionsStmt* data, offset_to_index): * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_isReset = bool(data.isReset) */ __pyx_t_2 = (__pyx_v_data->tablespacename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->tablespacename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 980, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tablespacename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":981 * cdef create_AlterTableSpaceOptionsStmt(structs.AlterTableSpaceOptionsStmt* data, offset_to_index): * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_isReset = bool(data.isReset) * return ast.AlterTableSpaceOptionsStmt(v_tablespacename, v_options, v_isReset) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 981, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":982 * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_isReset = bool(data.isReset) # <<<<<<<<<<<<<< * return ast.AlterTableSpaceOptionsStmt(v_tablespacename, v_options, v_isReset) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isReset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isReset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":983 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_isReset = bool(data.isReset) * return ast.AlterTableSpaceOptionsStmt(v_tablespacename, v_options, v_isReset) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterTableSpaceOptionsStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_tablespacename, __pyx_v_v_options, __pyx_v_v_isReset}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":979 * * * cdef create_AlterTableSpaceOptionsStmt(structs.AlterTableSpaceOptionsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_tablespacename = data.tablespacename.decode("utf-8") if data.tablespacename is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterTableSpaceOptionsStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_tablespacename); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_isReset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":986 * * * cdef create_AlterTableMoveAllStmt(structs.AlterTableMoveAllStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_orig_tablespacename = data.orig_tablespacename.decode("utf-8") if data.orig_tablespacename is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTableMoveAllStmt(AlterTableMoveAllStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_orig_tablespacename = 0; PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_roles = 0; PyObject *__pyx_v_v_new_tablespacename = 0; PyObject *__pyx_v_v_nowait = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTableMoveAllStmt", 1); /* "pglast/ast.pyx":987 * * cdef create_AlterTableMoveAllStmt(structs.AlterTableMoveAllStmt* data, offset_to_index): * cdef object v_orig_tablespacename = data.orig_tablespacename.decode("utf-8") if data.orig_tablespacename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->orig_tablespacename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->orig_tablespacename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 987, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_orig_tablespacename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":988 * cdef create_AlterTableMoveAllStmt(structs.AlterTableMoveAllStmt* data, offset_to_index): * cdef object v_orig_tablespacename = data.orig_tablespacename.decode("utf-8") if data.orig_tablespacename is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_new_tablespacename = data.new_tablespacename.decode("utf-8") if data.new_tablespacename is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":989 * cdef object v_orig_tablespacename = data.orig_tablespacename.decode("utf-8") if data.orig_tablespacename is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_new_tablespacename = data.new_tablespacename.decode("utf-8") if data.new_tablespacename is not NULL else None * cdef object v_nowait = bool(data.nowait) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 989, __pyx_L1_error) __pyx_v_v_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":990 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_new_tablespacename = data.new_tablespacename.decode("utf-8") if data.new_tablespacename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_nowait = bool(data.nowait) * return ast.AlterTableMoveAllStmt(v_orig_tablespacename, v_objtype, v_roles, v_new_tablespacename, v_nowait) */ __pyx_t_2 = (__pyx_v_data->new_tablespacename != NULL); if (__pyx_t_2) { __pyx_t_9 = __pyx_v_data->new_tablespacename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 990, __pyx_L1_error) __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_new_tablespacename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":991 * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_new_tablespacename = data.new_tablespacename.decode("utf-8") if data.new_tablespacename is not NULL else None * cdef object v_nowait = bool(data.nowait) # <<<<<<<<<<<<<< * return ast.AlterTableMoveAllStmt(v_orig_tablespacename, v_objtype, v_roles, v_new_tablespacename, v_nowait) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_nowait = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":992 * cdef object v_new_tablespacename = data.new_tablespacename.decode("utf-8") if data.new_tablespacename is not NULL else None * cdef object v_nowait = bool(data.nowait) * return ast.AlterTableMoveAllStmt(v_orig_tablespacename, v_objtype, v_roles, v_new_tablespacename, v_nowait) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_AlterTableMoveAllStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_6, __pyx_v_v_orig_tablespacename, __pyx_v_v_objtype, __pyx_v_v_roles, __pyx_v_v_new_tablespacename, __pyx_v_v_nowait}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":986 * * * cdef create_AlterTableMoveAllStmt(structs.AlterTableMoveAllStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_orig_tablespacename = data.orig_tablespacename.decode("utf-8") if data.orig_tablespacename is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_AlterTableMoveAllStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_orig_tablespacename); __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_roles); __Pyx_XDECREF(__pyx_v_v_new_tablespacename); __Pyx_XDECREF(__pyx_v_v_nowait); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":995 * * * cdef create_CreateExtensionStmt(structs.CreateExtensionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateExtensionStmt(CreateExtensionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_extname = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateExtensionStmt", 1); /* "pglast/ast.pyx":996 * * cdef create_CreateExtensionStmt(structs.CreateExtensionStmt* data, offset_to_index): * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->extname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->extname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 996, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_extname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":997 * cdef create_CreateExtensionStmt(structs.CreateExtensionStmt* data, offset_to_index): * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateExtensionStmt(v_extname, v_if_not_exists, v_options) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":998 * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateExtensionStmt(v_extname, v_if_not_exists, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 998, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":999 * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateExtensionStmt(v_extname, v_if_not_exists, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateExtensionStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_extname, __pyx_v_v_if_not_exists, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":995 * * * cdef create_CreateExtensionStmt(structs.CreateExtensionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateExtensionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_extname); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1002 * * * cdef create_AlterExtensionStmt(structs.AlterExtensionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterExtensionStmt(AlterExtensionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_extname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterExtensionStmt", 1); /* "pglast/ast.pyx":1003 * * cdef create_AlterExtensionStmt(structs.AlterExtensionStmt* data, offset_to_index): * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterExtensionStmt(v_extname, v_options) */ __pyx_t_2 = (__pyx_v_data->extname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->extname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1003, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_extname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1004 * cdef create_AlterExtensionStmt(structs.AlterExtensionStmt* data, offset_to_index): * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterExtensionStmt(v_extname, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1004, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1005 * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterExtensionStmt(v_extname, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterExtensionStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_extname, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1002 * * * cdef create_AlterExtensionStmt(structs.AlterExtensionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterExtensionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_extname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1008 * * * cdef create_AlterExtensionContentsStmt(structs.AlterExtensionContentsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_action = data.action */ static PyObject *__pyx_f_6pglast_6parser_create_AlterExtensionContentsStmt(AlterExtensionContentsStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_extname = 0; PyObject *__pyx_v_v_action = 0; PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterExtensionContentsStmt", 1); /* "pglast/ast.pyx":1009 * * cdef create_AlterExtensionContentsStmt(structs.AlterExtensionContentsStmt* data, offset_to_index): * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_action = data.action * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) */ __pyx_t_2 = (__pyx_v_data->extname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->extname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1009, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_extname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1010 * cdef create_AlterExtensionContentsStmt(structs.AlterExtensionContentsStmt* data, offset_to_index): * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_action = data.action # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->action); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1011 * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_action = data.action * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * return ast.AlterExtensionContentsStmt(v_extname, v_action, v_objtype, v_object) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1012 * cdef object v_action = data.action * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterExtensionContentsStmt(v_extname, v_action, v_objtype, v_object) * */ __pyx_t_2 = (__pyx_v_data->object != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1013 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * return ast.AlterExtensionContentsStmt(v_extname, v_action, v_objtype, v_object) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_AlterExtensionContentsStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_v_extname, __pyx_v_v_action, __pyx_v_v_objtype, __pyx_v_v_object}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1008 * * * cdef create_AlterExtensionContentsStmt(structs.AlterExtensionContentsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_extname = data.extname.decode("utf-8") if data.extname is not NULL else None * cdef object v_action = data.action */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_AlterExtensionContentsStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_extname); __Pyx_XDECREF(__pyx_v_v_action); __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1016 * * * cdef create_CreateFdwStmt(structs.CreateFdwStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateFdwStmt(CreateFdwStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_fdwname = 0; PyObject *__pyx_v_v_func_options = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateFdwStmt", 1); /* "pglast/ast.pyx":1017 * * cdef create_CreateFdwStmt(structs.CreateFdwStmt* data, offset_to_index): * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->fdwname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->fdwname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1017, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_fdwname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1018 * cdef create_CreateFdwStmt(structs.CreateFdwStmt* data, offset_to_index): * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateFdwStmt(v_fdwname, v_func_options, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->func_options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1018, __pyx_L1_error) __pyx_v_v_func_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1019 * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateFdwStmt(v_fdwname, v_func_options, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1019, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1020 * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateFdwStmt(v_fdwname, v_func_options, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateFdwStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_fdwname, __pyx_v_v_func_options, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1016 * * * cdef create_CreateFdwStmt(structs.CreateFdwStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateFdwStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_fdwname); __Pyx_XDECREF(__pyx_v_v_func_options); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1023 * * * cdef create_AlterFdwStmt(structs.AlterFdwStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterFdwStmt(AlterFdwStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_fdwname = 0; PyObject *__pyx_v_v_func_options = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterFdwStmt", 1); /* "pglast/ast.pyx":1024 * * cdef create_AlterFdwStmt(structs.AlterFdwStmt* data, offset_to_index): * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->fdwname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->fdwname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1024, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_fdwname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1025 * cdef create_AlterFdwStmt(structs.AlterFdwStmt* data, offset_to_index): * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterFdwStmt(v_fdwname, v_func_options, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->func_options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1025, __pyx_L1_error) __pyx_v_v_func_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1026 * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterFdwStmt(v_fdwname, v_func_options, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1026, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1027 * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterFdwStmt(v_fdwname, v_func_options, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterFdwStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_fdwname, __pyx_v_v_func_options, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1023 * * * cdef create_AlterFdwStmt(structs.AlterFdwStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef tuple v_func_options = _pg_list_to_tuple(data.func_options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterFdwStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_fdwname); __Pyx_XDECREF(__pyx_v_v_func_options); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1030 * * * cdef create_CreateForeignServerStmt(structs.CreateForeignServerStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateForeignServerStmt(CreateForeignServerStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_servername = 0; PyObject *__pyx_v_v_servertype = 0; PyObject *__pyx_v_v_version = 0; PyObject *__pyx_v_v_fdwname = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; char const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateForeignServerStmt", 1); /* "pglast/ast.pyx":1031 * * cdef create_CreateForeignServerStmt(structs.CreateForeignServerStmt* data, offset_to_index): * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None # <<<<<<<<<<<<<< * cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None */ __pyx_t_2 = (__pyx_v_data->servername != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->servername; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1031, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1032 * cdef create_CreateForeignServerStmt(structs.CreateForeignServerStmt* data, offset_to_index): * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None # <<<<<<<<<<<<<< * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None */ __pyx_t_2 = (__pyx_v_data->servertype != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->servertype; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1032, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servertype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1033 * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None # <<<<<<<<<<<<<< * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_2 = (__pyx_v_data->version != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->version; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1033, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_version = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1034 * cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->fdwname != NULL); if (__pyx_t_2) { __pyx_t_8 = __pyx_v_data->fdwname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_8); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1034, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_8, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_fdwname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1035 * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateForeignServerStmt(v_servername, v_servertype, v_version, v_fdwname, v_if_not_exists, v_options) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1036 * cdef object v_fdwname = data.fdwname.decode("utf-8") if data.fdwname is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateForeignServerStmt(v_servername, v_servertype, v_version, v_fdwname, v_if_not_exists, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1036, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1037 * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateForeignServerStmt(v_servername, v_servertype, v_version, v_fdwname, v_if_not_exists, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateForeignServerStmt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_v_servername, __pyx_v_v_servertype, __pyx_v_v_version, __pyx_v_v_fdwname, __pyx_v_v_if_not_exists, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 6+__pyx_t_10); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1030 * * * cdef create_CreateForeignServerStmt(structs.CreateForeignServerStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_servertype = data.servertype.decode("utf-8") if data.servertype is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pglast.parser.create_CreateForeignServerStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_servername); __Pyx_XDECREF(__pyx_v_v_servertype); __Pyx_XDECREF(__pyx_v_v_version); __Pyx_XDECREF(__pyx_v_v_fdwname); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1040 * * * cdef create_AlterForeignServerStmt(structs.AlterForeignServerStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterForeignServerStmt(AlterForeignServerStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_servername = 0; PyObject *__pyx_v_v_version = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_has_version = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterForeignServerStmt", 1); /* "pglast/ast.pyx":1041 * * cdef create_AlterForeignServerStmt(structs.AlterForeignServerStmt* data, offset_to_index): * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None # <<<<<<<<<<<<<< * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->servername != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->servername; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1041, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1042 * cdef create_AlterForeignServerStmt(structs.AlterForeignServerStmt* data, offset_to_index): * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_has_version = bool(data.has_version) */ __pyx_t_2 = (__pyx_v_data->version != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->version; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1042, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_version = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1043 * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_has_version = bool(data.has_version) * return ast.AlterForeignServerStmt(v_servername, v_version, v_options, v_has_version) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1043, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1044 * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_has_version = bool(data.has_version) # <<<<<<<<<<<<<< * return ast.AlterForeignServerStmt(v_servername, v_version, v_options, v_has_version) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->has_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_has_version = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1045 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_has_version = bool(data.has_version) * return ast.AlterForeignServerStmt(v_servername, v_version, v_options, v_has_version) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterForeignServerStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_servername, __pyx_v_v_version, __pyx_v_v_options, __pyx_v_v_has_version}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1040 * * * cdef create_AlterForeignServerStmt(structs.AlterForeignServerStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_version = data.version.decode("utf-8") if data.version is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_AlterForeignServerStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_servername); __Pyx_XDECREF(__pyx_v_v_version); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_has_version); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1048 * * * cdef create_CreateForeignTableStmt(structs.CreateForeignTableStmt* data, offset_to_index): # <<<<<<<<<<<<<< * * cdef object v_base = create_CreateStmt( data, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateForeignTableStmt(CreateForeignTableStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_base = 0; PyObject *__pyx_v_v_servername = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateForeignTableStmt", 1); /* "pglast/ast.pyx":1050 * cdef create_CreateForeignTableStmt(structs.CreateForeignTableStmt* data, offset_to_index): * * cdef object v_base = create_CreateStmt( data, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser_create_CreateStmt(((CreateStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_base = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1051 * * cdef object v_base = create_CreateStmt( data, offset_to_index) * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateForeignTableStmt(v_base, v_servername, v_options) */ __pyx_t_2 = (__pyx_v_data->servername != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->servername; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1051, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1052 * cdef object v_base = create_CreateStmt( data, offset_to_index) * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateForeignTableStmt(v_base, v_servername, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1052, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1053 * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateForeignTableStmt(v_base, v_servername, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateForeignTableStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_base, __pyx_v_v_servername, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1048 * * * cdef create_CreateForeignTableStmt(structs.CreateForeignTableStmt* data, offset_to_index): # <<<<<<<<<<<<<< * * cdef object v_base = create_CreateStmt( data, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateForeignTableStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_base); __Pyx_XDECREF(__pyx_v_v_servername); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1056 * * * cdef create_CreateUserMappingStmt(structs.CreateUserMappingStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateUserMappingStmt(CreateUserMappingStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_user = 0; PyObject *__pyx_v_v_servername = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateUserMappingStmt", 1); /* "pglast/ast.pyx":1057 * * cdef create_CreateUserMappingStmt(structs.CreateUserMappingStmt* data, offset_to_index): * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_2 = (__pyx_v_data->user != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->user, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_user = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1058 * cdef create_CreateUserMappingStmt(structs.CreateUserMappingStmt* data, offset_to_index): * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->servername != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->servername; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1058, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1059 * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateUserMappingStmt(v_user, v_servername, v_if_not_exists, v_options) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1060 * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateUserMappingStmt(v_user, v_servername, v_if_not_exists, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1060, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1061 * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateUserMappingStmt(v_user, v_servername, v_if_not_exists, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateUserMappingStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_user, __pyx_v_v_servername, __pyx_v_v_if_not_exists, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1056 * * * cdef create_CreateUserMappingStmt(structs.CreateUserMappingStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateUserMappingStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_user); __Pyx_XDECREF(__pyx_v_v_servername); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1064 * * * cdef create_AlterUserMappingStmt(structs.AlterUserMappingStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterUserMappingStmt(AlterUserMappingStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_user = 0; PyObject *__pyx_v_v_servername = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterUserMappingStmt", 1); /* "pglast/ast.pyx":1065 * * cdef create_AlterUserMappingStmt(structs.AlterUserMappingStmt* data, offset_to_index): * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->user != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->user, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_user = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1066 * cdef create_AlterUserMappingStmt(structs.AlterUserMappingStmt* data, offset_to_index): * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterUserMappingStmt(v_user, v_servername, v_options) */ __pyx_t_2 = (__pyx_v_data->servername != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->servername; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1066, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1067 * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterUserMappingStmt(v_user, v_servername, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1067, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1068 * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterUserMappingStmt(v_user, v_servername, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterUserMappingStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_user, __pyx_v_v_servername, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1064 * * * cdef create_AlterUserMappingStmt(structs.AlterUserMappingStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterUserMappingStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_user); __Pyx_XDECREF(__pyx_v_v_servername); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1071 * * * cdef create_DropUserMappingStmt(structs.DropUserMappingStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_DropUserMappingStmt(DropUserMappingStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_user = 0; PyObject *__pyx_v_v_servername = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropUserMappingStmt", 1); /* "pglast/ast.pyx":1072 * * cdef create_DropUserMappingStmt(structs.DropUserMappingStmt* data, offset_to_index): * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None # <<<<<<<<<<<<<< * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_2 = (__pyx_v_data->user != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->user, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_user = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1073 * cdef create_DropUserMappingStmt(structs.DropUserMappingStmt* data, offset_to_index): * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.DropUserMappingStmt(v_user, v_servername, v_missing_ok) */ __pyx_t_2 = (__pyx_v_data->servername != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->servername; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1073, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_servername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1074 * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.DropUserMappingStmt(v_user, v_servername, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1075 * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) * return ast.DropUserMappingStmt(v_user, v_servername, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DropUserMappingStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_user, __pyx_v_v_servername, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1071 * * * cdef create_DropUserMappingStmt(structs.DropUserMappingStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_user = create(data.user, offset_to_index) if data.user is not NULL else None * cdef object v_servername = data.servername.decode("utf-8") if data.servername is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_DropUserMappingStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_user); __Pyx_XDECREF(__pyx_v_v_servername); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1078 * * * cdef create_ImportForeignSchemaStmt(structs.ImportForeignSchemaStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_server_name = data.server_name.decode("utf-8") if data.server_name is not NULL else None * cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ImportForeignSchemaStmt(ImportForeignSchemaStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_server_name = 0; PyObject *__pyx_v_v_remote_schema = 0; PyObject *__pyx_v_v_local_schema = 0; PyObject *__pyx_v_v_list_type = 0; PyObject *__pyx_v_v_table_list = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ImportForeignSchemaStmt", 1); /* "pglast/ast.pyx":1079 * * cdef create_ImportForeignSchemaStmt(structs.ImportForeignSchemaStmt* data, offset_to_index): * cdef object v_server_name = data.server_name.decode("utf-8") if data.server_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None * cdef object v_local_schema = data.local_schema.decode("utf-8") if data.local_schema is not NULL else None */ __pyx_t_2 = (__pyx_v_data->server_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->server_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1079, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1079, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_server_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1080 * cdef create_ImportForeignSchemaStmt(structs.ImportForeignSchemaStmt* data, offset_to_index): * cdef object v_server_name = data.server_name.decode("utf-8") if data.server_name is not NULL else None * cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None # <<<<<<<<<<<<<< * cdef object v_local_schema = data.local_schema.decode("utf-8") if data.local_schema is not NULL else None * cdef object v_list_type = getattr(enums, 'ImportForeignSchemaType')(data.list_type) */ __pyx_t_2 = (__pyx_v_data->remote_schema != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->remote_schema; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1080, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_remote_schema = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1081 * cdef object v_server_name = data.server_name.decode("utf-8") if data.server_name is not NULL else None * cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None * cdef object v_local_schema = data.local_schema.decode("utf-8") if data.local_schema is not NULL else None # <<<<<<<<<<<<<< * cdef object v_list_type = getattr(enums, 'ImportForeignSchemaType')(data.list_type) * cdef tuple v_table_list = _pg_list_to_tuple(data.table_list, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->local_schema != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->local_schema; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1081, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_local_schema = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1082 * cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None * cdef object v_local_schema = data.local_schema.decode("utf-8") if data.local_schema is not NULL else None * cdef object v_list_type = getattr(enums, 'ImportForeignSchemaType')(data.list_type) # <<<<<<<<<<<<<< * cdef tuple v_table_list = _pg_list_to_tuple(data.table_list, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_ImportForeignSchemaType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_ImportForeignSchemaType(__pyx_v_data->list_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_v_list_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1083 * cdef object v_local_schema = data.local_schema.decode("utf-8") if data.local_schema is not NULL else None * cdef object v_list_type = getattr(enums, 'ImportForeignSchemaType')(data.list_type) * cdef tuple v_table_list = _pg_list_to_tuple(data.table_list, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.ImportForeignSchemaStmt(v_server_name, v_remote_schema, v_local_schema, v_list_type, v_table_list, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->table_list, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1083, __pyx_L1_error) __pyx_v_v_table_list = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1084 * cdef object v_list_type = getattr(enums, 'ImportForeignSchemaType')(data.list_type) * cdef tuple v_table_list = _pg_list_to_tuple(data.table_list, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.ImportForeignSchemaStmt(v_server_name, v_remote_schema, v_local_schema, v_list_type, v_table_list, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1084, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1085 * cdef tuple v_table_list = _pg_list_to_tuple(data.table_list, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.ImportForeignSchemaStmt(v_server_name, v_remote_schema, v_local_schema, v_list_type, v_table_list, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ast); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ImportForeignSchemaStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_8, __pyx_v_v_server_name, __pyx_v_v_remote_schema, __pyx_v_v_local_schema, __pyx_v_v_list_type, __pyx_v_v_table_list, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 6+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1078 * * * cdef create_ImportForeignSchemaStmt(structs.ImportForeignSchemaStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_server_name = data.server_name.decode("utf-8") if data.server_name is not NULL else None * cdef object v_remote_schema = data.remote_schema.decode("utf-8") if data.remote_schema is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pglast.parser.create_ImportForeignSchemaStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_server_name); __Pyx_XDECREF(__pyx_v_v_remote_schema); __Pyx_XDECREF(__pyx_v_v_local_schema); __Pyx_XDECREF(__pyx_v_v_list_type); __Pyx_XDECREF(__pyx_v_v_table_list); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1088 * * * cdef create_CreatePolicyStmt(structs.CreatePolicyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreatePolicyStmt(CreatePolicyStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_policy_name = 0; PyObject *__pyx_v_v_table = 0; PyObject *__pyx_v_v_cmd_name = 0; PyObject *__pyx_v_v_permissive = 0; PyObject *__pyx_v_v_roles = 0; PyObject *__pyx_v_v_qual = 0; PyObject *__pyx_v_v_with_check = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreatePolicyStmt", 1); /* "pglast/ast.pyx":1089 * * cdef create_CreatePolicyStmt(structs.CreatePolicyStmt* data, offset_to_index): * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None * cdef object v_cmd_name = data.cmd_name.decode("utf-8") if data.cmd_name is not NULL else None */ __pyx_t_2 = (__pyx_v_data->policy_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->policy_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1089, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_policy_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1090 * cdef create_CreatePolicyStmt(structs.CreatePolicyStmt* data, offset_to_index): * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cmd_name = data.cmd_name.decode("utf-8") if data.cmd_name is not NULL else None * cdef object v_permissive = bool(data.permissive) */ __pyx_t_2 = (__pyx_v_data->table != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->table, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_table = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1091 * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None * cdef object v_cmd_name = data.cmd_name.decode("utf-8") if data.cmd_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_permissive = bool(data.permissive) * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->cmd_name != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->cmd_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1091, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cmd_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1092 * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None * cdef object v_cmd_name = data.cmd_name.decode("utf-8") if data.cmd_name is not NULL else None * cdef object v_permissive = bool(data.permissive) # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->permissive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_permissive = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1093 * cdef object v_cmd_name = data.cmd_name.decode("utf-8") if data.cmd_name is not NULL else None * cdef object v_permissive = bool(data.permissive) * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1093, __pyx_L1_error) __pyx_v_v_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1094 * cdef object v_permissive = bool(data.permissive) * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None # <<<<<<<<<<<<<< * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None * return ast.CreatePolicyStmt(v_policy_name, v_table, v_cmd_name, v_permissive, v_roles, v_qual, v_with_check) */ __pyx_t_2 = (__pyx_v_data->qual != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->qual, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_qual = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1095 * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None # <<<<<<<<<<<<<< * return ast.CreatePolicyStmt(v_policy_name, v_table, v_cmd_name, v_permissive, v_roles, v_qual, v_with_check) * */ __pyx_t_2 = (__pyx_v_data->with_check != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->with_check, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_with_check = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1096 * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None * return ast.CreatePolicyStmt(v_policy_name, v_table, v_cmd_name, v_permissive, v_roles, v_qual, v_with_check) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreatePolicyStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_5, __pyx_v_v_policy_name, __pyx_v_v_table, __pyx_v_v_cmd_name, __pyx_v_v_permissive, __pyx_v_v_roles, __pyx_v_v_qual, __pyx_v_v_with_check}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1088 * * * cdef create_CreatePolicyStmt(structs.CreatePolicyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CreatePolicyStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_policy_name); __Pyx_XDECREF(__pyx_v_v_table); __Pyx_XDECREF(__pyx_v_v_cmd_name); __Pyx_XDECREF(__pyx_v_v_permissive); __Pyx_XDECREF(__pyx_v_v_roles); __Pyx_XDECREF(__pyx_v_v_qual); __Pyx_XDECREF(__pyx_v_v_with_check); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1099 * * * cdef create_AlterPolicyStmt(structs.AlterPolicyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterPolicyStmt(AlterPolicyStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_policy_name = 0; PyObject *__pyx_v_v_table = 0; PyObject *__pyx_v_v_roles = 0; PyObject *__pyx_v_v_qual = 0; PyObject *__pyx_v_v_with_check = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterPolicyStmt", 1); /* "pglast/ast.pyx":1100 * * cdef create_AlterPolicyStmt(structs.AlterPolicyStmt* data, offset_to_index): * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->policy_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->policy_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1100, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_policy_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1101 * cdef create_AlterPolicyStmt(structs.AlterPolicyStmt* data, offset_to_index): * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None */ __pyx_t_2 = (__pyx_v_data->table != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->table, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_table = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1102 * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1102, __pyx_L1_error) __pyx_v_v_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1103 * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None # <<<<<<<<<<<<<< * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None * return ast.AlterPolicyStmt(v_policy_name, v_table, v_roles, v_qual, v_with_check) */ __pyx_t_2 = (__pyx_v_data->qual != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->qual, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_qual = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1104 * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterPolicyStmt(v_policy_name, v_table, v_roles, v_qual, v_with_check) * */ __pyx_t_2 = (__pyx_v_data->with_check != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->with_check, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_with_check = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1105 * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef object v_with_check = create(data.with_check, offset_to_index) if data.with_check is not NULL else None * return ast.AlterPolicyStmt(v_policy_name, v_table, v_roles, v_qual, v_with_check) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterPolicyStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_v_v_policy_name, __pyx_v_v_table, __pyx_v_v_roles, __pyx_v_v_qual, __pyx_v_v_with_check}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 5+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1099 * * * cdef create_AlterPolicyStmt(structs.AlterPolicyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_policy_name = data.policy_name.decode("utf-8") if data.policy_name is not NULL else None * cdef object v_table = create(data.table, offset_to_index) if data.table is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterPolicyStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_policy_name); __Pyx_XDECREF(__pyx_v_v_table); __Pyx_XDECREF(__pyx_v_v_roles); __Pyx_XDECREF(__pyx_v_v_qual); __Pyx_XDECREF(__pyx_v_v_with_check); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1108 * * * cdef create_CreateAmStmt(structs.CreateAmStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateAmStmt(CreateAmStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_amname = 0; PyObject *__pyx_v_v_handler_name = 0; PyObject *__pyx_v_v_amtype = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateAmStmt", 1); /* "pglast/ast.pyx":1109 * * cdef create_CreateAmStmt(structs.CreateAmStmt* data, offset_to_index): * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) * cdef object v_amtype = chr(data.amtype) */ __pyx_t_2 = (__pyx_v_data->amname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->amname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1109, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_amname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1110 * cdef create_CreateAmStmt(structs.CreateAmStmt* data, offset_to_index): * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_amtype = chr(data.amtype) * return ast.CreateAmStmt(v_amname, v_handler_name, v_amtype) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->handler_name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1110, __pyx_L1_error) __pyx_v_v_handler_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1111 * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) * cdef object v_amtype = chr(data.amtype) # <<<<<<<<<<<<<< * return ast.CreateAmStmt(v_amname, v_handler_name, v_amtype) * */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->amtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_amtype = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":1112 * cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) * cdef object v_amtype = chr(data.amtype) * return ast.CreateAmStmt(v_amname, v_handler_name, v_amtype) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CreateAmStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_v_amname, __pyx_v_v_handler_name, __pyx_v_v_amtype}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1108 * * * cdef create_CreateAmStmt(structs.CreateAmStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef tuple v_handler_name = _pg_list_to_tuple(data.handler_name, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateAmStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_amname); __Pyx_XDECREF(__pyx_v_v_handler_name); __Pyx_XDECREF(__pyx_v_v_amtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1115 * * * cdef create_CreateTrigStmt(structs.CreateTrigStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_isconstraint = bool(data.isconstraint) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateTrigStmt(CreateTrigStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_v_v_isconstraint = 0; PyObject *__pyx_v_v_trigname = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_funcname = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_row = 0; PyObject *__pyx_v_v_timing = 0; PyObject *__pyx_v_v_events = 0; PyObject *__pyx_v_v_columns = 0; PyObject *__pyx_v_v_whenClause = 0; PyObject *__pyx_v_v_transitionRels = 0; PyObject *__pyx_v_v_deferrable = 0; PyObject *__pyx_v_v_initdeferred = 0; PyObject *__pyx_v_v_constrrel = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateTrigStmt", 1); /* "pglast/ast.pyx":1116 * * cdef create_CreateTrigStmt(structs.CreateTrigStmt* data, offset_to_index): * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * cdef object v_isconstraint = bool(data.isconstraint) * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1117 * cdef create_CreateTrigStmt(structs.CreateTrigStmt* data, offset_to_index): * cdef object v_replace = bool(data.replace) * cdef object v_isconstraint = bool(data.isconstraint) # <<<<<<<<<<<<<< * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isconstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isconstraint = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1118 * cdef object v_replace = bool(data.replace) * cdef object v_isconstraint = bool(data.isconstraint) * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->trigname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->trigname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1118, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_trigname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1119 * cdef object v_isconstraint = bool(data.isconstraint) * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1120 * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row = bool(data.row) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funcname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1120, __pyx_L1_error) __pyx_v_v_funcname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1121 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_row = bool(data.row) * cdef object v_timing = data.timing */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1121, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1122 * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row = bool(data.row) # <<<<<<<<<<<<<< * cdef object v_timing = data.timing * cdef object v_events = data.events */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->row); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_row = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1123 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row = bool(data.row) * cdef object v_timing = data.timing # <<<<<<<<<<<<<< * cdef object v_events = data.events * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_data->timing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_timing = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1124 * cdef object v_row = bool(data.row) * cdef object v_timing = data.timing * cdef object v_events = data.events # <<<<<<<<<<<<<< * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_whenClause = create(data.whenClause, offset_to_index) if data.whenClause is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_data->events); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_events = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1125 * cdef object v_timing = data.timing * cdef object v_events = data.events * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whenClause = create(data.whenClause, offset_to_index) if data.whenClause is not NULL else None * cdef tuple v_transitionRels = _pg_list_to_tuple(data.transitionRels, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->columns, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1125, __pyx_L1_error) __pyx_v_v_columns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1126 * cdef object v_events = data.events * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_whenClause = create(data.whenClause, offset_to_index) if data.whenClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_transitionRels = _pg_list_to_tuple(data.transitionRels, offset_to_index) * cdef object v_deferrable = bool(data.deferrable) */ __pyx_t_2 = (__pyx_v_data->whenClause != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whenClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whenClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1127 * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * cdef object v_whenClause = create(data.whenClause, offset_to_index) if data.whenClause is not NULL else None * cdef tuple v_transitionRels = _pg_list_to_tuple(data.transitionRels, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->transitionRels, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1127, __pyx_L1_error) __pyx_v_v_transitionRels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1128 * cdef object v_whenClause = create(data.whenClause, offset_to_index) if data.whenClause is not NULL else None * cdef tuple v_transitionRels = _pg_list_to_tuple(data.transitionRels, offset_to_index) * cdef object v_deferrable = bool(data.deferrable) # <<<<<<<<<<<<<< * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_constrrel = create(data.constrrel, offset_to_index) if data.constrrel is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->deferrable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_deferrable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1129 * cdef tuple v_transitionRels = _pg_list_to_tuple(data.transitionRels, offset_to_index) * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) # <<<<<<<<<<<<<< * cdef object v_constrrel = create(data.constrrel, offset_to_index) if data.constrrel is not NULL else None * return ast.CreateTrigStmt(v_replace, v_isconstraint, v_trigname, v_relation, v_funcname, v_args, v_row, v_timing, v_events, v_columns, v_whenClause, v_transitionRels, v_deferrable, v_initdeferred, v_constrrel) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->initdeferred); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_initdeferred = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1130 * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_constrrel = create(data.constrrel, offset_to_index) if data.constrrel is not NULL else None # <<<<<<<<<<<<<< * return ast.CreateTrigStmt(v_replace, v_isconstraint, v_trigname, v_relation, v_funcname, v_args, v_row, v_timing, v_events, v_columns, v_whenClause, v_transitionRels, v_deferrable, v_initdeferred, v_constrrel) * */ __pyx_t_2 = (__pyx_v_data->constrrel != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->constrrel, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_constrrel = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1131 * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_constrrel = create(data.constrrel, offset_to_index) if data.constrrel is not NULL else None * return ast.CreateTrigStmt(v_replace, v_isconstraint, v_trigname, v_relation, v_funcname, v_args, v_row, v_timing, v_events, v_columns, v_whenClause, v_transitionRels, v_deferrable, v_initdeferred, v_constrrel) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateTrigStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[16] = {__pyx_t_5, __pyx_v_v_replace, __pyx_v_v_isconstraint, __pyx_v_v_trigname, __pyx_v_v_relation, __pyx_v_v_funcname, __pyx_v_v_args, __pyx_v_v_row, __pyx_v_v_timing, __pyx_v_v_events, __pyx_v_v_columns, __pyx_v_v_whenClause, __pyx_v_v_transitionRels, __pyx_v_v_deferrable, __pyx_v_v_initdeferred, __pyx_v_v_constrrel}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 15+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1115 * * * cdef create_CreateTrigStmt(structs.CreateTrigStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_isconstraint = bool(data.isconstraint) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateTrigStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XDECREF(__pyx_v_v_isconstraint); __Pyx_XDECREF(__pyx_v_v_trigname); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_funcname); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_row); __Pyx_XDECREF(__pyx_v_v_timing); __Pyx_XDECREF(__pyx_v_v_events); __Pyx_XDECREF(__pyx_v_v_columns); __Pyx_XDECREF(__pyx_v_v_whenClause); __Pyx_XDECREF(__pyx_v_v_transitionRels); __Pyx_XDECREF(__pyx_v_v_deferrable); __Pyx_XDECREF(__pyx_v_v_initdeferred); __Pyx_XDECREF(__pyx_v_v_constrrel); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1134 * * * cdef create_CreateEventTrigStmt(structs.CreateEventTrigStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateEventTrigStmt(CreateEventTrigStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_trigname = 0; PyObject *__pyx_v_v_eventname = 0; PyObject *__pyx_v_v_whenclause = 0; PyObject *__pyx_v_v_funcname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateEventTrigStmt", 1); /* "pglast/ast.pyx":1135 * * cdef create_CreateEventTrigStmt(structs.CreateEventTrigStmt* data, offset_to_index): * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None * cdef tuple v_whenclause = _pg_list_to_tuple(data.whenclause, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->trigname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->trigname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1135, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_trigname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1136 * cdef create_CreateEventTrigStmt(structs.CreateEventTrigStmt* data, offset_to_index): * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_whenclause = _pg_list_to_tuple(data.whenclause, offset_to_index) * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->eventname != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->eventname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1136, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_eventname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1137 * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None * cdef tuple v_whenclause = _pg_list_to_tuple(data.whenclause, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * return ast.CreateEventTrigStmt(v_trigname, v_eventname, v_whenclause, v_funcname) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->whenclause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1137, __pyx_L1_error) __pyx_v_v_whenclause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1138 * cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None * cdef tuple v_whenclause = _pg_list_to_tuple(data.whenclause, offset_to_index) * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateEventTrigStmt(v_trigname, v_eventname, v_whenclause, v_funcname) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funcname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1138, __pyx_L1_error) __pyx_v_v_funcname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1139 * cdef tuple v_whenclause = _pg_list_to_tuple(data.whenclause, offset_to_index) * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * return ast.CreateEventTrigStmt(v_trigname, v_eventname, v_whenclause, v_funcname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateEventTrigStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_trigname, __pyx_v_v_eventname, __pyx_v_v_whenclause, __pyx_v_v_funcname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1134 * * * cdef create_CreateEventTrigStmt(structs.CreateEventTrigStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_eventname = data.eventname.decode("utf-8") if data.eventname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CreateEventTrigStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_trigname); __Pyx_XDECREF(__pyx_v_v_eventname); __Pyx_XDECREF(__pyx_v_v_whenclause); __Pyx_XDECREF(__pyx_v_v_funcname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1142 * * * cdef create_AlterEventTrigStmt(structs.AlterEventTrigStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_tgenabled = chr(data.tgenabled) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterEventTrigStmt(AlterEventTrigStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_trigname = 0; PyObject *__pyx_v_v_tgenabled = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterEventTrigStmt", 1); /* "pglast/ast.pyx":1143 * * cdef create_AlterEventTrigStmt(structs.AlterEventTrigStmt* data, offset_to_index): * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_tgenabled = chr(data.tgenabled) * return ast.AlterEventTrigStmt(v_trigname, v_tgenabled) */ __pyx_t_2 = (__pyx_v_data->trigname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->trigname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1143, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_trigname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1144 * cdef create_AlterEventTrigStmt(structs.AlterEventTrigStmt* data, offset_to_index): * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_tgenabled = chr(data.tgenabled) # <<<<<<<<<<<<<< * return ast.AlterEventTrigStmt(v_trigname, v_tgenabled) * */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->tgenabled); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_tgenabled = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":1145 * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_tgenabled = chr(data.tgenabled) * return ast.AlterEventTrigStmt(v_trigname, v_tgenabled) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AlterEventTrigStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_v_trigname, __pyx_v_v_tgenabled}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1142 * * * cdef create_AlterEventTrigStmt(structs.AlterEventTrigStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_trigname = data.trigname.decode("utf-8") if data.trigname is not NULL else None * cdef object v_tgenabled = chr(data.tgenabled) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterEventTrigStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_trigname); __Pyx_XDECREF(__pyx_v_v_tgenabled); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1148 * * * cdef create_CreatePLangStmt(structs.CreatePLangStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreatePLangStmt(CreatePLangStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_v_v_plname = 0; PyObject *__pyx_v_v_plhandler = 0; PyObject *__pyx_v_v_plinline = 0; PyObject *__pyx_v_v_plvalidator = 0; PyObject *__pyx_v_v_pltrusted = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreatePLangStmt", 1); /* "pglast/ast.pyx":1149 * * cdef create_CreatePLangStmt(structs.CreatePLangStmt* data, offset_to_index): * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None * cdef tuple v_plhandler = _pg_list_to_tuple(data.plhandler, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1150 * cdef create_CreatePLangStmt(structs.CreatePLangStmt* data, offset_to_index): * cdef object v_replace = bool(data.replace) * cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_plhandler = _pg_list_to_tuple(data.plhandler, offset_to_index) * cdef tuple v_plinline = _pg_list_to_tuple(data.plinline, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->plname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->plname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1150, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_plname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1151 * cdef object v_replace = bool(data.replace) * cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None * cdef tuple v_plhandler = _pg_list_to_tuple(data.plhandler, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_plinline = _pg_list_to_tuple(data.plinline, offset_to_index) * cdef tuple v_plvalidator = _pg_list_to_tuple(data.plvalidator, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->plhandler, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1151, __pyx_L1_error) __pyx_v_v_plhandler = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1152 * cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None * cdef tuple v_plhandler = _pg_list_to_tuple(data.plhandler, offset_to_index) * cdef tuple v_plinline = _pg_list_to_tuple(data.plinline, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_plvalidator = _pg_list_to_tuple(data.plvalidator, offset_to_index) * cdef object v_pltrusted = bool(data.pltrusted) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->plinline, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1152, __pyx_L1_error) __pyx_v_v_plinline = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1153 * cdef tuple v_plhandler = _pg_list_to_tuple(data.plhandler, offset_to_index) * cdef tuple v_plinline = _pg_list_to_tuple(data.plinline, offset_to_index) * cdef tuple v_plvalidator = _pg_list_to_tuple(data.plvalidator, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_pltrusted = bool(data.pltrusted) * return ast.CreatePLangStmt(v_replace, v_plname, v_plhandler, v_plinline, v_plvalidator, v_pltrusted) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->plvalidator, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1153, __pyx_L1_error) __pyx_v_v_plvalidator = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1154 * cdef tuple v_plinline = _pg_list_to_tuple(data.plinline, offset_to_index) * cdef tuple v_plvalidator = _pg_list_to_tuple(data.plvalidator, offset_to_index) * cdef object v_pltrusted = bool(data.pltrusted) # <<<<<<<<<<<<<< * return ast.CreatePLangStmt(v_replace, v_plname, v_plhandler, v_plinline, v_plvalidator, v_pltrusted) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->pltrusted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_pltrusted = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1155 * cdef tuple v_plvalidator = _pg_list_to_tuple(data.plvalidator, offset_to_index) * cdef object v_pltrusted = bool(data.pltrusted) * return ast.CreatePLangStmt(v_replace, v_plname, v_plhandler, v_plinline, v_plvalidator, v_pltrusted) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreatePLangStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_v_replace, __pyx_v_v_plname, __pyx_v_v_plhandler, __pyx_v_v_plinline, __pyx_v_v_plvalidator, __pyx_v_v_pltrusted}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 6+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1148 * * * cdef create_CreatePLangStmt(structs.CreatePLangStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_plname = data.plname.decode("utf-8") if data.plname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreatePLangStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XDECREF(__pyx_v_v_plname); __Pyx_XDECREF(__pyx_v_v_plhandler); __Pyx_XDECREF(__pyx_v_v_plinline); __Pyx_XDECREF(__pyx_v_v_plvalidator); __Pyx_XDECREF(__pyx_v_v_pltrusted); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1158 * * * cdef create_CreateRoleStmt(structs.CreateRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_stmt_type = getattr(enums, 'RoleStmtType')(data.stmt_type) * cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateRoleStmt(CreateRoleStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_stmt_type = 0; PyObject *__pyx_v_v_role = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateRoleStmt", 1); /* "pglast/ast.pyx":1159 * * cdef create_CreateRoleStmt(structs.CreateRoleStmt* data, offset_to_index): * cdef object v_stmt_type = getattr(enums, 'RoleStmtType')(data.stmt_type) # <<<<<<<<<<<<<< * cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_RoleStmtType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_RoleStmtType(__pyx_v_data->stmt_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_stmt_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1160 * cdef create_CreateRoleStmt(structs.CreateRoleStmt* data, offset_to_index): * cdef object v_stmt_type = getattr(enums, 'RoleStmtType')(data.stmt_type) * cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateRoleStmt(v_stmt_type, v_role, v_options) */ __pyx_t_6 = (__pyx_v_data->role != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->role; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1160, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_role = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1161 * cdef object v_stmt_type = getattr(enums, 'RoleStmtType')(data.stmt_type) * cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateRoleStmt(v_stmt_type, v_role, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1161, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1162 * cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateRoleStmt(v_stmt_type, v_role, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateRoleStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_stmt_type, __pyx_v_v_role, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1158 * * * cdef create_CreateRoleStmt(structs.CreateRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_stmt_type = getattr(enums, 'RoleStmtType')(data.stmt_type) * cdef object v_role = data.role.decode("utf-8") if data.role is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CreateRoleStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_stmt_type); __Pyx_XDECREF(__pyx_v_v_role); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1165 * * * cdef create_AlterRoleStmt(structs.AlterRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterRoleStmt(AlterRoleStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_role = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_action = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterRoleStmt", 1); /* "pglast/ast.pyx":1166 * * cdef create_AlterRoleStmt(structs.AlterRoleStmt* data, offset_to_index): * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = data.action */ __pyx_t_2 = (__pyx_v_data->role != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->role, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_role = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1167 * cdef create_AlterRoleStmt(structs.AlterRoleStmt* data, offset_to_index): * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_action = data.action * return ast.AlterRoleStmt(v_role, v_options, v_action) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1167, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1168 * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = data.action # <<<<<<<<<<<<<< * return ast.AlterRoleStmt(v_role, v_options, v_action) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->action); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1169 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_action = data.action * return ast.AlterRoleStmt(v_role, v_options, v_action) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterRoleStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_role, __pyx_v_v_options, __pyx_v_v_action}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1165 * * * cdef create_AlterRoleStmt(structs.AlterRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterRoleStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_role); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_action); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1172 * * * cdef create_AlterRoleSetStmt(structs.AlterRoleSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterRoleSetStmt(AlterRoleSetStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_role = 0; PyObject *__pyx_v_v_database = 0; PyObject *__pyx_v_v_setstmt = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterRoleSetStmt", 1); /* "pglast/ast.pyx":1173 * * cdef create_AlterRoleSetStmt(structs.AlterRoleSetStmt* data, offset_to_index): * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None # <<<<<<<<<<<<<< * cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None */ __pyx_t_2 = (__pyx_v_data->role != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->role, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_role = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1174 * cdef create_AlterRoleSetStmt(structs.AlterRoleSetStmt* data, offset_to_index): * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None # <<<<<<<<<<<<<< * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterRoleSetStmt(v_role, v_database, v_setstmt) */ __pyx_t_2 = (__pyx_v_data->database != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->database; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1174, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_database = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1175 * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterRoleSetStmt(v_role, v_database, v_setstmt) * */ __pyx_t_2 = (__pyx_v_data->setstmt != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->setstmt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_setstmt = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1176 * cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterRoleSetStmt(v_role, v_database, v_setstmt) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterRoleSetStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_role, __pyx_v_v_database, __pyx_v_v_setstmt}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1172 * * * cdef create_AlterRoleSetStmt(structs.AlterRoleSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_role = create(data.role, offset_to_index) if data.role is not NULL else None * cdef object v_database = data.database.decode("utf-8") if data.database is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterRoleSetStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_role); __Pyx_XDECREF(__pyx_v_v_database); __Pyx_XDECREF(__pyx_v_v_setstmt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1179 * * * cdef create_DropRoleStmt(structs.DropRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_missing_ok = bool(data.missing_ok) */ static PyObject *__pyx_f_6pglast_6parser_create_DropRoleStmt(DropRoleStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_roles = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropRoleStmt", 1); /* "pglast/ast.pyx":1180 * * cdef create_DropRoleStmt(structs.DropRoleStmt* data, offset_to_index): * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.DropRoleStmt(v_roles, v_missing_ok) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1180, __pyx_L1_error) __pyx_v_v_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1181 * cdef create_DropRoleStmt(structs.DropRoleStmt* data, offset_to_index): * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.DropRoleStmt(v_roles, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1182 * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_missing_ok = bool(data.missing_ok) * return ast.DropRoleStmt(v_roles, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DropRoleStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_roles, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1179 * * * cdef create_DropRoleStmt(structs.DropRoleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_missing_ok = bool(data.missing_ok) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_DropRoleStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_roles); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1185 * * * cdef create_CreateSeqStmt(structs.CreateSeqStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateSeqStmt(CreateSeqStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_sequence = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_for_identity = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateSeqStmt", 1); /* "pglast/ast.pyx":1186 * * cdef create_CreateSeqStmt(structs.CreateSeqStmt* data, offset_to_index): * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_for_identity = bool(data.for_identity) */ __pyx_t_2 = (__pyx_v_data->sequence != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->sequence, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_sequence = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1187 * cdef create_CreateSeqStmt(structs.CreateSeqStmt* data, offset_to_index): * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_for_identity = bool(data.for_identity) * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1187, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1188 * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_for_identity = bool(data.for_identity) # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateSeqStmt(v_sequence, v_options, v_for_identity, v_if_not_exists) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->for_identity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_for_identity = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1189 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_for_identity = bool(data.for_identity) * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * return ast.CreateSeqStmt(v_sequence, v_options, v_for_identity, v_if_not_exists) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1190 * cdef object v_for_identity = bool(data.for_identity) * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateSeqStmt(v_sequence, v_options, v_for_identity, v_if_not_exists) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateSeqStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_sequence, __pyx_v_v_options, __pyx_v_v_for_identity, __pyx_v_v_if_not_exists}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1185 * * * cdef create_CreateSeqStmt(structs.CreateSeqStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CreateSeqStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_sequence); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_for_identity); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1193 * * * cdef create_AlterSeqStmt(structs.AlterSeqStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterSeqStmt(AlterSeqStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_sequence = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_for_identity = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterSeqStmt", 1); /* "pglast/ast.pyx":1194 * * cdef create_AlterSeqStmt(structs.AlterSeqStmt* data, offset_to_index): * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_for_identity = bool(data.for_identity) */ __pyx_t_2 = (__pyx_v_data->sequence != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->sequence, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_sequence = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1195 * cdef create_AlterSeqStmt(structs.AlterSeqStmt* data, offset_to_index): * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_for_identity = bool(data.for_identity) * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1196 * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_for_identity = bool(data.for_identity) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterSeqStmt(v_sequence, v_options, v_for_identity, v_missing_ok) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->for_identity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_for_identity = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1197 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_for_identity = bool(data.for_identity) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.AlterSeqStmt(v_sequence, v_options, v_for_identity, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1198 * cdef object v_for_identity = bool(data.for_identity) * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterSeqStmt(v_sequence, v_options, v_for_identity, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterSeqStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_sequence, __pyx_v_v_options, __pyx_v_v_for_identity, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1193 * * * cdef create_AlterSeqStmt(structs.AlterSeqStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sequence = create(data.sequence, offset_to_index) if data.sequence is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterSeqStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_sequence); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_for_identity); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1201 * * * cdef create_DefineStmt(structs.DefineStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'ObjectType')(data.kind) * cdef object v_oldstyle = bool(data.oldstyle) */ static PyObject *__pyx_f_6pglast_6parser_create_DefineStmt(DefineStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_oldstyle = 0; PyObject *__pyx_v_v_defnames = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_definition = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DefineStmt", 1); /* "pglast/ast.pyx":1202 * * cdef create_DefineStmt(structs.DefineStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'ObjectType')(data.kind) # <<<<<<<<<<<<<< * cdef object v_oldstyle = bool(data.oldstyle) * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1203 * cdef create_DefineStmt(structs.DefineStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'ObjectType')(data.kind) * cdef object v_oldstyle = bool(data.oldstyle) # <<<<<<<<<<<<<< * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->oldstyle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_oldstyle = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1204 * cdef object v_kind = getattr(enums, 'ObjectType')(data.kind) * cdef object v_oldstyle = bool(data.oldstyle) * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_definition = _pg_list_to_tuple(data.definition, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->defnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1204, __pyx_L1_error) __pyx_v_v_defnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1205 * cdef object v_oldstyle = bool(data.oldstyle) * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_definition = _pg_list_to_tuple(data.definition, offset_to_index) * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1205, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1206 * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_definition = _pg_list_to_tuple(data.definition, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef object v_replace = bool(data.replace) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->definition, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_v_v_definition = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1207 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_definition = _pg_list_to_tuple(data.definition, offset_to_index) * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * return ast.DefineStmt(v_kind, v_oldstyle, v_defnames, v_args, v_definition, v_if_not_exists, v_replace) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1208 * cdef tuple v_definition = _pg_list_to_tuple(data.definition, offset_to_index) * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * return ast.DefineStmt(v_kind, v_oldstyle, v_defnames, v_args, v_definition, v_if_not_exists, v_replace) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1209 * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef object v_replace = bool(data.replace) * return ast.DefineStmt(v_kind, v_oldstyle, v_defnames, v_args, v_definition, v_if_not_exists, v_replace) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DefineStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_v_v_kind, __pyx_v_v_oldstyle, __pyx_v_v_defnames, __pyx_v_v_args, __pyx_v_v_definition, __pyx_v_v_if_not_exists, __pyx_v_v_replace}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 7+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1201 * * * cdef create_DefineStmt(structs.DefineStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'ObjectType')(data.kind) * cdef object v_oldstyle = bool(data.oldstyle) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_DefineStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_oldstyle); __Pyx_XDECREF(__pyx_v_v_defnames); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_definition); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1212 * * * cdef create_CreateDomainStmt(structs.CreateDomainStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_domainname = _pg_list_to_tuple(data.domainname, offset_to_index) * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateDomainStmt(CreateDomainStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_domainname = 0; PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_collClause = 0; PyObject *__pyx_v_v_constraints = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateDomainStmt", 1); /* "pglast/ast.pyx":1213 * * cdef create_CreateDomainStmt(structs.CreateDomainStmt* data, offset_to_index): * cdef tuple v_domainname = _pg_list_to_tuple(data.domainname, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->domainname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1213, __pyx_L1_error) __pyx_v_v_domainname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1214 * cdef create_CreateDomainStmt(structs.CreateDomainStmt* data, offset_to_index): * cdef tuple v_domainname = _pg_list_to_tuple(data.domainname, offset_to_index) * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->typeName != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typeName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1215 * cdef tuple v_domainname = _pg_list_to_tuple(data.domainname, offset_to_index) * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * return ast.CreateDomainStmt(v_domainname, v_typeName, v_collClause, v_constraints) */ __pyx_t_2 = (__pyx_v_data->collClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->collClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_collClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1216 * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateDomainStmt(v_domainname, v_typeName, v_collClause, v_constraints) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->constraints, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1216, __pyx_L1_error) __pyx_v_v_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1217 * cdef object v_collClause = create(data.collClause, offset_to_index) if data.collClause is not NULL else None * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * return ast.CreateDomainStmt(v_domainname, v_typeName, v_collClause, v_constraints) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateDomainStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_domainname, __pyx_v_v_typeName, __pyx_v_v_collClause, __pyx_v_v_constraints}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1212 * * * cdef create_CreateDomainStmt(structs.CreateDomainStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_domainname = _pg_list_to_tuple(data.domainname, offset_to_index) * cdef object v_typeName = create(data.typeName, offset_to_index) if data.typeName is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CreateDomainStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_domainname); __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_collClause); __Pyx_XDECREF(__pyx_v_v_constraints); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1220 * * * cdef create_CreateOpClassStmt(structs.CreateOpClassStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_opclassname = _pg_list_to_tuple(data.opclassname, offset_to_index) * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateOpClassStmt(CreateOpClassStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_opclassname = 0; PyObject *__pyx_v_v_opfamilyname = 0; PyObject *__pyx_v_v_amname = 0; PyObject *__pyx_v_v_datatype = 0; PyObject *__pyx_v_v_items = 0; PyObject *__pyx_v_v_isDefault = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateOpClassStmt", 1); /* "pglast/ast.pyx":1221 * * cdef create_CreateOpClassStmt(structs.CreateOpClassStmt* data, offset_to_index): * cdef tuple v_opclassname = _pg_list_to_tuple(data.opclassname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opclassname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1221, __pyx_L1_error) __pyx_v_v_opclassname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1222 * cdef create_CreateOpClassStmt(structs.CreateOpClassStmt* data, offset_to_index): * cdef tuple v_opclassname = _pg_list_to_tuple(data.opclassname, offset_to_index) * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef object v_datatype = create(data.datatype, offset_to_index) if data.datatype is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opfamilyname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1222, __pyx_L1_error) __pyx_v_v_opfamilyname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1223 * cdef tuple v_opclassname = _pg_list_to_tuple(data.opclassname, offset_to_index) * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_datatype = create(data.datatype, offset_to_index) if data.datatype is not NULL else None * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->amname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->amname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1223, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_amname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1224 * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef object v_datatype = create(data.datatype, offset_to_index) if data.datatype is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) * cdef object v_isDefault = bool(data.isDefault) */ __pyx_t_2 = (__pyx_v_data->datatype != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->datatype, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_datatype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1225 * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef object v_datatype = create(data.datatype, offset_to_index) if data.datatype is not NULL else None * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_isDefault = bool(data.isDefault) * return ast.CreateOpClassStmt(v_opclassname, v_opfamilyname, v_amname, v_datatype, v_items, v_isDefault) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->items, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1225, __pyx_L1_error) __pyx_v_v_items = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1226 * cdef object v_datatype = create(data.datatype, offset_to_index) if data.datatype is not NULL else None * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) * cdef object v_isDefault = bool(data.isDefault) # <<<<<<<<<<<<<< * return ast.CreateOpClassStmt(v_opclassname, v_opfamilyname, v_amname, v_datatype, v_items, v_isDefault) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isDefault); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isDefault = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1227 * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) * cdef object v_isDefault = bool(data.isDefault) * return ast.CreateOpClassStmt(v_opclassname, v_opfamilyname, v_amname, v_datatype, v_items, v_isDefault) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateOpClassStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_v_opclassname, __pyx_v_v_opfamilyname, __pyx_v_v_amname, __pyx_v_v_datatype, __pyx_v_v_items, __pyx_v_v_isDefault}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 6+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1220 * * * cdef create_CreateOpClassStmt(structs.CreateOpClassStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_opclassname = _pg_list_to_tuple(data.opclassname, offset_to_index) * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateOpClassStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_opclassname); __Pyx_XDECREF(__pyx_v_v_opfamilyname); __Pyx_XDECREF(__pyx_v_v_amname); __Pyx_XDECREF(__pyx_v_v_datatype); __Pyx_XDECREF(__pyx_v_v_items); __Pyx_XDECREF(__pyx_v_v_isDefault); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1230 * * * cdef create_CreateOpClassItem(structs.CreateOpClassItem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_itemtype = data.itemtype * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateOpClassItem(CreateOpClassItem *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_itemtype = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_number = 0; PyObject *__pyx_v_v_order_family = 0; PyObject *__pyx_v_v_class_args = 0; PyObject *__pyx_v_v_storedtype = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateOpClassItem", 1); /* "pglast/ast.pyx":1231 * * cdef create_CreateOpClassItem(structs.CreateOpClassItem* data, offset_to_index): * cdef object v_itemtype = data.itemtype # <<<<<<<<<<<<<< * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_number = data.number */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->itemtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_itemtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1232 * cdef create_CreateOpClassItem(structs.CreateOpClassItem* data, offset_to_index): * cdef object v_itemtype = data.itemtype * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_number = data.number * cdef tuple v_order_family = _pg_list_to_tuple(data.order_family, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1233 * cdef object v_itemtype = data.itemtype * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_number = data.number # <<<<<<<<<<<<<< * cdef tuple v_order_family = _pg_list_to_tuple(data.order_family, offset_to_index) * cdef tuple v_class_args = _pg_list_to_tuple(data.class_args, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->number); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_number = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1234 * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None * cdef object v_number = data.number * cdef tuple v_order_family = _pg_list_to_tuple(data.order_family, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_class_args = _pg_list_to_tuple(data.class_args, offset_to_index) * cdef object v_storedtype = create(data.storedtype, offset_to_index) if data.storedtype is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->order_family, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1234, __pyx_L1_error) __pyx_v_v_order_family = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1235 * cdef object v_number = data.number * cdef tuple v_order_family = _pg_list_to_tuple(data.order_family, offset_to_index) * cdef tuple v_class_args = _pg_list_to_tuple(data.class_args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_storedtype = create(data.storedtype, offset_to_index) if data.storedtype is not NULL else None * return ast.CreateOpClassItem(v_itemtype, v_name, v_number, v_order_family, v_class_args, v_storedtype) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->class_args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1235, __pyx_L1_error) __pyx_v_v_class_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1236 * cdef tuple v_order_family = _pg_list_to_tuple(data.order_family, offset_to_index) * cdef tuple v_class_args = _pg_list_to_tuple(data.class_args, offset_to_index) * cdef object v_storedtype = create(data.storedtype, offset_to_index) if data.storedtype is not NULL else None # <<<<<<<<<<<<<< * return ast.CreateOpClassItem(v_itemtype, v_name, v_number, v_order_family, v_class_args, v_storedtype) * */ __pyx_t_2 = (__pyx_v_data->storedtype != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->storedtype, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_storedtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1237 * cdef tuple v_class_args = _pg_list_to_tuple(data.class_args, offset_to_index) * cdef object v_storedtype = create(data.storedtype, offset_to_index) if data.storedtype is not NULL else None * return ast.CreateOpClassItem(v_itemtype, v_name, v_number, v_order_family, v_class_args, v_storedtype) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateOpClassItem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_itemtype, __pyx_v_v_name, __pyx_v_v_number, __pyx_v_v_order_family, __pyx_v_v_class_args, __pyx_v_v_storedtype}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1230 * * * cdef create_CreateOpClassItem(structs.CreateOpClassItem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_itemtype = data.itemtype * cdef object v_name = create(data.name, offset_to_index) if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CreateOpClassItem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_itemtype); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_number); __Pyx_XDECREF(__pyx_v_v_order_family); __Pyx_XDECREF(__pyx_v_v_class_args); __Pyx_XDECREF(__pyx_v_v_storedtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1240 * * * cdef create_CreateOpFamilyStmt(structs.CreateOpFamilyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateOpFamilyStmt(CreateOpFamilyStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_opfamilyname = 0; PyObject *__pyx_v_v_amname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateOpFamilyStmt", 1); /* "pglast/ast.pyx":1241 * * cdef create_CreateOpFamilyStmt(structs.CreateOpFamilyStmt* data, offset_to_index): * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * return ast.CreateOpFamilyStmt(v_opfamilyname, v_amname) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opfamilyname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1241, __pyx_L1_error) __pyx_v_v_opfamilyname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1242 * cdef create_CreateOpFamilyStmt(structs.CreateOpFamilyStmt* data, offset_to_index): * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None # <<<<<<<<<<<<<< * return ast.CreateOpFamilyStmt(v_opfamilyname, v_amname) * */ __pyx_t_2 = (__pyx_v_data->amname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->amname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1242, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_amname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1243 * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * return ast.CreateOpFamilyStmt(v_opfamilyname, v_amname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateOpFamilyStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_opfamilyname, __pyx_v_v_amname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1240 * * * cdef create_CreateOpFamilyStmt(structs.CreateOpFamilyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateOpFamilyStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_opfamilyname); __Pyx_XDECREF(__pyx_v_v_amname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1246 * * * cdef create_AlterOpFamilyStmt(structs.AlterOpFamilyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterOpFamilyStmt(AlterOpFamilyStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_opfamilyname = 0; PyObject *__pyx_v_v_amname = 0; PyObject *__pyx_v_v_isDrop = 0; PyObject *__pyx_v_v_items = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterOpFamilyStmt", 1); /* "pglast/ast.pyx":1247 * * cdef create_AlterOpFamilyStmt(structs.AlterOpFamilyStmt* data, offset_to_index): * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef object v_isDrop = bool(data.isDrop) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opfamilyname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1247, __pyx_L1_error) __pyx_v_v_opfamilyname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1248 * cdef create_AlterOpFamilyStmt(structs.AlterOpFamilyStmt* data, offset_to_index): * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_isDrop = bool(data.isDrop) * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->amname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->amname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1248, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_amname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1249 * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef object v_isDrop = bool(data.isDrop) # <<<<<<<<<<<<<< * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) * return ast.AlterOpFamilyStmt(v_opfamilyname, v_amname, v_isDrop, v_items) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isDrop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isDrop = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1250 * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None * cdef object v_isDrop = bool(data.isDrop) * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterOpFamilyStmt(v_opfamilyname, v_amname, v_isDrop, v_items) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->items, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1250, __pyx_L1_error) __pyx_v_v_items = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1251 * cdef object v_isDrop = bool(data.isDrop) * cdef tuple v_items = _pg_list_to_tuple(data.items, offset_to_index) * return ast.AlterOpFamilyStmt(v_opfamilyname, v_amname, v_isDrop, v_items) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterOpFamilyStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_opfamilyname, __pyx_v_v_amname, __pyx_v_v_isDrop, __pyx_v_v_items}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1246 * * * cdef create_AlterOpFamilyStmt(structs.AlterOpFamilyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_opfamilyname = _pg_list_to_tuple(data.opfamilyname, offset_to_index) * cdef object v_amname = data.amname.decode("utf-8") if data.amname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterOpFamilyStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_opfamilyname); __Pyx_XDECREF(__pyx_v_v_amname); __Pyx_XDECREF(__pyx_v_v_isDrop); __Pyx_XDECREF(__pyx_v_v_items); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1254 * * * cdef create_DropStmt(structs.DropStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) */ static PyObject *__pyx_f_6pglast_6parser_create_DropStmt(DropStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objects = 0; PyObject *__pyx_v_v_removeType = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_v_v_concurrent = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropStmt", 1); /* "pglast/ast.pyx":1255 * * cdef create_DropStmt(structs.DropStmt* data, offset_to_index): * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->objects, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1255, __pyx_L1_error) __pyx_v_v_objects = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1256 * cdef create_DropStmt(structs.DropStmt* data, offset_to_index): * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->removeType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_removeType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1257 * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_concurrent = bool(data.concurrent) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1258 * cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * cdef object v_concurrent = bool(data.concurrent) * return ast.DropStmt(v_objects, v_removeType, v_behavior, v_missing_ok, v_concurrent) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1259 * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_concurrent = bool(data.concurrent) # <<<<<<<<<<<<<< * return ast.DropStmt(v_objects, v_removeType, v_behavior, v_missing_ok, v_concurrent) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->concurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_concurrent = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1260 * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_concurrent = bool(data.concurrent) * return ast.DropStmt(v_objects, v_removeType, v_behavior, v_missing_ok, v_concurrent) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DropStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_2, __pyx_v_v_objects, __pyx_v_v_removeType, __pyx_v_v_behavior, __pyx_v_v_missing_ok, __pyx_v_v_concurrent}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1254 * * * cdef create_DropStmt(structs.DropStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_objects = _pg_list_to_tuple(data.objects, offset_to_index) * cdef object v_removeType = getattr(enums, 'ObjectType')(data.removeType) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_DropStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objects); __Pyx_XDECREF(__pyx_v_v_removeType); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XDECREF(__pyx_v_v_concurrent); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1263 * * * cdef create_TruncateStmt(structs.TruncateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_restart_seqs = bool(data.restart_seqs) */ static PyObject *__pyx_f_6pglast_6parser_create_TruncateStmt(TruncateStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relations = 0; PyObject *__pyx_v_v_restart_seqs = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TruncateStmt", 1); /* "pglast/ast.pyx":1264 * * cdef create_TruncateStmt(structs.TruncateStmt* data, offset_to_index): * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_restart_seqs = bool(data.restart_seqs) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->relations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1264, __pyx_L1_error) __pyx_v_v_relations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1265 * cdef create_TruncateStmt(structs.TruncateStmt* data, offset_to_index): * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_restart_seqs = bool(data.restart_seqs) # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.TruncateStmt(v_relations, v_restart_seqs, v_behavior) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->restart_seqs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_restart_seqs = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1266 * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_restart_seqs = bool(data.restart_seqs) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * return ast.TruncateStmt(v_relations, v_restart_seqs, v_behavior) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1267 * cdef object v_restart_seqs = bool(data.restart_seqs) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.TruncateStmt(v_relations, v_restart_seqs, v_behavior) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_TruncateStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_relations, __pyx_v_v_restart_seqs, __pyx_v_v_behavior}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1263 * * * cdef create_TruncateStmt(structs.TruncateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_restart_seqs = bool(data.restart_seqs) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_TruncateStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relations); __Pyx_XDECREF(__pyx_v_v_restart_seqs); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1270 * * * cdef create_CommentStmt(structs.CommentStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CommentStmt(CommentStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_v_v_comment = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CommentStmt", 1); /* "pglast/ast.pyx":1271 * * cdef create_CommentStmt(structs.CommentStmt* data, offset_to_index): * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_comment = data.comment.decode("utf-8") if data.comment is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1272 * cdef create_CommentStmt(structs.CommentStmt* data, offset_to_index): * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * cdef object v_comment = data.comment.decode("utf-8") if data.comment is not NULL else None * return ast.CommentStmt(v_objtype, v_object, v_comment) */ __pyx_t_6 = (__pyx_v_data->object != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1273 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_comment = data.comment.decode("utf-8") if data.comment is not NULL else None # <<<<<<<<<<<<<< * return ast.CommentStmt(v_objtype, v_object, v_comment) * */ __pyx_t_6 = (__pyx_v_data->comment != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->comment; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1273, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_comment = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1274 * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_comment = data.comment.decode("utf-8") if data.comment is not NULL else None * return ast.CommentStmt(v_objtype, v_object, v_comment) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CommentStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_objtype, __pyx_v_v_object, __pyx_v_v_comment}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1270 * * * cdef create_CommentStmt(structs.CommentStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CommentStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XDECREF(__pyx_v_v_comment); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1277 * * * cdef create_SecLabelStmt(structs.SecLabelStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_SecLabelStmt(SecLabelStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_v_v_provider = 0; PyObject *__pyx_v_v_label = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SecLabelStmt", 1); /* "pglast/ast.pyx":1278 * * cdef create_SecLabelStmt(structs.SecLabelStmt* data, offset_to_index): * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_provider = data.provider.decode("utf-8") if data.provider is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1279 * cdef create_SecLabelStmt(structs.SecLabelStmt* data, offset_to_index): * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * cdef object v_provider = data.provider.decode("utf-8") if data.provider is not NULL else None * cdef object v_label = data.label.decode("utf-8") if data.label is not NULL else None */ __pyx_t_6 = (__pyx_v_data->object != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1280 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_provider = data.provider.decode("utf-8") if data.provider is not NULL else None # <<<<<<<<<<<<<< * cdef object v_label = data.label.decode("utf-8") if data.label is not NULL else None * return ast.SecLabelStmt(v_objtype, v_object, v_provider, v_label) */ __pyx_t_6 = (__pyx_v_data->provider != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->provider; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1280, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_provider = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1281 * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_provider = data.provider.decode("utf-8") if data.provider is not NULL else None * cdef object v_label = data.label.decode("utf-8") if data.label is not NULL else None # <<<<<<<<<<<<<< * return ast.SecLabelStmt(v_objtype, v_object, v_provider, v_label) * */ __pyx_t_6 = (__pyx_v_data->label != NULL); if (__pyx_t_6) { __pyx_t_9 = __pyx_v_data->label; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1281, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_label = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1282 * cdef object v_provider = data.provider.decode("utf-8") if data.provider is not NULL else None * cdef object v_label = data.label.decode("utf-8") if data.label is not NULL else None * return ast.SecLabelStmt(v_objtype, v_object, v_provider, v_label) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SecLabelStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_objtype, __pyx_v_v_object, __pyx_v_v_provider, __pyx_v_v_label}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1277 * * * cdef create_SecLabelStmt(structs.SecLabelStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SecLabelStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XDECREF(__pyx_v_v_provider); __Pyx_XDECREF(__pyx_v_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1285 * * * cdef create_DeclareCursorStmt(structs.DeclareCursorStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_options = data.options */ static PyObject *__pyx_f_6pglast_6parser_create_DeclareCursorStmt(DeclareCursorStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_portalname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_query = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DeclareCursorStmt", 1); /* "pglast/ast.pyx":1286 * * cdef create_DeclareCursorStmt(structs.DeclareCursorStmt* data, offset_to_index): * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_options = data.options * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None */ __pyx_t_2 = (__pyx_v_data->portalname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->portalname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1286, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_portalname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1287 * cdef create_DeclareCursorStmt(structs.DeclareCursorStmt* data, offset_to_index): * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_options = data.options # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * return ast.DeclareCursorStmt(v_portalname, v_options, v_query) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_options = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1288 * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_options = data.options * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * return ast.DeclareCursorStmt(v_portalname, v_options, v_query) * */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1289 * cdef object v_options = data.options * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * return ast.DeclareCursorStmt(v_portalname, v_options, v_query) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DeclareCursorStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_portalname, __pyx_v_v_options, __pyx_v_v_query}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1285 * * * cdef create_DeclareCursorStmt(structs.DeclareCursorStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_options = data.options */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_DeclareCursorStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_portalname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1292 * * * cdef create_ClosePortalStmt(structs.ClosePortalStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * return ast.ClosePortalStmt(v_portalname) */ static PyObject *__pyx_f_6pglast_6parser_create_ClosePortalStmt(ClosePortalStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_portalname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ClosePortalStmt", 1); /* "pglast/ast.pyx":1293 * * cdef create_ClosePortalStmt(structs.ClosePortalStmt* data, offset_to_index): * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None # <<<<<<<<<<<<<< * return ast.ClosePortalStmt(v_portalname) * */ __pyx_t_2 = (__pyx_v_data->portalname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->portalname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1293, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_portalname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1294 * cdef create_ClosePortalStmt(structs.ClosePortalStmt* data, offset_to_index): * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * return ast.ClosePortalStmt(v_portalname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ClosePortalStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_portalname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1292 * * * cdef create_ClosePortalStmt(structs.ClosePortalStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * return ast.ClosePortalStmt(v_portalname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_ClosePortalStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_portalname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1297 * * * cdef create_FetchStmt(structs.FetchStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_direction = getattr(enums, 'FetchDirection')(data.direction) * cdef object v_howMany = data.howMany */ static PyObject *__pyx_f_6pglast_6parser_create_FetchStmt(FetchStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_direction = 0; PyObject *__pyx_v_v_howMany = 0; PyObject *__pyx_v_v_portalname = 0; PyObject *__pyx_v_v_ismove = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FetchStmt", 1); /* "pglast/ast.pyx":1298 * * cdef create_FetchStmt(structs.FetchStmt* data, offset_to_index): * cdef object v_direction = getattr(enums, 'FetchDirection')(data.direction) # <<<<<<<<<<<<<< * cdef object v_howMany = data.howMany * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_FetchDirection); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_FetchDirection(__pyx_v_data->direction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_direction = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1299 * cdef create_FetchStmt(structs.FetchStmt* data, offset_to_index): * cdef object v_direction = getattr(enums, 'FetchDirection')(data.direction) * cdef object v_howMany = data.howMany # <<<<<<<<<<<<<< * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_ismove = bool(data.ismove) */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_data->howMany); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_howMany = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1300 * cdef object v_direction = getattr(enums, 'FetchDirection')(data.direction) * cdef object v_howMany = data.howMany * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_ismove = bool(data.ismove) * return ast.FetchStmt(v_direction, v_howMany, v_portalname, v_ismove) */ __pyx_t_6 = (__pyx_v_data->portalname != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->portalname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1300, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_portalname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1301 * cdef object v_howMany = data.howMany * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_ismove = bool(data.ismove) # <<<<<<<<<<<<<< * return ast.FetchStmt(v_direction, v_howMany, v_portalname, v_ismove) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->ismove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_ismove = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1302 * cdef object v_portalname = data.portalname.decode("utf-8") if data.portalname is not NULL else None * cdef object v_ismove = bool(data.ismove) * return ast.FetchStmt(v_direction, v_howMany, v_portalname, v_ismove) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FetchStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_direction, __pyx_v_v_howMany, __pyx_v_v_portalname, __pyx_v_v_ismove}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1297 * * * cdef create_FetchStmt(structs.FetchStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_direction = getattr(enums, 'FetchDirection')(data.direction) * cdef object v_howMany = data.howMany */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_FetchStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_direction); __Pyx_XDECREF(__pyx_v_v_howMany); __Pyx_XDECREF(__pyx_v_v_portalname); __Pyx_XDECREF(__pyx_v_v_ismove); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1305 * * * cdef create_IndexStmt(structs.IndexStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_idxname = data.idxname.decode("utf-8") if data.idxname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_IndexStmt(IndexStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_idxname = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_accessMethod = 0; PyObject *__pyx_v_v_tableSpace = 0; PyObject *__pyx_v_v_indexParams = 0; PyObject *__pyx_v_v_indexIncludingParams = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_excludeOpNames = 0; PyObject *__pyx_v_v_idxcomment = 0; PyObject *__pyx_v_v_oldNumber = 0; PyObject *__pyx_v_v_oldCreateSubid = 0; PyObject *__pyx_v_v_oldFirstRelfilelocatorSubid = 0; PyObject *__pyx_v_v_unique = 0; PyObject *__pyx_v_v_nulls_not_distinct = 0; PyObject *__pyx_v_v_primary = 0; PyObject *__pyx_v_v_isconstraint = 0; PyObject *__pyx_v_v_deferrable = 0; PyObject *__pyx_v_v_initdeferred = 0; PyObject *__pyx_v_v_transformed = 0; PyObject *__pyx_v_v_concurrent = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_v_v_reset_default_tblspc = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; char const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_IndexStmt", 1); /* "pglast/ast.pyx":1306 * * cdef create_IndexStmt(structs.IndexStmt* data, offset_to_index): * cdef object v_idxname = data.idxname.decode("utf-8") if data.idxname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None */ __pyx_t_2 = (__pyx_v_data->idxname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->idxname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1306, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_idxname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1307 * cdef create_IndexStmt(structs.IndexStmt* data, offset_to_index): * cdef object v_idxname = data.idxname.decode("utf-8") if data.idxname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef object v_tableSpace = data.tableSpace.decode("utf-8") if data.tableSpace is not NULL else None */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1308 * cdef object v_idxname = data.idxname.decode("utf-8") if data.idxname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None # <<<<<<<<<<<<<< * cdef object v_tableSpace = data.tableSpace.decode("utf-8") if data.tableSpace is not NULL else None * cdef tuple v_indexParams = _pg_list_to_tuple(data.indexParams, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->accessMethod != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->accessMethod; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1308, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_accessMethod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1309 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef object v_tableSpace = data.tableSpace.decode("utf-8") if data.tableSpace is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_indexParams = _pg_list_to_tuple(data.indexParams, offset_to_index) * cdef tuple v_indexIncludingParams = _pg_list_to_tuple(data.indexIncludingParams, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->tableSpace != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->tableSpace; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1309, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tableSpace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1310 * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef object v_tableSpace = data.tableSpace.decode("utf-8") if data.tableSpace is not NULL else None * cdef tuple v_indexParams = _pg_list_to_tuple(data.indexParams, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_indexIncludingParams = _pg_list_to_tuple(data.indexIncludingParams, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->indexParams, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1310, __pyx_L1_error) __pyx_v_v_indexParams = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1311 * cdef object v_tableSpace = data.tableSpace.decode("utf-8") if data.tableSpace is not NULL else None * cdef tuple v_indexParams = _pg_list_to_tuple(data.indexParams, offset_to_index) * cdef tuple v_indexIncludingParams = _pg_list_to_tuple(data.indexIncludingParams, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->indexIncludingParams, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1311, __pyx_L1_error) __pyx_v_v_indexIncludingParams = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1312 * cdef tuple v_indexParams = _pg_list_to_tuple(data.indexParams, offset_to_index) * cdef tuple v_indexIncludingParams = _pg_list_to_tuple(data.indexIncludingParams, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_excludeOpNames = _pg_list_to_tuple(data.excludeOpNames, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1312, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1313 * cdef tuple v_indexIncludingParams = _pg_list_to_tuple(data.indexIncludingParams, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_excludeOpNames = _pg_list_to_tuple(data.excludeOpNames, offset_to_index) * cdef object v_idxcomment = data.idxcomment.decode("utf-8") if data.idxcomment is not NULL else None */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1314 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_excludeOpNames = _pg_list_to_tuple(data.excludeOpNames, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_idxcomment = data.idxcomment.decode("utf-8") if data.idxcomment is not NULL else None * cdef object v_oldNumber = data.oldNumber */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->excludeOpNames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1314, __pyx_L1_error) __pyx_v_v_excludeOpNames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1315 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_excludeOpNames = _pg_list_to_tuple(data.excludeOpNames, offset_to_index) * cdef object v_idxcomment = data.idxcomment.decode("utf-8") if data.idxcomment is not NULL else None # <<<<<<<<<<<<<< * cdef object v_oldNumber = data.oldNumber * cdef object v_oldCreateSubid = data.oldCreateSubid */ __pyx_t_2 = (__pyx_v_data->idxcomment != NULL); if (__pyx_t_2) { __pyx_t_8 = __pyx_v_data->idxcomment; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_8); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1315, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_8, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_idxcomment = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1316 * cdef tuple v_excludeOpNames = _pg_list_to_tuple(data.excludeOpNames, offset_to_index) * cdef object v_idxcomment = data.idxcomment.decode("utf-8") if data.idxcomment is not NULL else None * cdef object v_oldNumber = data.oldNumber # <<<<<<<<<<<<<< * cdef object v_oldCreateSubid = data.oldCreateSubid * cdef object v_oldFirstRelfilelocatorSubid = data.oldFirstRelfilelocatorSubid */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->oldNumber); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_oldNumber = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1317 * cdef object v_idxcomment = data.idxcomment.decode("utf-8") if data.idxcomment is not NULL else None * cdef object v_oldNumber = data.oldNumber * cdef object v_oldCreateSubid = data.oldCreateSubid # <<<<<<<<<<<<<< * cdef object v_oldFirstRelfilelocatorSubid = data.oldFirstRelfilelocatorSubid * cdef object v_unique = bool(data.unique) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->oldCreateSubid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_oldCreateSubid = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1318 * cdef object v_oldNumber = data.oldNumber * cdef object v_oldCreateSubid = data.oldCreateSubid * cdef object v_oldFirstRelfilelocatorSubid = data.oldFirstRelfilelocatorSubid # <<<<<<<<<<<<<< * cdef object v_unique = bool(data.unique) * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->oldFirstRelfilelocatorSubid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_oldFirstRelfilelocatorSubid = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1319 * cdef object v_oldCreateSubid = data.oldCreateSubid * cdef object v_oldFirstRelfilelocatorSubid = data.oldFirstRelfilelocatorSubid * cdef object v_unique = bool(data.unique) # <<<<<<<<<<<<<< * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) * cdef object v_primary = bool(data.primary) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unique = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1320 * cdef object v_oldFirstRelfilelocatorSubid = data.oldFirstRelfilelocatorSubid * cdef object v_unique = bool(data.unique) * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) # <<<<<<<<<<<<<< * cdef object v_primary = bool(data.primary) * cdef object v_isconstraint = bool(data.isconstraint) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->nulls_not_distinct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_nulls_not_distinct = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1321 * cdef object v_unique = bool(data.unique) * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) * cdef object v_primary = bool(data.primary) # <<<<<<<<<<<<<< * cdef object v_isconstraint = bool(data.isconstraint) * cdef object v_deferrable = bool(data.deferrable) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->primary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_primary = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1322 * cdef object v_nulls_not_distinct = bool(data.nulls_not_distinct) * cdef object v_primary = bool(data.primary) * cdef object v_isconstraint = bool(data.isconstraint) # <<<<<<<<<<<<<< * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isconstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isconstraint = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1323 * cdef object v_primary = bool(data.primary) * cdef object v_isconstraint = bool(data.isconstraint) * cdef object v_deferrable = bool(data.deferrable) # <<<<<<<<<<<<<< * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_transformed = bool(data.transformed) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->deferrable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_deferrable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1324 * cdef object v_isconstraint = bool(data.isconstraint) * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) # <<<<<<<<<<<<<< * cdef object v_transformed = bool(data.transformed) * cdef object v_concurrent = bool(data.concurrent) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->initdeferred); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_initdeferred = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1325 * cdef object v_deferrable = bool(data.deferrable) * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_transformed = bool(data.transformed) # <<<<<<<<<<<<<< * cdef object v_concurrent = bool(data.concurrent) * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->transformed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_transformed = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1326 * cdef object v_initdeferred = bool(data.initdeferred) * cdef object v_transformed = bool(data.transformed) * cdef object v_concurrent = bool(data.concurrent) # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->concurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_concurrent = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1327 * cdef object v_transformed = bool(data.transformed) * cdef object v_concurrent = bool(data.concurrent) * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) * return ast.IndexStmt(v_idxname, v_relation, v_accessMethod, v_tableSpace, v_indexParams, v_indexIncludingParams, v_options, v_whereClause, v_excludeOpNames, v_idxcomment, v_oldNumber, v_oldCreateSubid, v_oldFirstRelfilelocatorSubid, v_unique, v_nulls_not_distinct, v_primary, v_isconstraint, v_deferrable, v_initdeferred, v_transformed, v_concurrent, v_if_not_exists, v_reset_default_tblspc) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1328 * cdef object v_concurrent = bool(data.concurrent) * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) # <<<<<<<<<<<<<< * return ast.IndexStmt(v_idxname, v_relation, v_accessMethod, v_tableSpace, v_indexParams, v_indexIncludingParams, v_options, v_whereClause, v_excludeOpNames, v_idxcomment, v_oldNumber, v_oldCreateSubid, v_oldFirstRelfilelocatorSubid, v_unique, v_nulls_not_distinct, v_primary, v_isconstraint, v_deferrable, v_initdeferred, v_transformed, v_concurrent, v_if_not_exists, v_reset_default_tblspc) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->reset_default_tblspc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_reset_default_tblspc = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1329 * cdef object v_if_not_exists = bool(data.if_not_exists) * cdef object v_reset_default_tblspc = bool(data.reset_default_tblspc) * return ast.IndexStmt(v_idxname, v_relation, v_accessMethod, v_tableSpace, v_indexParams, v_indexIncludingParams, v_options, v_whereClause, v_excludeOpNames, v_idxcomment, v_oldNumber, v_oldCreateSubid, v_oldFirstRelfilelocatorSubid, v_unique, v_nulls_not_distinct, v_primary, v_isconstraint, v_deferrable, v_initdeferred, v_transformed, v_concurrent, v_if_not_exists, v_reset_default_tblspc) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_IndexStmt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[24] = {__pyx_t_5, __pyx_v_v_idxname, __pyx_v_v_relation, __pyx_v_v_accessMethod, __pyx_v_v_tableSpace, __pyx_v_v_indexParams, __pyx_v_v_indexIncludingParams, __pyx_v_v_options, __pyx_v_v_whereClause, __pyx_v_v_excludeOpNames, __pyx_v_v_idxcomment, __pyx_v_v_oldNumber, __pyx_v_v_oldCreateSubid, __pyx_v_v_oldFirstRelfilelocatorSubid, __pyx_v_v_unique, __pyx_v_v_nulls_not_distinct, __pyx_v_v_primary, __pyx_v_v_isconstraint, __pyx_v_v_deferrable, __pyx_v_v_initdeferred, __pyx_v_v_transformed, __pyx_v_v_concurrent, __pyx_v_v_if_not_exists, __pyx_v_v_reset_default_tblspc}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 23+__pyx_t_10); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1305 * * * cdef create_IndexStmt(structs.IndexStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_idxname = data.idxname.decode("utf-8") if data.idxname is not NULL else None * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pglast.parser.create_IndexStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_idxname); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_accessMethod); __Pyx_XDECREF(__pyx_v_v_tableSpace); __Pyx_XDECREF(__pyx_v_v_indexParams); __Pyx_XDECREF(__pyx_v_v_indexIncludingParams); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_excludeOpNames); __Pyx_XDECREF(__pyx_v_v_idxcomment); __Pyx_XDECREF(__pyx_v_v_oldNumber); __Pyx_XDECREF(__pyx_v_v_oldCreateSubid); __Pyx_XDECREF(__pyx_v_v_oldFirstRelfilelocatorSubid); __Pyx_XDECREF(__pyx_v_v_unique); __Pyx_XDECREF(__pyx_v_v_nulls_not_distinct); __Pyx_XDECREF(__pyx_v_v_primary); __Pyx_XDECREF(__pyx_v_v_isconstraint); __Pyx_XDECREF(__pyx_v_v_deferrable); __Pyx_XDECREF(__pyx_v_v_initdeferred); __Pyx_XDECREF(__pyx_v_v_transformed); __Pyx_XDECREF(__pyx_v_v_concurrent); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XDECREF(__pyx_v_v_reset_default_tblspc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1332 * * * cdef create_CreateStatsStmt(structs.CreateStatsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateStatsStmt(CreateStatsStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_defnames = 0; PyObject *__pyx_v_v_stat_types = 0; PyObject *__pyx_v_v_exprs = 0; PyObject *__pyx_v_v_relations = 0; PyObject *__pyx_v_v_stxcomment = 0; PyObject *__pyx_v_v_transformed = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateStatsStmt", 1); /* "pglast/ast.pyx":1333 * * cdef create_CreateStatsStmt(structs.CreateStatsStmt* data, offset_to_index): * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->defnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1333, __pyx_L1_error) __pyx_v_v_defnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1334 * cdef create_CreateStatsStmt(structs.CreateStatsStmt* data, offset_to_index): * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->stat_types, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1334, __pyx_L1_error) __pyx_v_v_stat_types = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1335 * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_stxcomment = data.stxcomment.decode("utf-8") if data.stxcomment is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->exprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1335, __pyx_L1_error) __pyx_v_v_exprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1336 * cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_stxcomment = data.stxcomment.decode("utf-8") if data.stxcomment is not NULL else None * cdef object v_transformed = bool(data.transformed) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->relations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1336, __pyx_L1_error) __pyx_v_v_relations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1337 * cdef tuple v_exprs = _pg_list_to_tuple(data.exprs, offset_to_index) * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_stxcomment = data.stxcomment.decode("utf-8") if data.stxcomment is not NULL else None # <<<<<<<<<<<<<< * cdef object v_transformed = bool(data.transformed) * cdef object v_if_not_exists = bool(data.if_not_exists) */ __pyx_t_2 = (__pyx_v_data->stxcomment != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->stxcomment; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1337, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_stxcomment = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1338 * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_stxcomment = data.stxcomment.decode("utf-8") if data.stxcomment is not NULL else None * cdef object v_transformed = bool(data.transformed) # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateStatsStmt(v_defnames, v_stat_types, v_exprs, v_relations, v_stxcomment, v_transformed, v_if_not_exists) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->transformed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_transformed = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1339 * cdef object v_stxcomment = data.stxcomment.decode("utf-8") if data.stxcomment is not NULL else None * cdef object v_transformed = bool(data.transformed) * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * return ast.CreateStatsStmt(v_defnames, v_stat_types, v_exprs, v_relations, v_stxcomment, v_transformed, v_if_not_exists) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1340 * cdef object v_transformed = bool(data.transformed) * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateStatsStmt(v_defnames, v_stat_types, v_exprs, v_relations, v_stxcomment, v_transformed, v_if_not_exists) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateStatsStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_5, __pyx_v_v_defnames, __pyx_v_v_stat_types, __pyx_v_v_exprs, __pyx_v_v_relations, __pyx_v_v_stxcomment, __pyx_v_v_transformed, __pyx_v_v_if_not_exists}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 7+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1332 * * * cdef create_CreateStatsStmt(structs.CreateStatsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef tuple v_stat_types = _pg_list_to_tuple(data.stat_types, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateStatsStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_defnames); __Pyx_XDECREF(__pyx_v_v_stat_types); __Pyx_XDECREF(__pyx_v_v_exprs); __Pyx_XDECREF(__pyx_v_v_relations); __Pyx_XDECREF(__pyx_v_v_stxcomment); __Pyx_XDECREF(__pyx_v_v_transformed); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1343 * * * cdef create_StatsElem(structs.StatsElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_StatsElem(StatsElem *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_StatsElem", 1); /* "pglast/ast.pyx":1344 * * cdef create_StatsElem(structs.StatsElem* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * return ast.StatsElem(v_name, v_expr) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1344, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1345 * cdef create_StatsElem(structs.StatsElem* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * return ast.StatsElem(v_name, v_expr) * */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1346 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * return ast.StatsElem(v_name, v_expr) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_StatsElem); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_name, __pyx_v_v_expr}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1343 * * * cdef create_StatsElem(structs.StatsElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_StatsElem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1349 * * * cdef create_AlterStatsStmt(structs.AlterStatsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterStatsStmt(AlterStatsStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_defnames = 0; PyObject *__pyx_v_v_stxstattarget = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterStatsStmt", 1); /* "pglast/ast.pyx":1350 * * cdef create_AlterStatsStmt(structs.AlterStatsStmt* data, offset_to_index): * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->defnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1350, __pyx_L1_error) __pyx_v_v_defnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1351 * cdef create_AlterStatsStmt(structs.AlterStatsStmt* data, offset_to_index): * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterStatsStmt(v_defnames, v_stxstattarget, v_missing_ok) */ __pyx_t_2 = (__pyx_v_data->stxstattarget != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->stxstattarget, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_stxstattarget = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1352 * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.AlterStatsStmt(v_defnames, v_stxstattarget, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1353 * cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterStatsStmt(v_defnames, v_stxstattarget, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterStatsStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_defnames, __pyx_v_v_stxstattarget, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1349 * * * cdef create_AlterStatsStmt(structs.AlterStatsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_defnames = _pg_list_to_tuple(data.defnames, offset_to_index) * cdef object v_stxstattarget = create(data.stxstattarget, offset_to_index) if data.stxstattarget is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterStatsStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_defnames); __Pyx_XDECREF(__pyx_v_v_stxstattarget); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1356 * * * cdef create_CreateFunctionStmt(structs.CreateFunctionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_is_procedure = bool(data.is_procedure) * cdef object v_replace = bool(data.replace) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateFunctionStmt(CreateFunctionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_is_procedure = 0; PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_v_v_funcname = 0; PyObject *__pyx_v_v_parameters = 0; PyObject *__pyx_v_v_returnType = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_sql_body = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateFunctionStmt", 1); /* "pglast/ast.pyx":1357 * * cdef create_CreateFunctionStmt(structs.CreateFunctionStmt* data, offset_to_index): * cdef object v_is_procedure = bool(data.is_procedure) # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_procedure); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_procedure = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1358 * cdef create_CreateFunctionStmt(structs.CreateFunctionStmt* data, offset_to_index): * cdef object v_is_procedure = bool(data.is_procedure) * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_parameters = _pg_list_to_tuple(data.parameters, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1359 * cdef object v_is_procedure = bool(data.is_procedure) * cdef object v_replace = bool(data.replace) * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_parameters = _pg_list_to_tuple(data.parameters, offset_to_index) * cdef object v_returnType = create(data.returnType, offset_to_index) if data.returnType is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->funcname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1359, __pyx_L1_error) __pyx_v_v_funcname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1360 * cdef object v_replace = bool(data.replace) * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_parameters = _pg_list_to_tuple(data.parameters, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_returnType = create(data.returnType, offset_to_index) if data.returnType is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->parameters, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1360, __pyx_L1_error) __pyx_v_v_parameters = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1361 * cdef tuple v_funcname = _pg_list_to_tuple(data.funcname, offset_to_index) * cdef tuple v_parameters = _pg_list_to_tuple(data.parameters, offset_to_index) * cdef object v_returnType = create(data.returnType, offset_to_index) if data.returnType is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_sql_body = create(data.sql_body, offset_to_index) if data.sql_body is not NULL else None */ __pyx_t_2 = (__pyx_v_data->returnType != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->returnType, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_returnType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1362 * cdef tuple v_parameters = _pg_list_to_tuple(data.parameters, offset_to_index) * cdef object v_returnType = create(data.returnType, offset_to_index) if data.returnType is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_sql_body = create(data.sql_body, offset_to_index) if data.sql_body is not NULL else None * return ast.CreateFunctionStmt(v_is_procedure, v_replace, v_funcname, v_parameters, v_returnType, v_options, v_sql_body) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1362, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1363 * cdef object v_returnType = create(data.returnType, offset_to_index) if data.returnType is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_sql_body = create(data.sql_body, offset_to_index) if data.sql_body is not NULL else None # <<<<<<<<<<<<<< * return ast.CreateFunctionStmt(v_is_procedure, v_replace, v_funcname, v_parameters, v_returnType, v_options, v_sql_body) * */ __pyx_t_2 = (__pyx_v_data->sql_body != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->sql_body, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_sql_body = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1364 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_sql_body = create(data.sql_body, offset_to_index) if data.sql_body is not NULL else None * return ast.CreateFunctionStmt(v_is_procedure, v_replace, v_funcname, v_parameters, v_returnType, v_options, v_sql_body) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateFunctionStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_v_v_is_procedure, __pyx_v_v_replace, __pyx_v_v_funcname, __pyx_v_v_parameters, __pyx_v_v_returnType, __pyx_v_v_options, __pyx_v_v_sql_body}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 7+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1356 * * * cdef create_CreateFunctionStmt(structs.CreateFunctionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_is_procedure = bool(data.is_procedure) * cdef object v_replace = bool(data.replace) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CreateFunctionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_is_procedure); __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XDECREF(__pyx_v_v_funcname); __Pyx_XDECREF(__pyx_v_v_parameters); __Pyx_XDECREF(__pyx_v_v_returnType); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_sql_body); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1367 * * * cdef create_FunctionParameter(structs.FunctionParameter* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_FunctionParameter(FunctionParameter *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_argType = 0; PyObject *__pyx_v_v_mode = 0; PyObject *__pyx_v_v_defexpr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FunctionParameter", 1); /* "pglast/ast.pyx":1368 * * cdef create_FunctionParameter(structs.FunctionParameter* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None * cdef object v_mode = getattr(enums, 'FunctionParameterMode')(chr(data.mode)) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1368, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1369 * cdef create_FunctionParameter(structs.FunctionParameter* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None # <<<<<<<<<<<<<< * cdef object v_mode = getattr(enums, 'FunctionParameterMode')(chr(data.mode)) * cdef object v_defexpr = create(data.defexpr, offset_to_index) if data.defexpr is not NULL else None */ __pyx_t_2 = (__pyx_v_data->argType != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->argType, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_argType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1370 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None * cdef object v_mode = getattr(enums, 'FunctionParameterMode')(chr(data.mode)) # <<<<<<<<<<<<<< * cdef object v_defexpr = create(data.defexpr, offset_to_index) if data.defexpr is not NULL else None * return ast.FunctionParameter(v_name, v_argType, v_mode, v_defexpr) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_FunctionParameterMode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_FunctionParameterMode(__pyx_v_data->mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_mode = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1371 * cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None * cdef object v_mode = getattr(enums, 'FunctionParameterMode')(chr(data.mode)) * cdef object v_defexpr = create(data.defexpr, offset_to_index) if data.defexpr is not NULL else None # <<<<<<<<<<<<<< * return ast.FunctionParameter(v_name, v_argType, v_mode, v_defexpr) * */ __pyx_t_2 = (__pyx_v_data->defexpr != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_f_6pglast_6parser_create(__pyx_v_data->defexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_defexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1372 * cdef object v_mode = getattr(enums, 'FunctionParameterMode')(chr(data.mode)) * cdef object v_defexpr = create(data.defexpr, offset_to_index) if data.defexpr is not NULL else None * return ast.FunctionParameter(v_name, v_argType, v_mode, v_defexpr) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_FunctionParameter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_v_name, __pyx_v_v_argType, __pyx_v_v_mode, __pyx_v_v_defexpr}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1367 * * * cdef create_FunctionParameter(structs.FunctionParameter* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argType = create(data.argType, offset_to_index) if data.argType is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_FunctionParameter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_argType); __Pyx_XDECREF(__pyx_v_v_mode); __Pyx_XDECREF(__pyx_v_v_defexpr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1375 * * * cdef create_AlterFunctionStmt(structs.AlterFunctionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterFunctionStmt(AlterFunctionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_func = 0; PyObject *__pyx_v_v_actions = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterFunctionStmt", 1); /* "pglast/ast.pyx":1376 * * cdef create_AlterFunctionStmt(structs.AlterFunctionStmt* data, offset_to_index): * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1377 * cdef create_AlterFunctionStmt(structs.AlterFunctionStmt* data, offset_to_index): * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) * return ast.AlterFunctionStmt(v_objtype, v_func, v_actions) */ __pyx_t_6 = (__pyx_v_data->func != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->func, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1378 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterFunctionStmt(v_objtype, v_func, v_actions) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->actions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1378, __pyx_L1_error) __pyx_v_v_actions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1379 * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) * return ast.AlterFunctionStmt(v_objtype, v_func, v_actions) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterFunctionStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_objtype, __pyx_v_v_func, __pyx_v_v_actions}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1375 * * * cdef create_AlterFunctionStmt(structs.AlterFunctionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterFunctionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_func); __Pyx_XDECREF(__pyx_v_v_actions); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1382 * * * cdef create_DoStmt(structs.DoStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * return ast.DoStmt(v_args) */ static PyObject *__pyx_f_6pglast_6parser_create_DoStmt(DoStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_args = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DoStmt", 1); /* "pglast/ast.pyx":1383 * * cdef create_DoStmt(structs.DoStmt* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * return ast.DoStmt(v_args) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1383, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1384 * cdef create_DoStmt(structs.DoStmt* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * return ast.DoStmt(v_args) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DoStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v_args}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1382 * * * cdef create_DoStmt(structs.DoStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * return ast.DoStmt(v_args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_DoStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1387 * * * cdef create_InlineCodeBlock(structs.InlineCodeBlock* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_source_text = data.source_text.decode("utf-8") if data.source_text is not NULL else None * cdef object v_langIsTrusted = bool(data.langIsTrusted) */ static PyObject *__pyx_f_6pglast_6parser_create_InlineCodeBlock(InlineCodeBlock *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_source_text = 0; PyObject *__pyx_v_v_langIsTrusted = 0; PyObject *__pyx_v_v_atomic = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_InlineCodeBlock", 1); /* "pglast/ast.pyx":1388 * * cdef create_InlineCodeBlock(structs.InlineCodeBlock* data, offset_to_index): * cdef object v_source_text = data.source_text.decode("utf-8") if data.source_text is not NULL else None # <<<<<<<<<<<<<< * cdef object v_langIsTrusted = bool(data.langIsTrusted) * cdef object v_atomic = bool(data.atomic) */ __pyx_t_2 = (__pyx_v_data->source_text != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->source_text; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1388, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_source_text = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1389 * cdef create_InlineCodeBlock(structs.InlineCodeBlock* data, offset_to_index): * cdef object v_source_text = data.source_text.decode("utf-8") if data.source_text is not NULL else None * cdef object v_langIsTrusted = bool(data.langIsTrusted) # <<<<<<<<<<<<<< * cdef object v_atomic = bool(data.atomic) * return ast.InlineCodeBlock(v_source_text, v_langIsTrusted, v_atomic) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->langIsTrusted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_langIsTrusted = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1390 * cdef object v_source_text = data.source_text.decode("utf-8") if data.source_text is not NULL else None * cdef object v_langIsTrusted = bool(data.langIsTrusted) * cdef object v_atomic = bool(data.atomic) # <<<<<<<<<<<<<< * return ast.InlineCodeBlock(v_source_text, v_langIsTrusted, v_atomic) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->atomic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_atomic = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1391 * cdef object v_langIsTrusted = bool(data.langIsTrusted) * cdef object v_atomic = bool(data.atomic) * return ast.InlineCodeBlock(v_source_text, v_langIsTrusted, v_atomic) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InlineCodeBlock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_source_text, __pyx_v_v_langIsTrusted, __pyx_v_v_atomic}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1387 * * * cdef create_InlineCodeBlock(structs.InlineCodeBlock* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_source_text = data.source_text.decode("utf-8") if data.source_text is not NULL else None * cdef object v_langIsTrusted = bool(data.langIsTrusted) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_InlineCodeBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_source_text); __Pyx_XDECREF(__pyx_v_v_langIsTrusted); __Pyx_XDECREF(__pyx_v_v_atomic); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1394 * * * cdef create_CallStmt(structs.CallStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_funccall = create(data.funccall, offset_to_index) if data.funccall is not NULL else None * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CallStmt(CallStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_funccall = 0; PyObject *__pyx_v_v_funcexpr = 0; PyObject *__pyx_v_v_outargs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CallStmt", 1); /* "pglast/ast.pyx":1395 * * cdef create_CallStmt(structs.CallStmt* data, offset_to_index): * cdef object v_funccall = create(data.funccall, offset_to_index) if data.funccall is not NULL else None # <<<<<<<<<<<<<< * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef tuple v_outargs = _pg_list_to_tuple(data.outargs, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->funccall != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->funccall, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_funccall = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1396 * cdef create_CallStmt(structs.CallStmt* data, offset_to_index): * cdef object v_funccall = create(data.funccall, offset_to_index) if data.funccall is not NULL else None * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_outargs = _pg_list_to_tuple(data.outargs, offset_to_index) * return ast.CallStmt(v_funccall, v_funcexpr, v_outargs) */ __pyx_t_2 = (__pyx_v_data->funcexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->funcexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_funcexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1397 * cdef object v_funccall = create(data.funccall, offset_to_index) if data.funccall is not NULL else None * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef tuple v_outargs = _pg_list_to_tuple(data.outargs, offset_to_index) # <<<<<<<<<<<<<< * return ast.CallStmt(v_funccall, v_funcexpr, v_outargs) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->outargs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1397, __pyx_L1_error) __pyx_v_v_outargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1398 * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None * cdef tuple v_outargs = _pg_list_to_tuple(data.outargs, offset_to_index) * return ast.CallStmt(v_funccall, v_funcexpr, v_outargs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CallStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_funccall, __pyx_v_v_funcexpr, __pyx_v_v_outargs}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1394 * * * cdef create_CallStmt(structs.CallStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_funccall = create(data.funccall, offset_to_index) if data.funccall is not NULL else None * cdef object v_funcexpr = create(data.funcexpr, offset_to_index) if data.funcexpr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CallStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_funccall); __Pyx_XDECREF(__pyx_v_v_funcexpr); __Pyx_XDECREF(__pyx_v_v_outargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1401 * * * cdef create_CallContext(structs.CallContext* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_atomic = bool(data.atomic) * return ast.CallContext(v_atomic) */ static PyObject *__pyx_f_6pglast_6parser_create_CallContext(CallContext *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_atomic = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CallContext", 1); /* "pglast/ast.pyx":1402 * * cdef create_CallContext(structs.CallContext* data, offset_to_index): * cdef object v_atomic = bool(data.atomic) # <<<<<<<<<<<<<< * return ast.CallContext(v_atomic) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->atomic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_atomic = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1403 * cdef create_CallContext(structs.CallContext* data, offset_to_index): * cdef object v_atomic = bool(data.atomic) * return ast.CallContext(v_atomic) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CallContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_atomic}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1401 * * * cdef create_CallContext(structs.CallContext* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_atomic = bool(data.atomic) * return ast.CallContext(v_atomic) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CallContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_atomic); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1406 * * * cdef create_RenameStmt(structs.RenameStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_renameType = getattr(enums, 'ObjectType')(data.renameType) * cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) */ static PyObject *__pyx_f_6pglast_6parser_create_RenameStmt(RenameStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_renameType = 0; PyObject *__pyx_v_v_relationType = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_v_v_subname = 0; PyObject *__pyx_v_v_newname = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RenameStmt", 1); /* "pglast/ast.pyx":1407 * * cdef create_RenameStmt(structs.RenameStmt* data, offset_to_index): * cdef object v_renameType = getattr(enums, 'ObjectType')(data.renameType) # <<<<<<<<<<<<<< * cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->renameType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_renameType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1408 * cdef create_RenameStmt(structs.RenameStmt* data, offset_to_index): * cdef object v_renameType = getattr(enums, 'ObjectType')(data.renameType) * cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->relationType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_relationType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1409 * cdef object v_renameType = getattr(enums, 'ObjectType')(data.renameType) * cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None */ __pyx_t_6 = (__pyx_v_data->relation != NULL); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1410 * cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_newname = data.newname.decode("utf-8") if data.newname is not NULL else None */ __pyx_t_6 = (__pyx_v_data->object != NULL); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1411 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_newname = data.newname.decode("utf-8") if data.newname is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_6 = (__pyx_v_data->subname != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->subname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1411, __pyx_L1_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_subname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1412 * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_newname = data.newname.decode("utf-8") if data.newname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_6 = (__pyx_v_data->newname != NULL); if (__pyx_t_6) { __pyx_t_9 = __pyx_v_data->newname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1412, __pyx_L1_error) __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1413 * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_newname = data.newname.decode("utf-8") if data.newname is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.RenameStmt(v_renameType, v_relationType, v_relation, v_object, v_subname, v_newname, v_behavior, v_missing_ok) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1414 * cdef object v_newname = data.newname.decode("utf-8") if data.newname is not NULL else None * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.RenameStmt(v_renameType, v_relationType, v_relation, v_object, v_subname, v_newname, v_behavior, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1415 * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * cdef object v_missing_ok = bool(data.missing_ok) * return ast.RenameStmt(v_renameType, v_relationType, v_relation, v_object, v_subname, v_newname, v_behavior, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RenameStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_3, __pyx_v_v_renameType, __pyx_v_v_relationType, __pyx_v_v_relation, __pyx_v_v_object, __pyx_v_v_subname, __pyx_v_v_newname, __pyx_v_v_behavior, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 8+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1406 * * * cdef create_RenameStmt(structs.RenameStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_renameType = getattr(enums, 'ObjectType')(data.renameType) * cdef object v_relationType = getattr(enums, 'ObjectType')(data.relationType) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RenameStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_renameType); __Pyx_XDECREF(__pyx_v_v_relationType); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XDECREF(__pyx_v_v_subname); __Pyx_XDECREF(__pyx_v_v_newname); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1418 * * * cdef create_AlterObjectDependsStmt(structs.AlterObjectDependsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterObjectDependsStmt(AlterObjectDependsStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objectType = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_v_v_extname = 0; PyObject *__pyx_v_v_remove = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterObjectDependsStmt", 1); /* "pglast/ast.pyx":1419 * * cdef create_AlterObjectDependsStmt(structs.AlterObjectDependsStmt* data, offset_to_index): * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objectType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objectType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1420 * cdef create_AlterObjectDependsStmt(structs.AlterObjectDependsStmt* data, offset_to_index): * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_extname = create(data.extname, offset_to_index) if data.extname is not NULL else None */ __pyx_t_6 = (__pyx_v_data->relation != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1421 * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * cdef object v_extname = create(data.extname, offset_to_index) if data.extname is not NULL else None * cdef object v_remove = bool(data.remove) */ __pyx_t_6 = (__pyx_v_data->object != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1422 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_extname = create(data.extname, offset_to_index) if data.extname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_remove = bool(data.remove) * return ast.AlterObjectDependsStmt(v_objectType, v_relation, v_object, v_extname, v_remove) */ __pyx_t_6 = (__pyx_v_data->extname != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->extname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_extname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1423 * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_extname = create(data.extname, offset_to_index) if data.extname is not NULL else None * cdef object v_remove = bool(data.remove) # <<<<<<<<<<<<<< * return ast.AlterObjectDependsStmt(v_objectType, v_relation, v_object, v_extname, v_remove) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_remove = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1424 * cdef object v_extname = create(data.extname, offset_to_index) if data.extname is not NULL else None * cdef object v_remove = bool(data.remove) * return ast.AlterObjectDependsStmt(v_objectType, v_relation, v_object, v_extname, v_remove) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterObjectDependsStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_objectType, __pyx_v_v_relation, __pyx_v_v_object, __pyx_v_v_extname, __pyx_v_v_remove}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1418 * * * cdef create_AlterObjectDependsStmt(structs.AlterObjectDependsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterObjectDependsStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objectType); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XDECREF(__pyx_v_v_extname); __Pyx_XDECREF(__pyx_v_v_remove); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1427 * * * cdef create_AlterObjectSchemaStmt(structs.AlterObjectSchemaStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterObjectSchemaStmt(AlterObjectSchemaStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objectType = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_v_v_newschema = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterObjectSchemaStmt", 1); /* "pglast/ast.pyx":1428 * * cdef create_AlterObjectSchemaStmt(structs.AlterObjectSchemaStmt* data, offset_to_index): * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objectType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objectType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1429 * cdef create_AlterObjectSchemaStmt(structs.AlterObjectSchemaStmt* data, offset_to_index): * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_newschema = data.newschema.decode("utf-8") if data.newschema is not NULL else None */ __pyx_t_6 = (__pyx_v_data->relation != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1430 * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * cdef object v_newschema = data.newschema.decode("utf-8") if data.newschema is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_6 = (__pyx_v_data->object != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1431 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_newschema = data.newschema.decode("utf-8") if data.newschema is not NULL else None # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterObjectSchemaStmt(v_objectType, v_relation, v_object, v_newschema, v_missing_ok) */ __pyx_t_6 = (__pyx_v_data->newschema != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->newschema; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1431, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newschema = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1432 * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_newschema = data.newschema.decode("utf-8") if data.newschema is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.AlterObjectSchemaStmt(v_objectType, v_relation, v_object, v_newschema, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1433 * cdef object v_newschema = data.newschema.decode("utf-8") if data.newschema is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterObjectSchemaStmt(v_objectType, v_relation, v_object, v_newschema, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterObjectSchemaStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_objectType, __pyx_v_v_relation, __pyx_v_v_object, __pyx_v_v_newschema, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1427 * * * cdef create_AlterObjectSchemaStmt(structs.AlterObjectSchemaStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterObjectSchemaStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objectType); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XDECREF(__pyx_v_v_newschema); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1436 * * * cdef create_AlterOwnerStmt(structs.AlterOwnerStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterOwnerStmt(AlterOwnerStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_objectType = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_object = 0; PyObject *__pyx_v_v_newowner = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterOwnerStmt", 1); /* "pglast/ast.pyx":1437 * * cdef create_AlterOwnerStmt(structs.AlterOwnerStmt* data, offset_to_index): * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objectType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_objectType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1438 * cdef create_AlterOwnerStmt(structs.AlterOwnerStmt* data, offset_to_index): * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None */ __pyx_t_6 = (__pyx_v_data->relation != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1439 * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None # <<<<<<<<<<<<<< * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None * return ast.AlterOwnerStmt(v_objectType, v_relation, v_object, v_newowner) */ __pyx_t_6 = (__pyx_v_data->object != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->object, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_object = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1440 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterOwnerStmt(v_objectType, v_relation, v_object, v_newowner) * */ __pyx_t_6 = (__pyx_v_data->newowner != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->newowner, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newowner = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1441 * cdef object v_object = create(data.object, offset_to_index) if data.object is not NULL else None * cdef object v_newowner = create(data.newowner, offset_to_index) if data.newowner is not NULL else None * return ast.AlterOwnerStmt(v_objectType, v_relation, v_object, v_newowner) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterOwnerStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_objectType, __pyx_v_v_relation, __pyx_v_v_object, __pyx_v_v_newowner}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1436 * * * cdef create_AlterOwnerStmt(structs.AlterOwnerStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_objectType = getattr(enums, 'ObjectType')(data.objectType) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterOwnerStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_objectType); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_object); __Pyx_XDECREF(__pyx_v_v_newowner); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1444 * * * cdef create_AlterOperatorStmt(structs.AlterOperatorStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_opername = create(data.opername, offset_to_index) if data.opername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterOperatorStmt(AlterOperatorStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_opername = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterOperatorStmt", 1); /* "pglast/ast.pyx":1445 * * cdef create_AlterOperatorStmt(structs.AlterOperatorStmt* data, offset_to_index): * cdef object v_opername = create(data.opername, offset_to_index) if data.opername is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterOperatorStmt(v_opername, v_options) */ __pyx_t_2 = (__pyx_v_data->opername != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->opername, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_opername = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1446 * cdef create_AlterOperatorStmt(structs.AlterOperatorStmt* data, offset_to_index): * cdef object v_opername = create(data.opername, offset_to_index) if data.opername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterOperatorStmt(v_opername, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1446, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1447 * cdef object v_opername = create(data.opername, offset_to_index) if data.opername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterOperatorStmt(v_opername, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterOperatorStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_opername, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1444 * * * cdef create_AlterOperatorStmt(structs.AlterOperatorStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_opername = create(data.opername, offset_to_index) if data.opername is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterOperatorStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_opername); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1450 * * * cdef create_AlterTypeStmt(structs.AlterTypeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTypeStmt(AlterTypeStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTypeStmt", 1); /* "pglast/ast.pyx":1451 * * cdef create_AlterTypeStmt(structs.AlterTypeStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterTypeStmt(v_typeName, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1451, __pyx_L1_error) __pyx_v_v_typeName = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1452 * cdef create_AlterTypeStmt(structs.AlterTypeStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterTypeStmt(v_typeName, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1452, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1453 * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterTypeStmt(v_typeName, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AlterTypeStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_v_typeName, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1450 * * * cdef create_AlterTypeStmt(structs.AlterTypeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_AlterTypeStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1456 * * * cdef create_RuleStmt(structs.RuleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RuleStmt(RuleStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_rulename = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_event = 0; PyObject *__pyx_v_v_instead = 0; PyObject *__pyx_v_v_actions = 0; PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RuleStmt", 1); /* "pglast/ast.pyx":1457 * * cdef create_RuleStmt(structs.RuleStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1458 * cdef create_RuleStmt(structs.RuleStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_event = getattr(enums, 'CmdType')(data.event) */ __pyx_t_2 = (__pyx_v_data->rulename != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->rulename; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1458, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rulename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1459 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef object v_event = getattr(enums, 'CmdType')(data.event) * cdef object v_instead = bool(data.instead) */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1460 * cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_event = getattr(enums, 'CmdType')(data.event) # <<<<<<<<<<<<<< * cdef object v_instead = bool(data.instead) * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CmdType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CmdType(__pyx_v_data->event); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_event = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1461 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef object v_event = getattr(enums, 'CmdType')(data.event) * cdef object v_instead = bool(data.instead) # <<<<<<<<<<<<<< * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) * cdef object v_replace = bool(data.replace) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->instead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_instead = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1462 * cdef object v_event = getattr(enums, 'CmdType')(data.event) * cdef object v_instead = bool(data.instead) * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * return ast.RuleStmt(v_relation, v_rulename, v_whereClause, v_event, v_instead, v_actions, v_replace) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->actions, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1462, __pyx_L1_error) __pyx_v_v_actions = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1463 * cdef object v_instead = bool(data.instead) * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * return ast.RuleStmt(v_relation, v_rulename, v_whereClause, v_event, v_instead, v_actions, v_replace) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1464 * cdef tuple v_actions = _pg_list_to_tuple(data.actions, offset_to_index) * cdef object v_replace = bool(data.replace) * return ast.RuleStmt(v_relation, v_rulename, v_whereClause, v_event, v_instead, v_actions, v_replace) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_RuleStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_6, __pyx_v_v_relation, __pyx_v_v_rulename, __pyx_v_v_whereClause, __pyx_v_v_event, __pyx_v_v_instead, __pyx_v_v_actions, __pyx_v_v_replace}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 7+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1456 * * * cdef create_RuleStmt(structs.RuleStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_rulename = data.rulename.decode("utf-8") if data.rulename is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_RuleStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_rulename); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_event); __Pyx_XDECREF(__pyx_v_v_instead); __Pyx_XDECREF(__pyx_v_v_actions); __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1467 * * * cdef create_NotifyStmt(structs.NotifyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * cdef object v_payload = data.payload.decode("utf-8") if data.payload is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_NotifyStmt(NotifyStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_conditionname = 0; PyObject *__pyx_v_v_payload = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_NotifyStmt", 1); /* "pglast/ast.pyx":1468 * * cdef create_NotifyStmt(structs.NotifyStmt* data, offset_to_index): * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_payload = data.payload.decode("utf-8") if data.payload is not NULL else None * return ast.NotifyStmt(v_conditionname, v_payload) */ __pyx_t_2 = (__pyx_v_data->conditionname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->conditionname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1468, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conditionname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1469 * cdef create_NotifyStmt(structs.NotifyStmt* data, offset_to_index): * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * cdef object v_payload = data.payload.decode("utf-8") if data.payload is not NULL else None # <<<<<<<<<<<<<< * return ast.NotifyStmt(v_conditionname, v_payload) * */ __pyx_t_2 = (__pyx_v_data->payload != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->payload; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1469, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_payload = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1470 * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * cdef object v_payload = data.payload.decode("utf-8") if data.payload is not NULL else None * return ast.NotifyStmt(v_conditionname, v_payload) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_NotifyStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_conditionname, __pyx_v_v_payload}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1467 * * * cdef create_NotifyStmt(structs.NotifyStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * cdef object v_payload = data.payload.decode("utf-8") if data.payload is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_NotifyStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_conditionname); __Pyx_XDECREF(__pyx_v_v_payload); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1473 * * * cdef create_ListenStmt(structs.ListenStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * return ast.ListenStmt(v_conditionname) */ static PyObject *__pyx_f_6pglast_6parser_create_ListenStmt(ListenStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_conditionname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ListenStmt", 1); /* "pglast/ast.pyx":1474 * * cdef create_ListenStmt(structs.ListenStmt* data, offset_to_index): * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None # <<<<<<<<<<<<<< * return ast.ListenStmt(v_conditionname) * */ __pyx_t_2 = (__pyx_v_data->conditionname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->conditionname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1474, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conditionname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1475 * cdef create_ListenStmt(structs.ListenStmt* data, offset_to_index): * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * return ast.ListenStmt(v_conditionname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ListenStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_conditionname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1473 * * * cdef create_ListenStmt(structs.ListenStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * return ast.ListenStmt(v_conditionname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_ListenStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_conditionname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1478 * * * cdef create_UnlistenStmt(structs.UnlistenStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * return ast.UnlistenStmt(v_conditionname) */ static PyObject *__pyx_f_6pglast_6parser_create_UnlistenStmt(UnlistenStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_conditionname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_UnlistenStmt", 1); /* "pglast/ast.pyx":1479 * * cdef create_UnlistenStmt(structs.UnlistenStmt* data, offset_to_index): * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None # <<<<<<<<<<<<<< * return ast.UnlistenStmt(v_conditionname) * */ __pyx_t_2 = (__pyx_v_data->conditionname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->conditionname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1479, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conditionname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1480 * cdef create_UnlistenStmt(structs.UnlistenStmt* data, offset_to_index): * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * return ast.UnlistenStmt(v_conditionname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_UnlistenStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_conditionname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1478 * * * cdef create_UnlistenStmt(structs.UnlistenStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_conditionname = data.conditionname.decode("utf-8") if data.conditionname is not NULL else None * return ast.UnlistenStmt(v_conditionname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_UnlistenStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_conditionname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1483 * * * cdef create_TransactionStmt(structs.TransactionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'TransactionStmtKind')(data.kind) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_TransactionStmt(TransactionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_savepoint_name = 0; PyObject *__pyx_v_v_gid = 0; PyObject *__pyx_v_v_chain = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TransactionStmt", 1); /* "pglast/ast.pyx":1484 * * cdef create_TransactionStmt(structs.TransactionStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'TransactionStmtKind')(data.kind) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_savepoint_name = data.savepoint_name.decode("utf-8") if data.savepoint_name is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_TransactionStmtKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_TransactionStmtKind(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1485 * cdef create_TransactionStmt(structs.TransactionStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'TransactionStmtKind')(data.kind) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_savepoint_name = data.savepoint_name.decode("utf-8") if data.savepoint_name is not NULL else None * cdef object v_gid = data.gid.decode("utf-8") if data.gid is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1485, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1486 * cdef object v_kind = getattr(enums, 'TransactionStmtKind')(data.kind) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_savepoint_name = data.savepoint_name.decode("utf-8") if data.savepoint_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_gid = data.gid.decode("utf-8") if data.gid is not NULL else None * cdef object v_chain = bool(data.chain) */ __pyx_t_6 = (__pyx_v_data->savepoint_name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->savepoint_name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1486, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_savepoint_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1487 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_savepoint_name = data.savepoint_name.decode("utf-8") if data.savepoint_name is not NULL else None * cdef object v_gid = data.gid.decode("utf-8") if data.gid is not NULL else None # <<<<<<<<<<<<<< * cdef object v_chain = bool(data.chain) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->gid != NULL); if (__pyx_t_6) { __pyx_t_9 = __pyx_v_data->gid; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1487, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_gid = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1488 * cdef object v_savepoint_name = data.savepoint_name.decode("utf-8") if data.savepoint_name is not NULL else None * cdef object v_gid = data.gid.decode("utf-8") if data.gid is not NULL else None * cdef object v_chain = bool(data.chain) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.TransactionStmt(v_kind, v_options, v_savepoint_name, v_gid, v_chain, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->chain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_chain = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1489 * cdef object v_gid = data.gid.decode("utf-8") if data.gid is not NULL else None * cdef object v_chain = bool(data.chain) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.TransactionStmt(v_kind, v_options, v_savepoint_name, v_gid, v_chain, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1490 * cdef object v_chain = bool(data.chain) * cdef object v_location = offset_to_index(data.location) * return ast.TransactionStmt(v_kind, v_options, v_savepoint_name, v_gid, v_chain, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TransactionStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_v_v_kind, __pyx_v_v_options, __pyx_v_v_savepoint_name, __pyx_v_v_gid, __pyx_v_v_chain, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1483 * * * cdef create_TransactionStmt(structs.TransactionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'TransactionStmtKind')(data.kind) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_TransactionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_savepoint_name); __Pyx_XDECREF(__pyx_v_v_gid); __Pyx_XDECREF(__pyx_v_v_chain); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1493 * * * cdef create_CompositeTypeStmt(structs.CompositeTypeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typevar = create(data.typevar, offset_to_index) if data.typevar is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CompositeTypeStmt(CompositeTypeStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typevar = 0; PyObject *__pyx_v_v_coldeflist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CompositeTypeStmt", 1); /* "pglast/ast.pyx":1494 * * cdef create_CompositeTypeStmt(structs.CompositeTypeStmt* data, offset_to_index): * cdef object v_typevar = create(data.typevar, offset_to_index) if data.typevar is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) * return ast.CompositeTypeStmt(v_typevar, v_coldeflist) */ __pyx_t_2 = (__pyx_v_data->typevar != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->typevar, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_typevar = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1495 * cdef create_CompositeTypeStmt(structs.CompositeTypeStmt* data, offset_to_index): * cdef object v_typevar = create(data.typevar, offset_to_index) if data.typevar is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) # <<<<<<<<<<<<<< * return ast.CompositeTypeStmt(v_typevar, v_coldeflist) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coldeflist, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1495, __pyx_L1_error) __pyx_v_v_coldeflist = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1496 * cdef object v_typevar = create(data.typevar, offset_to_index) if data.typevar is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) * return ast.CompositeTypeStmt(v_typevar, v_coldeflist) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CompositeTypeStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_typevar, __pyx_v_v_coldeflist}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1493 * * * cdef create_CompositeTypeStmt(structs.CompositeTypeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typevar = create(data.typevar, offset_to_index) if data.typevar is not NULL else None * cdef tuple v_coldeflist = _pg_list_to_tuple(data.coldeflist, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CompositeTypeStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typevar); __Pyx_XDECREF(__pyx_v_v_coldeflist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1499 * * * cdef create_CreateEnumStmt(structs.CreateEnumStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_vals = _pg_list_to_tuple(data.vals, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateEnumStmt(CreateEnumStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_vals = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateEnumStmt", 1); /* "pglast/ast.pyx":1500 * * cdef create_CreateEnumStmt(structs.CreateEnumStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_vals = _pg_list_to_tuple(data.vals, offset_to_index) * return ast.CreateEnumStmt(v_typeName, v_vals) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1500, __pyx_L1_error) __pyx_v_v_typeName = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1501 * cdef create_CreateEnumStmt(structs.CreateEnumStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_vals = _pg_list_to_tuple(data.vals, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateEnumStmt(v_typeName, v_vals) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->vals, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1501, __pyx_L1_error) __pyx_v_v_vals = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1502 * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_vals = _pg_list_to_tuple(data.vals, offset_to_index) * return ast.CreateEnumStmt(v_typeName, v_vals) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CreateEnumStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_v_typeName, __pyx_v_v_vals}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1499 * * * cdef create_CreateEnumStmt(structs.CreateEnumStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_vals = _pg_list_to_tuple(data.vals, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_CreateEnumStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_vals); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1505 * * * cdef create_CreateRangeStmt(structs.CreateRangeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreateRangeStmt(CreateRangeStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_params = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateRangeStmt", 1); /* "pglast/ast.pyx":1506 * * cdef create_CreateRangeStmt(structs.CreateRangeStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.CreateRangeStmt(v_typeName, v_params) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1506, __pyx_L1_error) __pyx_v_v_typeName = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1507 * cdef create_CreateRangeStmt(structs.CreateRangeStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateRangeStmt(v_typeName, v_params) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->params, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1507, __pyx_L1_error) __pyx_v_v_params = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1508 * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.CreateRangeStmt(v_typeName, v_params) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CreateRangeStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_v_typeName, __pyx_v_v_params}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1505 * * * cdef create_CreateRangeStmt(structs.CreateRangeStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_CreateRangeStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_params); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1511 * * * cdef create_AlterEnumStmt(structs.AlterEnumStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterEnumStmt(AlterEnumStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeName = 0; PyObject *__pyx_v_v_oldVal = 0; PyObject *__pyx_v_v_newVal = 0; PyObject *__pyx_v_v_newValNeighbor = 0; PyObject *__pyx_v_v_newValIsAfter = 0; PyObject *__pyx_v_v_skipIfNewValExists = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterEnumStmt", 1); /* "pglast/ast.pyx":1512 * * cdef create_AlterEnumStmt(structs.AlterEnumStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None * cdef object v_newVal = data.newVal.decode("utf-8") if data.newVal is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->typeName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1512, __pyx_L1_error) __pyx_v_v_typeName = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1513 * cdef create_AlterEnumStmt(structs.AlterEnumStmt* data, offset_to_index): * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None # <<<<<<<<<<<<<< * cdef object v_newVal = data.newVal.decode("utf-8") if data.newVal is not NULL else None * cdef object v_newValNeighbor = data.newValNeighbor.decode("utf-8") if data.newValNeighbor is not NULL else None */ __pyx_t_2 = (__pyx_v_data->oldVal != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->oldVal; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1513, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_oldVal = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1514 * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None * cdef object v_newVal = data.newVal.decode("utf-8") if data.newVal is not NULL else None # <<<<<<<<<<<<<< * cdef object v_newValNeighbor = data.newValNeighbor.decode("utf-8") if data.newValNeighbor is not NULL else None * cdef object v_newValIsAfter = bool(data.newValIsAfter) */ __pyx_t_2 = (__pyx_v_data->newVal != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->newVal; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1514, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newVal = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1515 * cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None * cdef object v_newVal = data.newVal.decode("utf-8") if data.newVal is not NULL else None * cdef object v_newValNeighbor = data.newValNeighbor.decode("utf-8") if data.newValNeighbor is not NULL else None # <<<<<<<<<<<<<< * cdef object v_newValIsAfter = bool(data.newValIsAfter) * cdef object v_skipIfNewValExists = bool(data.skipIfNewValExists) */ __pyx_t_2 = (__pyx_v_data->newValNeighbor != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->newValNeighbor; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1515, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newValNeighbor = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1516 * cdef object v_newVal = data.newVal.decode("utf-8") if data.newVal is not NULL else None * cdef object v_newValNeighbor = data.newValNeighbor.decode("utf-8") if data.newValNeighbor is not NULL else None * cdef object v_newValIsAfter = bool(data.newValIsAfter) # <<<<<<<<<<<<<< * cdef object v_skipIfNewValExists = bool(data.skipIfNewValExists) * return ast.AlterEnumStmt(v_typeName, v_oldVal, v_newVal, v_newValNeighbor, v_newValIsAfter, v_skipIfNewValExists) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->newValIsAfter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1516, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_newValIsAfter = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1517 * cdef object v_newValNeighbor = data.newValNeighbor.decode("utf-8") if data.newValNeighbor is not NULL else None * cdef object v_newValIsAfter = bool(data.newValIsAfter) * cdef object v_skipIfNewValExists = bool(data.skipIfNewValExists) # <<<<<<<<<<<<<< * return ast.AlterEnumStmt(v_typeName, v_oldVal, v_newVal, v_newValNeighbor, v_newValIsAfter, v_skipIfNewValExists) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->skipIfNewValExists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_skipIfNewValExists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1518 * cdef object v_newValIsAfter = bool(data.newValIsAfter) * cdef object v_skipIfNewValExists = bool(data.skipIfNewValExists) * return ast.AlterEnumStmt(v_typeName, v_oldVal, v_newVal, v_newValNeighbor, v_newValIsAfter, v_skipIfNewValExists) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterEnumStmt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_v_v_typeName, __pyx_v_v_oldVal, __pyx_v_v_newVal, __pyx_v_v_newValNeighbor, __pyx_v_v_newValIsAfter, __pyx_v_v_skipIfNewValExists}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 6+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1511 * * * cdef create_AlterEnumStmt(structs.AlterEnumStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_typeName = _pg_list_to_tuple(data.typeName, offset_to_index) * cdef object v_oldVal = data.oldVal.decode("utf-8") if data.oldVal is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.create_AlterEnumStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeName); __Pyx_XDECREF(__pyx_v_v_oldVal); __Pyx_XDECREF(__pyx_v_v_newVal); __Pyx_XDECREF(__pyx_v_v_newValNeighbor); __Pyx_XDECREF(__pyx_v_v_newValIsAfter); __Pyx_XDECREF(__pyx_v_v_skipIfNewValExists); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1521 * * * cdef create_ViewStmt(structs.ViewStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_view = create(data.view, offset_to_index) if data.view is not NULL else None * cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_ViewStmt(ViewStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_view = 0; PyObject *__pyx_v_v_aliases = 0; PyObject *__pyx_v_v_query = 0; PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_withCheckOption = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ViewStmt", 1); /* "pglast/ast.pyx":1522 * * cdef create_ViewStmt(structs.ViewStmt* data, offset_to_index): * cdef object v_view = create(data.view, offset_to_index) if data.view is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None */ __pyx_t_2 = (__pyx_v_data->view != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->view, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_view = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1523 * cdef create_ViewStmt(structs.ViewStmt* data, offset_to_index): * cdef object v_view = create(data.view, offset_to_index) if data.view is not NULL else None * cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_replace = bool(data.replace) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->aliases, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1523, __pyx_L1_error) __pyx_v_v_aliases = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1524 * cdef object v_view = create(data.view, offset_to_index) if data.view is not NULL else None * cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1525 * cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_withCheckOption = getattr(enums, 'ViewCheckOption')(data.withCheckOption) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1526 * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_replace = bool(data.replace) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_withCheckOption = getattr(enums, 'ViewCheckOption')(data.withCheckOption) * return ast.ViewStmt(v_view, v_aliases, v_query, v_replace, v_options, v_withCheckOption) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1526, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1527 * cdef object v_replace = bool(data.replace) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_withCheckOption = getattr(enums, 'ViewCheckOption')(data.withCheckOption) # <<<<<<<<<<<<<< * return ast.ViewStmt(v_view, v_aliases, v_query, v_replace, v_options, v_withCheckOption) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_ViewCheckOption); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_ViewCheckOption(__pyx_v_data->withCheckOption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_withCheckOption = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1528 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_withCheckOption = getattr(enums, 'ViewCheckOption')(data.withCheckOption) * return ast.ViewStmt(v_view, v_aliases, v_query, v_replace, v_options, v_withCheckOption) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ViewStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_4, __pyx_v_v_view, __pyx_v_v_aliases, __pyx_v_v_query, __pyx_v_v_replace, __pyx_v_v_options, __pyx_v_v_withCheckOption}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1521 * * * cdef create_ViewStmt(structs.ViewStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_view = create(data.view, offset_to_index) if data.view is not NULL else None * cdef tuple v_aliases = _pg_list_to_tuple(data.aliases, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_ViewStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_view); __Pyx_XDECREF(__pyx_v_v_aliases); __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_withCheckOption); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1531 * * * cdef create_LoadStmt(structs.LoadStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None * return ast.LoadStmt(v_filename) */ static PyObject *__pyx_f_6pglast_6parser_create_LoadStmt(LoadStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_filename = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_LoadStmt", 1); /* "pglast/ast.pyx":1532 * * cdef create_LoadStmt(structs.LoadStmt* data, offset_to_index): * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None # <<<<<<<<<<<<<< * return ast.LoadStmt(v_filename) * */ __pyx_t_2 = (__pyx_v_data->filename != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->filename; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1532, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_filename = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1533 * cdef create_LoadStmt(structs.LoadStmt* data, offset_to_index): * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None * return ast.LoadStmt(v_filename) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_LoadStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_filename}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1531 * * * cdef create_LoadStmt(structs.LoadStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_filename = data.filename.decode("utf-8") if data.filename is not NULL else None * return ast.LoadStmt(v_filename) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_LoadStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1536 * * * cdef create_CreatedbStmt(structs.CreatedbStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreatedbStmt(CreatedbStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_dbname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreatedbStmt", 1); /* "pglast/ast.pyx":1537 * * cdef create_CreatedbStmt(structs.CreatedbStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreatedbStmt(v_dbname, v_options) */ __pyx_t_2 = (__pyx_v_data->dbname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->dbname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1537, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_dbname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1538 * cdef create_CreatedbStmt(structs.CreatedbStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreatedbStmt(v_dbname, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1538, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1539 * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreatedbStmt(v_dbname, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreatedbStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_dbname, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1536 * * * cdef create_CreatedbStmt(structs.CreatedbStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreatedbStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_dbname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1542 * * * cdef create_AlterDatabaseStmt(structs.AlterDatabaseStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterDatabaseStmt(AlterDatabaseStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_dbname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterDatabaseStmt", 1); /* "pglast/ast.pyx":1543 * * cdef create_AlterDatabaseStmt(structs.AlterDatabaseStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterDatabaseStmt(v_dbname, v_options) */ __pyx_t_2 = (__pyx_v_data->dbname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->dbname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1543, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_dbname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1544 * cdef create_AlterDatabaseStmt(structs.AlterDatabaseStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterDatabaseStmt(v_dbname, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1544, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1545 * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterDatabaseStmt(v_dbname, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterDatabaseStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_dbname, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1542 * * * cdef create_AlterDatabaseStmt(structs.AlterDatabaseStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterDatabaseStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_dbname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1548 * * * cdef create_AlterDatabaseRefreshCollStmt(structs.AlterDatabaseRefreshCollStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * return ast.AlterDatabaseRefreshCollStmt(v_dbname) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterDatabaseRefreshCollStmt(AlterDatabaseRefreshCollStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_dbname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterDatabaseRefreshCollStmt", 1); /* "pglast/ast.pyx":1549 * * cdef create_AlterDatabaseRefreshCollStmt(structs.AlterDatabaseRefreshCollStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterDatabaseRefreshCollStmt(v_dbname) * */ __pyx_t_2 = (__pyx_v_data->dbname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->dbname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1549, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_dbname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1550 * cdef create_AlterDatabaseRefreshCollStmt(structs.AlterDatabaseRefreshCollStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * return ast.AlterDatabaseRefreshCollStmt(v_dbname) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterDatabaseRefreshCollStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_dbname}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1548 * * * cdef create_AlterDatabaseRefreshCollStmt(structs.AlterDatabaseRefreshCollStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * return ast.AlterDatabaseRefreshCollStmt(v_dbname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterDatabaseRefreshCollStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_dbname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1553 * * * cdef create_AlterDatabaseSetStmt(structs.AlterDatabaseSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterDatabaseSetStmt(AlterDatabaseSetStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_dbname = 0; PyObject *__pyx_v_v_setstmt = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterDatabaseSetStmt", 1); /* "pglast/ast.pyx":1554 * * cdef create_AlterDatabaseSetStmt(structs.AlterDatabaseSetStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterDatabaseSetStmt(v_dbname, v_setstmt) */ __pyx_t_2 = (__pyx_v_data->dbname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->dbname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1554, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_dbname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1555 * cdef create_AlterDatabaseSetStmt(structs.AlterDatabaseSetStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterDatabaseSetStmt(v_dbname, v_setstmt) * */ __pyx_t_2 = (__pyx_v_data->setstmt != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->setstmt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_setstmt = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1556 * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterDatabaseSetStmt(v_dbname, v_setstmt) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AlterDatabaseSetStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_dbname, __pyx_v_v_setstmt}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1553 * * * cdef create_AlterDatabaseSetStmt(structs.AlterDatabaseSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_AlterDatabaseSetStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_dbname); __Pyx_XDECREF(__pyx_v_v_setstmt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1559 * * * cdef create_DropdbStmt(structs.DropdbStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ static PyObject *__pyx_f_6pglast_6parser_create_DropdbStmt(DropdbStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_dbname = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropdbStmt", 1); /* "pglast/ast.pyx":1560 * * cdef create_DropdbStmt(structs.DropdbStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->dbname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->dbname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1560, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_dbname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1561 * cdef create_DropdbStmt(structs.DropdbStmt* data, offset_to_index): * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.DropdbStmt(v_dbname, v_missing_ok, v_options) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1562 * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.DropdbStmt(v_dbname, v_missing_ok, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1562, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1563 * cdef object v_missing_ok = bool(data.missing_ok) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.DropdbStmt(v_dbname, v_missing_ok, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DropdbStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_dbname, __pyx_v_v_missing_ok, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1559 * * * cdef create_DropdbStmt(structs.DropdbStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_dbname = data.dbname.decode("utf-8") if data.dbname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_DropdbStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_dbname); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1566 * * * cdef create_AlterSystemStmt(structs.AlterSystemStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterSystemStmt(v_setstmt) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterSystemStmt(AlterSystemStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_setstmt = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterSystemStmt", 1); /* "pglast/ast.pyx":1567 * * cdef create_AlterSystemStmt(structs.AlterSystemStmt* data, offset_to_index): * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None # <<<<<<<<<<<<<< * return ast.AlterSystemStmt(v_setstmt) * */ __pyx_t_2 = (__pyx_v_data->setstmt != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->setstmt, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_setstmt = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1568 * cdef create_AlterSystemStmt(structs.AlterSystemStmt* data, offset_to_index): * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterSystemStmt(v_setstmt) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterSystemStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_setstmt}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1566 * * * cdef create_AlterSystemStmt(structs.AlterSystemStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_setstmt = create(data.setstmt, offset_to_index) if data.setstmt is not NULL else None * return ast.AlterSystemStmt(v_setstmt) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterSystemStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_setstmt); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1571 * * * cdef create_ClusterStmt(structs.ClusterStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ClusterStmt(ClusterStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_indexname = 0; PyObject *__pyx_v_v_params = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ClusterStmt", 1); /* "pglast/ast.pyx":1572 * * cdef create_ClusterStmt(structs.ClusterStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1573 * cdef create_ClusterStmt(structs.ClusterStmt* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.ClusterStmt(v_relation, v_indexname, v_params) */ __pyx_t_2 = (__pyx_v_data->indexname != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->indexname; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1573, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_indexname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1574 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) # <<<<<<<<<<<<<< * return ast.ClusterStmt(v_relation, v_indexname, v_params) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->params, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1574, __pyx_L1_error) __pyx_v_v_params = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1575 * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.ClusterStmt(v_relation, v_indexname, v_params) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ClusterStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_indexname, __pyx_v_v_params}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1571 * * * cdef create_ClusterStmt(structs.ClusterStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_indexname = data.indexname.decode("utf-8") if data.indexname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_ClusterStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_indexname); __Pyx_XDECREF(__pyx_v_v_params); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1578 * * * cdef create_VacuumStmt(structs.VacuumStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_VacuumStmt(VacuumStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_rels = 0; PyObject *__pyx_v_v_is_vacuumcmd = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_VacuumStmt", 1); /* "pglast/ast.pyx":1579 * * cdef create_VacuumStmt(structs.VacuumStmt* data, offset_to_index): * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) * cdef object v_is_vacuumcmd = bool(data.is_vacuumcmd) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1579, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1580 * cdef create_VacuumStmt(structs.VacuumStmt* data, offset_to_index): * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_is_vacuumcmd = bool(data.is_vacuumcmd) * return ast.VacuumStmt(v_options, v_rels, v_is_vacuumcmd) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->rels, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1580, __pyx_L1_error) __pyx_v_v_rels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1581 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) * cdef object v_is_vacuumcmd = bool(data.is_vacuumcmd) # <<<<<<<<<<<<<< * return ast.VacuumStmt(v_options, v_rels, v_is_vacuumcmd) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_vacuumcmd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_vacuumcmd = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1582 * cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) * cdef object v_is_vacuumcmd = bool(data.is_vacuumcmd) * return ast.VacuumStmt(v_options, v_rels, v_is_vacuumcmd) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_VacuumStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_options, __pyx_v_v_rels, __pyx_v_v_is_vacuumcmd}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1578 * * * cdef create_VacuumStmt(structs.VacuumStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_rels = _pg_list_to_tuple(data.rels, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_VacuumStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_rels); __Pyx_XDECREF(__pyx_v_v_is_vacuumcmd); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1585 * * * cdef create_VacuumRelation(structs.VacuumRelation* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_va_cols = _pg_list_to_tuple(data.va_cols, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_VacuumRelation(VacuumRelation *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_va_cols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_VacuumRelation", 1); /* "pglast/ast.pyx":1586 * * cdef create_VacuumRelation(structs.VacuumRelation* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_va_cols = _pg_list_to_tuple(data.va_cols, offset_to_index) * return ast.VacuumRelation(v_relation, v_va_cols) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1587 * cdef create_VacuumRelation(structs.VacuumRelation* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_va_cols = _pg_list_to_tuple(data.va_cols, offset_to_index) # <<<<<<<<<<<<<< * return ast.VacuumRelation(v_relation, v_va_cols) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->va_cols, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1587, __pyx_L1_error) __pyx_v_v_va_cols = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1588 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_va_cols = _pg_list_to_tuple(data.va_cols, offset_to_index) * return ast.VacuumRelation(v_relation, v_va_cols) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_VacuumRelation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_va_cols}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1585 * * * cdef create_VacuumRelation(structs.VacuumRelation* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef tuple v_va_cols = _pg_list_to_tuple(data.va_cols, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_VacuumRelation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_va_cols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1591 * * * cdef create_ExplainStmt(structs.ExplainStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_ExplainStmt(ExplainStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_query = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ExplainStmt", 1); /* "pglast/ast.pyx":1592 * * cdef create_ExplainStmt(structs.ExplainStmt* data, offset_to_index): * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.ExplainStmt(v_query, v_options) */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1593 * cdef create_ExplainStmt(structs.ExplainStmt* data, offset_to_index): * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.ExplainStmt(v_query, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1593, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1594 * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.ExplainStmt(v_query, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ExplainStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_query, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1591 * * * cdef create_ExplainStmt(structs.ExplainStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ExplainStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1597 * * * cdef create_CreateTableAsStmt(structs.CreateTableAsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateTableAsStmt(CreateTableAsStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_query = 0; PyObject *__pyx_v_v_into = 0; PyObject *__pyx_v_v_objtype = 0; PyObject *__pyx_v_v_is_select_into = 0; PyObject *__pyx_v_v_if_not_exists = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateTableAsStmt", 1); /* "pglast/ast.pyx":1598 * * cdef create_CreateTableAsStmt(structs.CreateTableAsStmt* data, offset_to_index): * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1599 * cdef create_CreateTableAsStmt(structs.CreateTableAsStmt* data, offset_to_index): * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None # <<<<<<<<<<<<<< * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_is_select_into = bool(data.is_select_into) */ __pyx_t_2 = (__pyx_v_data->into != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->into, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_into = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1600 * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) # <<<<<<<<<<<<<< * cdef object v_is_select_into = bool(data.is_select_into) * cdef object v_if_not_exists = bool(data.if_not_exists) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_ObjectType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_ObjectType(__pyx_v_data->objtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_objtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1601 * cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_is_select_into = bool(data.is_select_into) # <<<<<<<<<<<<<< * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateTableAsStmt(v_query, v_into, v_objtype, v_is_select_into, v_if_not_exists) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->is_select_into); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1601, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_is_select_into = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1602 * cdef object v_objtype = getattr(enums, 'ObjectType')(data.objtype) * cdef object v_is_select_into = bool(data.is_select_into) * cdef object v_if_not_exists = bool(data.if_not_exists) # <<<<<<<<<<<<<< * return ast.CreateTableAsStmt(v_query, v_into, v_objtype, v_is_select_into, v_if_not_exists) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->if_not_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_if_not_exists = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1603 * cdef object v_is_select_into = bool(data.is_select_into) * cdef object v_if_not_exists = bool(data.if_not_exists) * return ast.CreateTableAsStmt(v_query, v_into, v_objtype, v_is_select_into, v_if_not_exists) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CreateTableAsStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_query, __pyx_v_v_into, __pyx_v_v_objtype, __pyx_v_v_is_select_into, __pyx_v_v_if_not_exists}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1597 * * * cdef create_CreateTableAsStmt(structs.CreateTableAsStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * cdef object v_into = create(data.into, offset_to_index) if data.into is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CreateTableAsStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XDECREF(__pyx_v_v_into); __Pyx_XDECREF(__pyx_v_v_objtype); __Pyx_XDECREF(__pyx_v_v_is_select_into); __Pyx_XDECREF(__pyx_v_v_if_not_exists); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1606 * * * cdef create_RefreshMatViewStmt(structs.RefreshMatViewStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_concurrent = bool(data.concurrent) * cdef object v_skipData = bool(data.skipData) */ static PyObject *__pyx_f_6pglast_6parser_create_RefreshMatViewStmt(RefreshMatViewStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_concurrent = 0; PyObject *__pyx_v_v_skipData = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RefreshMatViewStmt", 1); /* "pglast/ast.pyx":1607 * * cdef create_RefreshMatViewStmt(structs.RefreshMatViewStmt* data, offset_to_index): * cdef object v_concurrent = bool(data.concurrent) # <<<<<<<<<<<<<< * cdef object v_skipData = bool(data.skipData) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->concurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_concurrent = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1608 * cdef create_RefreshMatViewStmt(structs.RefreshMatViewStmt* data, offset_to_index): * cdef object v_concurrent = bool(data.concurrent) * cdef object v_skipData = bool(data.skipData) # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * return ast.RefreshMatViewStmt(v_concurrent, v_skipData, v_relation) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->skipData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_skipData = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1609 * cdef object v_concurrent = bool(data.concurrent) * cdef object v_skipData = bool(data.skipData) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * return ast.RefreshMatViewStmt(v_concurrent, v_skipData, v_relation) * */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1610 * cdef object v_skipData = bool(data.skipData) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * return ast.RefreshMatViewStmt(v_concurrent, v_skipData, v_relation) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RefreshMatViewStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_concurrent, __pyx_v_v_skipData, __pyx_v_v_relation}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1606 * * * cdef create_RefreshMatViewStmt(structs.RefreshMatViewStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_concurrent = bool(data.concurrent) * cdef object v_skipData = bool(data.skipData) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RefreshMatViewStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_concurrent); __Pyx_XDECREF(__pyx_v_v_skipData); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1613 * * * cdef create_CheckPointStmt(structs.CheckPointStmt* data, offset_to_index): # <<<<<<<<<<<<<< * return ast.CheckPointStmt() * */ static PyObject *__pyx_f_6pglast_6parser_create_CheckPointStmt(CYTHON_UNUSED CheckPointStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CheckPointStmt", 1); /* "pglast/ast.pyx":1614 * * cdef create_CheckPointStmt(structs.CheckPointStmt* data, offset_to_index): * return ast.CheckPointStmt() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CheckPointStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1613 * * * cdef create_CheckPointStmt(structs.CheckPointStmt* data, offset_to_index): # <<<<<<<<<<<<<< * return ast.CheckPointStmt() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_CheckPointStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1617 * * * cdef create_DiscardStmt(structs.DiscardStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_target = getattr(enums, 'DiscardMode')(data.target) * return ast.DiscardStmt(v_target) */ static PyObject *__pyx_f_6pglast_6parser_create_DiscardStmt(DiscardStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_target = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DiscardStmt", 1); /* "pglast/ast.pyx":1618 * * cdef create_DiscardStmt(structs.DiscardStmt* data, offset_to_index): * cdef object v_target = getattr(enums, 'DiscardMode')(data.target) # <<<<<<<<<<<<<< * return ast.DiscardStmt(v_target) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_DiscardMode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_DiscardMode(__pyx_v_data->target); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_target = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1619 * cdef create_DiscardStmt(structs.DiscardStmt* data, offset_to_index): * cdef object v_target = getattr(enums, 'DiscardMode')(data.target) * return ast.DiscardStmt(v_target) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DiscardStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_target}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1617 * * * cdef create_DiscardStmt(structs.DiscardStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_target = getattr(enums, 'DiscardMode')(data.target) * return ast.DiscardStmt(v_target) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_DiscardStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_target); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1622 * * * cdef create_LockStmt(structs.LockStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_mode = data.mode */ static PyObject *__pyx_f_6pglast_6parser_create_LockStmt(LockStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relations = 0; PyObject *__pyx_v_v_mode = 0; PyObject *__pyx_v_v_nowait = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_LockStmt", 1); /* "pglast/ast.pyx":1623 * * cdef create_LockStmt(structs.LockStmt* data, offset_to_index): * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_mode = data.mode * cdef object v_nowait = bool(data.nowait) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->relations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1623, __pyx_L1_error) __pyx_v_v_relations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1624 * cdef create_LockStmt(structs.LockStmt* data, offset_to_index): * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_mode = data.mode # <<<<<<<<<<<<<< * cdef object v_nowait = bool(data.nowait) * return ast.LockStmt(v_relations, v_mode, v_nowait) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_mode = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1625 * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_mode = data.mode * cdef object v_nowait = bool(data.nowait) # <<<<<<<<<<<<<< * return ast.LockStmt(v_relations, v_mode, v_nowait) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_nowait = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1626 * cdef object v_mode = data.mode * cdef object v_nowait = bool(data.nowait) * return ast.LockStmt(v_relations, v_mode, v_nowait) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LockStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_relations, __pyx_v_v_mode, __pyx_v_v_nowait}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1622 * * * cdef create_LockStmt(structs.LockStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_relations = _pg_list_to_tuple(data.relations, offset_to_index) * cdef object v_mode = data.mode */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_LockStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relations); __Pyx_XDECREF(__pyx_v_v_mode); __Pyx_XDECREF(__pyx_v_v_nowait); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1629 * * * cdef create_ConstraintsSetStmt(structs.ConstraintsSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef object v_deferred = bool(data.deferred) */ static PyObject *__pyx_f_6pglast_6parser_create_ConstraintsSetStmt(ConstraintsSetStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_constraints = 0; PyObject *__pyx_v_v_deferred = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ConstraintsSetStmt", 1); /* "pglast/ast.pyx":1630 * * cdef create_ConstraintsSetStmt(structs.ConstraintsSetStmt* data, offset_to_index): * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_deferred = bool(data.deferred) * return ast.ConstraintsSetStmt(v_constraints, v_deferred) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->constraints, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1630, __pyx_L1_error) __pyx_v_v_constraints = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1631 * cdef create_ConstraintsSetStmt(structs.ConstraintsSetStmt* data, offset_to_index): * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef object v_deferred = bool(data.deferred) # <<<<<<<<<<<<<< * return ast.ConstraintsSetStmt(v_constraints, v_deferred) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->deferred); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_deferred = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1632 * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef object v_deferred = bool(data.deferred) * return ast.ConstraintsSetStmt(v_constraints, v_deferred) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ConstraintsSetStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_constraints, __pyx_v_v_deferred}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1629 * * * cdef create_ConstraintsSetStmt(structs.ConstraintsSetStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_constraints = _pg_list_to_tuple(data.constraints, offset_to_index) * cdef object v_deferred = bool(data.deferred) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ConstraintsSetStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_constraints); __Pyx_XDECREF(__pyx_v_v_deferred); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1635 * * * cdef create_ReindexStmt(structs.ReindexStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'ReindexObjectType')(data.kind) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ReindexStmt(ReindexStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_params = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ReindexStmt", 1); /* "pglast/ast.pyx":1636 * * cdef create_ReindexStmt(structs.ReindexStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'ReindexObjectType')(data.kind) # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ReindexObjectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ReindexObjectType(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1637 * cdef create_ReindexStmt(structs.ReindexStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'ReindexObjectType')(data.kind) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->relation != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1638 * cdef object v_kind = getattr(enums, 'ReindexObjectType')(data.kind) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.ReindexStmt(v_kind, v_relation, v_name, v_params) */ __pyx_t_6 = (__pyx_v_data->name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1638, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1639 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) # <<<<<<<<<<<<<< * return ast.ReindexStmt(v_kind, v_relation, v_name, v_params) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->params, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1639, __pyx_L1_error) __pyx_v_v_params = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1640 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.ReindexStmt(v_kind, v_relation, v_name, v_params) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ReindexStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_kind, __pyx_v_v_relation, __pyx_v_v_name, __pyx_v_v_params}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1635 * * * cdef create_ReindexStmt(structs.ReindexStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'ReindexObjectType')(data.kind) * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ReindexStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_params); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1643 * * * cdef create_CreateConversionStmt(structs.CreateConversionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_conversion_name = _pg_list_to_tuple(data.conversion_name, offset_to_index) * cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateConversionStmt(CreateConversionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_conversion_name = 0; PyObject *__pyx_v_v_for_encoding_name = 0; PyObject *__pyx_v_v_to_encoding_name = 0; PyObject *__pyx_v_v_func_name = 0; PyObject *__pyx_v_v_def_ = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateConversionStmt", 1); /* "pglast/ast.pyx":1644 * * cdef create_CreateConversionStmt(structs.CreateConversionStmt* data, offset_to_index): * cdef tuple v_conversion_name = _pg_list_to_tuple(data.conversion_name, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None * cdef object v_to_encoding_name = data.to_encoding_name.decode("utf-8") if data.to_encoding_name is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->conversion_name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1644, __pyx_L1_error) __pyx_v_v_conversion_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1645 * cdef create_CreateConversionStmt(structs.CreateConversionStmt* data, offset_to_index): * cdef tuple v_conversion_name = _pg_list_to_tuple(data.conversion_name, offset_to_index) * cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_to_encoding_name = data.to_encoding_name.decode("utf-8") if data.to_encoding_name is not NULL else None * cdef tuple v_func_name = _pg_list_to_tuple(data.func_name, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->for_encoding_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->for_encoding_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1645, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_for_encoding_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1646 * cdef tuple v_conversion_name = _pg_list_to_tuple(data.conversion_name, offset_to_index) * cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None * cdef object v_to_encoding_name = data.to_encoding_name.decode("utf-8") if data.to_encoding_name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_func_name = _pg_list_to_tuple(data.func_name, offset_to_index) * cdef object v_def_ = bool(data.def_) */ __pyx_t_2 = (__pyx_v_data->to_encoding_name != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->to_encoding_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1646, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_to_encoding_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1647 * cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None * cdef object v_to_encoding_name = data.to_encoding_name.decode("utf-8") if data.to_encoding_name is not NULL else None * cdef tuple v_func_name = _pg_list_to_tuple(data.func_name, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_def_ = bool(data.def_) * return ast.CreateConversionStmt(v_conversion_name, v_for_encoding_name, v_to_encoding_name, v_func_name, v_def_) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->func_name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1647, __pyx_L1_error) __pyx_v_v_func_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1648 * cdef object v_to_encoding_name = data.to_encoding_name.decode("utf-8") if data.to_encoding_name is not NULL else None * cdef tuple v_func_name = _pg_list_to_tuple(data.func_name, offset_to_index) * cdef object v_def_ = bool(data.def_) # <<<<<<<<<<<<<< * return ast.CreateConversionStmt(v_conversion_name, v_for_encoding_name, v_to_encoding_name, v_func_name, v_def_) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->def); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_def_ = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1649 * cdef tuple v_func_name = _pg_list_to_tuple(data.func_name, offset_to_index) * cdef object v_def_ = bool(data.def_) * return ast.CreateConversionStmt(v_conversion_name, v_for_encoding_name, v_to_encoding_name, v_func_name, v_def_) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateConversionStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_v_v_conversion_name, __pyx_v_v_for_encoding_name, __pyx_v_v_to_encoding_name, __pyx_v_v_func_name, __pyx_v_v_def_}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1643 * * * cdef create_CreateConversionStmt(structs.CreateConversionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_conversion_name = _pg_list_to_tuple(data.conversion_name, offset_to_index) * cdef object v_for_encoding_name = data.for_encoding_name.decode("utf-8") if data.for_encoding_name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CreateConversionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_conversion_name); __Pyx_XDECREF(__pyx_v_v_for_encoding_name); __Pyx_XDECREF(__pyx_v_v_to_encoding_name); __Pyx_XDECREF(__pyx_v_v_func_name); __Pyx_XDECREF(__pyx_v_v_def_); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1652 * * * cdef create_CreateCastStmt(structs.CreateCastStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sourcetype = create(data.sourcetype, offset_to_index) if data.sourcetype is not NULL else None * cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateCastStmt(CreateCastStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_sourcetype = 0; PyObject *__pyx_v_v_targettype = 0; PyObject *__pyx_v_v_func = 0; PyObject *__pyx_v_v_context = 0; PyObject *__pyx_v_v_inout = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateCastStmt", 1); /* "pglast/ast.pyx":1653 * * cdef create_CreateCastStmt(structs.CreateCastStmt* data, offset_to_index): * cdef object v_sourcetype = create(data.sourcetype, offset_to_index) if data.sourcetype is not NULL else None # <<<<<<<<<<<<<< * cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None */ __pyx_t_2 = (__pyx_v_data->sourcetype != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->sourcetype, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_sourcetype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1654 * cdef create_CreateCastStmt(structs.CreateCastStmt* data, offset_to_index): * cdef object v_sourcetype = create(data.sourcetype, offset_to_index) if data.sourcetype is not NULL else None * cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None # <<<<<<<<<<<<<< * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef object v_context = getattr(enums, 'CoercionContext')(data.context) */ __pyx_t_2 = (__pyx_v_data->targettype != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->targettype, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_targettype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1655 * cdef object v_sourcetype = create(data.sourcetype, offset_to_index) if data.sourcetype is not NULL else None * cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None # <<<<<<<<<<<<<< * cdef object v_context = getattr(enums, 'CoercionContext')(data.context) * cdef object v_inout = bool(data.inout) */ __pyx_t_2 = (__pyx_v_data->func != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->func, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1656 * cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef object v_context = getattr(enums, 'CoercionContext')(data.context) # <<<<<<<<<<<<<< * cdef object v_inout = bool(data.inout) * return ast.CreateCastStmt(v_sourcetype, v_targettype, v_func, v_context, v_inout) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionContext(__pyx_v_data->context); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1657 * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef object v_context = getattr(enums, 'CoercionContext')(data.context) * cdef object v_inout = bool(data.inout) # <<<<<<<<<<<<<< * return ast.CreateCastStmt(v_sourcetype, v_targettype, v_func, v_context, v_inout) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->inout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inout = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1658 * cdef object v_context = getattr(enums, 'CoercionContext')(data.context) * cdef object v_inout = bool(data.inout) * return ast.CreateCastStmt(v_sourcetype, v_targettype, v_func, v_context, v_inout) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CreateCastStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_4, __pyx_v_v_sourcetype, __pyx_v_v_targettype, __pyx_v_v_func, __pyx_v_v_context, __pyx_v_v_inout}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1652 * * * cdef create_CreateCastStmt(structs.CreateCastStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sourcetype = create(data.sourcetype, offset_to_index) if data.sourcetype is not NULL else None * cdef object v_targettype = create(data.targettype, offset_to_index) if data.targettype is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CreateCastStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_sourcetype); __Pyx_XDECREF(__pyx_v_v_targettype); __Pyx_XDECREF(__pyx_v_v_func); __Pyx_XDECREF(__pyx_v_v_context); __Pyx_XDECREF(__pyx_v_v_inout); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1661 * * * cdef create_CreateTransformStmt(structs.CreateTransformStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateTransformStmt(CreateTransformStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_v_v_type_name = 0; PyObject *__pyx_v_v_lang = 0; PyObject *__pyx_v_v_fromsql = 0; PyObject *__pyx_v_v_tosql = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateTransformStmt", 1); /* "pglast/ast.pyx":1662 * * cdef create_CreateTransformStmt(structs.CreateTransformStmt* data, offset_to_index): * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None * cdef object v_lang = data.lang.decode("utf-8") if data.lang is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1663 * cdef create_CreateTransformStmt(structs.CreateTransformStmt* data, offset_to_index): * cdef object v_replace = bool(data.replace) * cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_lang = data.lang.decode("utf-8") if data.lang is not NULL else None * cdef object v_fromsql = create(data.fromsql, offset_to_index) if data.fromsql is not NULL else None */ __pyx_t_2 = (__pyx_v_data->type_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->type_name, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_type_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1664 * cdef object v_replace = bool(data.replace) * cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None * cdef object v_lang = data.lang.decode("utf-8") if data.lang is not NULL else None # <<<<<<<<<<<<<< * cdef object v_fromsql = create(data.fromsql, offset_to_index) if data.fromsql is not NULL else None * cdef object v_tosql = create(data.tosql, offset_to_index) if data.tosql is not NULL else None */ __pyx_t_2 = (__pyx_v_data->lang != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->lang; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1664, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_lang = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1665 * cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None * cdef object v_lang = data.lang.decode("utf-8") if data.lang is not NULL else None * cdef object v_fromsql = create(data.fromsql, offset_to_index) if data.fromsql is not NULL else None # <<<<<<<<<<<<<< * cdef object v_tosql = create(data.tosql, offset_to_index) if data.tosql is not NULL else None * return ast.CreateTransformStmt(v_replace, v_type_name, v_lang, v_fromsql, v_tosql) */ __pyx_t_2 = (__pyx_v_data->fromsql != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->fromsql, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_fromsql = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1666 * cdef object v_lang = data.lang.decode("utf-8") if data.lang is not NULL else None * cdef object v_fromsql = create(data.fromsql, offset_to_index) if data.fromsql is not NULL else None * cdef object v_tosql = create(data.tosql, offset_to_index) if data.tosql is not NULL else None # <<<<<<<<<<<<<< * return ast.CreateTransformStmt(v_replace, v_type_name, v_lang, v_fromsql, v_tosql) * */ __pyx_t_2 = (__pyx_v_data->tosql != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->tosql, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tosql = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1667 * cdef object v_fromsql = create(data.fromsql, offset_to_index) if data.fromsql is not NULL else None * cdef object v_tosql = create(data.tosql, offset_to_index) if data.tosql is not NULL else None * return ast.CreateTransformStmt(v_replace, v_type_name, v_lang, v_fromsql, v_tosql) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CreateTransformStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_replace, __pyx_v_v_type_name, __pyx_v_v_lang, __pyx_v_v_fromsql, __pyx_v_v_tosql}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 5+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1661 * * * cdef create_CreateTransformStmt(structs.CreateTransformStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_type_name = create(data.type_name, offset_to_index) if data.type_name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreateTransformStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XDECREF(__pyx_v_v_type_name); __Pyx_XDECREF(__pyx_v_v_lang); __Pyx_XDECREF(__pyx_v_v_fromsql); __Pyx_XDECREF(__pyx_v_v_tosql); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1670 * * * cdef create_PrepareStmt(structs.PrepareStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_PrepareStmt(PrepareStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_argtypes = 0; PyObject *__pyx_v_v_query = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PrepareStmt", 1); /* "pglast/ast.pyx":1671 * * cdef create_PrepareStmt(structs.PrepareStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1671, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1672 * cdef create_PrepareStmt(structs.PrepareStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * return ast.PrepareStmt(v_name, v_argtypes, v_query) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->argtypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1672, __pyx_L1_error) __pyx_v_v_argtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1673 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None # <<<<<<<<<<<<<< * return ast.PrepareStmt(v_name, v_argtypes, v_query) * */ __pyx_t_2 = (__pyx_v_data->query != NULL); if (__pyx_t_2) { __pyx_t_5 = __pyx_f_6pglast_6parser_create(__pyx_v_data->query, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_query = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1674 * cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) * cdef object v_query = create(data.query, offset_to_index) if data.query is not NULL else None * return ast.PrepareStmt(v_name, v_argtypes, v_query) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_PrepareStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_name, __pyx_v_v_argtypes, __pyx_v_v_query}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1670 * * * cdef create_PrepareStmt(structs.PrepareStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_argtypes = _pg_list_to_tuple(data.argtypes, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_PrepareStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_argtypes); __Pyx_XDECREF(__pyx_v_v_query); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1677 * * * cdef create_ExecuteStmt(structs.ExecuteStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_ExecuteStmt(ExecuteStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_params = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ExecuteStmt", 1); /* "pglast/ast.pyx":1678 * * cdef create_ExecuteStmt(structs.ExecuteStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.ExecuteStmt(v_name, v_params) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1678, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1679 * cdef create_ExecuteStmt(structs.ExecuteStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) # <<<<<<<<<<<<<< * return ast.ExecuteStmt(v_name, v_params) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->params, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1679, __pyx_L1_error) __pyx_v_v_params = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1680 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) * return ast.ExecuteStmt(v_name, v_params) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ExecuteStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_name, __pyx_v_v_params}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1677 * * * cdef create_ExecuteStmt(structs.ExecuteStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_params = _pg_list_to_tuple(data.params, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_ExecuteStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_params); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1683 * * * cdef create_DeallocateStmt(structs.DeallocateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isall = bool(data.isall) */ static PyObject *__pyx_f_6pglast_6parser_create_DeallocateStmt(DeallocateStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_isall = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DeallocateStmt", 1); /* "pglast/ast.pyx":1684 * * cdef create_DeallocateStmt(structs.DeallocateStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_isall = bool(data.isall) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1684, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1685 * cdef create_DeallocateStmt(structs.DeallocateStmt* data, offset_to_index): * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isall = bool(data.isall) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.DeallocateStmt(v_name, v_isall, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isall = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1686 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isall = bool(data.isall) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.DeallocateStmt(v_name, v_isall, v_location) * */ __pyx_t_5 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1687 * cdef object v_isall = bool(data.isall) * cdef object v_location = offset_to_index(data.location) * return ast.DeallocateStmt(v_name, v_isall, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DeallocateStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_v_name, __pyx_v_v_isall, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1683 * * * cdef create_DeallocateStmt(structs.DeallocateStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_isall = bool(data.isall) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_DeallocateStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_isall); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1690 * * * cdef create_DropOwnedStmt(structs.DropOwnedStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ static PyObject *__pyx_f_6pglast_6parser_create_DropOwnedStmt(DropOwnedStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_roles = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropOwnedStmt", 1); /* "pglast/ast.pyx":1691 * * cdef create_DropOwnedStmt(structs.DropOwnedStmt* data, offset_to_index): * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.DropOwnedStmt(v_roles, v_behavior) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1691, __pyx_L1_error) __pyx_v_v_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1692 * cdef create_DropOwnedStmt(structs.DropOwnedStmt* data, offset_to_index): * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * return ast.DropOwnedStmt(v_roles, v_behavior) * */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1693 * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.DropOwnedStmt(v_roles, v_behavior) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DropOwnedStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_roles, __pyx_v_v_behavior}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1690 * * * cdef create_DropOwnedStmt(structs.DropOwnedStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_DropOwnedStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_roles); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1696 * * * cdef create_ReassignOwnedStmt(structs.ReassignOwnedStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_newrole = create(data.newrole, offset_to_index) if data.newrole is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ReassignOwnedStmt(ReassignOwnedStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_roles = 0; PyObject *__pyx_v_v_newrole = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ReassignOwnedStmt", 1); /* "pglast/ast.pyx":1697 * * cdef create_ReassignOwnedStmt(structs.ReassignOwnedStmt* data, offset_to_index): * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_newrole = create(data.newrole, offset_to_index) if data.newrole is not NULL else None * return ast.ReassignOwnedStmt(v_roles, v_newrole) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->roles, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1697, __pyx_L1_error) __pyx_v_v_roles = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1698 * cdef create_ReassignOwnedStmt(structs.ReassignOwnedStmt* data, offset_to_index): * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_newrole = create(data.newrole, offset_to_index) if data.newrole is not NULL else None # <<<<<<<<<<<<<< * return ast.ReassignOwnedStmt(v_roles, v_newrole) * */ __pyx_t_2 = (__pyx_v_data->newrole != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->newrole, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_newrole = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1699 * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_newrole = create(data.newrole, offset_to_index) if data.newrole is not NULL else None * return ast.ReassignOwnedStmt(v_roles, v_newrole) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ReassignOwnedStmt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_roles, __pyx_v_v_newrole}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1696 * * * cdef create_ReassignOwnedStmt(structs.ReassignOwnedStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_roles = _pg_list_to_tuple(data.roles, offset_to_index) * cdef object v_newrole = create(data.newrole, offset_to_index) if data.newrole is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_ReassignOwnedStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_roles); __Pyx_XDECREF(__pyx_v_v_newrole); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1702 * * * cdef create_AlterTSDictionaryStmt(structs.AlterTSDictionaryStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_dictname = _pg_list_to_tuple(data.dictname, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTSDictionaryStmt(AlterTSDictionaryStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_dictname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTSDictionaryStmt", 1); /* "pglast/ast.pyx":1703 * * cdef create_AlterTSDictionaryStmt(structs.AlterTSDictionaryStmt* data, offset_to_index): * cdef tuple v_dictname = _pg_list_to_tuple(data.dictname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterTSDictionaryStmt(v_dictname, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->dictname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1703, __pyx_L1_error) __pyx_v_v_dictname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1704 * cdef create_AlterTSDictionaryStmt(structs.AlterTSDictionaryStmt* data, offset_to_index): * cdef tuple v_dictname = _pg_list_to_tuple(data.dictname, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterTSDictionaryStmt(v_dictname, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1704, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1705 * cdef tuple v_dictname = _pg_list_to_tuple(data.dictname, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterTSDictionaryStmt(v_dictname, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AlterTSDictionaryStmt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_v_dictname, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1702 * * * cdef create_AlterTSDictionaryStmt(structs.AlterTSDictionaryStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_dictname = _pg_list_to_tuple(data.dictname, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_AlterTSDictionaryStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_dictname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1708 * * * cdef create_AlterTSConfigurationStmt(structs.AlterTSConfigurationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'AlterTSConfigType')(data.kind) * cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterTSConfigurationStmt(AlterTSConfigurationStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_cfgname = 0; PyObject *__pyx_v_v_tokentype = 0; PyObject *__pyx_v_v_dicts = 0; PyObject *__pyx_v_v_override = 0; PyObject *__pyx_v_v_replace = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterTSConfigurationStmt", 1); /* "pglast/ast.pyx":1709 * * cdef create_AlterTSConfigurationStmt(structs.AlterTSConfigurationStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'AlterTSConfigType')(data.kind) # <<<<<<<<<<<<<< * cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) * cdef tuple v_tokentype = _pg_list_to_tuple(data.tokentype, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_AlterTSConfigType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_AlterTSConfigType(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1710 * cdef create_AlterTSConfigurationStmt(structs.AlterTSConfigurationStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'AlterTSConfigType')(data.kind) * cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_tokentype = _pg_list_to_tuple(data.tokentype, offset_to_index) * cdef tuple v_dicts = _pg_list_to_tuple(data.dicts, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->cfgname, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1710, __pyx_L1_error) __pyx_v_v_cfgname = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1711 * cdef object v_kind = getattr(enums, 'AlterTSConfigType')(data.kind) * cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) * cdef tuple v_tokentype = _pg_list_to_tuple(data.tokentype, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_dicts = _pg_list_to_tuple(data.dicts, offset_to_index) * cdef object v_override = bool(data.override) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->tokentype, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1711, __pyx_L1_error) __pyx_v_v_tokentype = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1712 * cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) * cdef tuple v_tokentype = _pg_list_to_tuple(data.tokentype, offset_to_index) * cdef tuple v_dicts = _pg_list_to_tuple(data.dicts, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_override = bool(data.override) * cdef object v_replace = bool(data.replace) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->dicts, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1712, __pyx_L1_error) __pyx_v_v_dicts = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1713 * cdef tuple v_tokentype = _pg_list_to_tuple(data.tokentype, offset_to_index) * cdef tuple v_dicts = _pg_list_to_tuple(data.dicts, offset_to_index) * cdef object v_override = bool(data.override) # <<<<<<<<<<<<<< * cdef object v_replace = bool(data.replace) * cdef object v_missing_ok = bool(data.missing_ok) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->override); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_override = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1714 * cdef tuple v_dicts = _pg_list_to_tuple(data.dicts, offset_to_index) * cdef object v_override = bool(data.override) * cdef object v_replace = bool(data.replace) # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterTSConfigurationStmt(v_kind, v_cfgname, v_tokentype, v_dicts, v_override, v_replace, v_missing_ok) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_replace = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1715 * cdef object v_override = bool(data.override) * cdef object v_replace = bool(data.replace) * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * return ast.AlterTSConfigurationStmt(v_kind, v_cfgname, v_tokentype, v_dicts, v_override, v_replace, v_missing_ok) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1716 * cdef object v_replace = bool(data.replace) * cdef object v_missing_ok = bool(data.missing_ok) * return ast.AlterTSConfigurationStmt(v_kind, v_cfgname, v_tokentype, v_dicts, v_override, v_replace, v_missing_ok) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterTSConfigurationStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_v_v_kind, __pyx_v_v_cfgname, __pyx_v_v_tokentype, __pyx_v_v_dicts, __pyx_v_v_override, __pyx_v_v_replace, __pyx_v_v_missing_ok}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 7+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1708 * * * cdef create_AlterTSConfigurationStmt(structs.AlterTSConfigurationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'AlterTSConfigType')(data.kind) * cdef tuple v_cfgname = _pg_list_to_tuple(data.cfgname, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterTSConfigurationStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_cfgname); __Pyx_XDECREF(__pyx_v_v_tokentype); __Pyx_XDECREF(__pyx_v_v_dicts); __Pyx_XDECREF(__pyx_v_v_override); __Pyx_XDECREF(__pyx_v_v_replace); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1719 * * * cdef create_PublicationTable(structs.PublicationTable* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_PublicationTable(PublicationTable *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_relation = 0; PyObject *__pyx_v_v_whereClause = 0; PyObject *__pyx_v_v_columns = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PublicationTable", 1); /* "pglast/ast.pyx":1720 * * cdef create_PublicationTable(structs.PublicationTable* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None # <<<<<<<<<<<<<< * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->relation != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->relation, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relation = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1721 * cdef create_PublicationTable(structs.PublicationTable* data, offset_to_index): * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * return ast.PublicationTable(v_relation, v_whereClause, v_columns) */ __pyx_t_2 = (__pyx_v_data->whereClause != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->whereClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_whereClause = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1722 * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) # <<<<<<<<<<<<<< * return ast.PublicationTable(v_relation, v_whereClause, v_columns) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->columns, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1722, __pyx_L1_error) __pyx_v_v_columns = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1723 * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None * cdef tuple v_columns = _pg_list_to_tuple(data.columns, offset_to_index) * return ast.PublicationTable(v_relation, v_whereClause, v_columns) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PublicationTable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_relation, __pyx_v_v_whereClause, __pyx_v_v_columns}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1719 * * * cdef create_PublicationTable(structs.PublicationTable* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_relation = create(data.relation, offset_to_index) if data.relation is not NULL else None * cdef object v_whereClause = create(data.whereClause, offset_to_index) if data.whereClause is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_PublicationTable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_relation); __Pyx_XDECREF(__pyx_v_v_whereClause); __Pyx_XDECREF(__pyx_v_v_columns); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1726 * * * cdef create_PublicationObjSpec(structs.PublicationObjSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_pubobjtype = getattr(enums, 'PublicationObjSpecType')(data.pubobjtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_PublicationObjSpec(PublicationObjSpec *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_pubobjtype = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_pubtable = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_PublicationObjSpec", 1); /* "pglast/ast.pyx":1727 * * cdef create_PublicationObjSpec(structs.PublicationObjSpec* data, offset_to_index): * cdef object v_pubobjtype = getattr(enums, 'PublicationObjSpecType')(data.pubobjtype) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_pubtable = create(data.pubtable, offset_to_index) if data.pubtable is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_PublicationObjSpecType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PublicationObjSpecType(__pyx_v_data->pubobjtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_pubobjtype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1728 * cdef create_PublicationObjSpec(structs.PublicationObjSpec* data, offset_to_index): * cdef object v_pubobjtype = getattr(enums, 'PublicationObjSpecType')(data.pubobjtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_pubtable = create(data.pubtable, offset_to_index) if data.pubtable is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1728, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1729 * cdef object v_pubobjtype = getattr(enums, 'PublicationObjSpecType')(data.pubobjtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_pubtable = create(data.pubtable, offset_to_index) if data.pubtable is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.PublicationObjSpec(v_pubobjtype, v_name, v_pubtable, v_location) */ __pyx_t_6 = (__pyx_v_data->pubtable != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->pubtable, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_pubtable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1730 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_pubtable = create(data.pubtable, offset_to_index) if data.pubtable is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.PublicationObjSpec(v_pubobjtype, v_name, v_pubtable, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1731 * cdef object v_pubtable = create(data.pubtable, offset_to_index) if data.pubtable is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.PublicationObjSpec(v_pubobjtype, v_name, v_pubtable, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_PublicationObjSpec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_v_pubobjtype, __pyx_v_v_name, __pyx_v_v_pubtable, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1726 * * * cdef create_PublicationObjSpec(structs.PublicationObjSpec* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_pubobjtype = getattr(enums, 'PublicationObjSpecType')(data.pubobjtype) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_PublicationObjSpec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_pubobjtype); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_pubtable); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1734 * * * cdef create_CreatePublicationStmt(structs.CreatePublicationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CreatePublicationStmt(CreatePublicationStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_pubname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_pubobjects = 0; PyObject *__pyx_v_v_for_all_tables = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreatePublicationStmt", 1); /* "pglast/ast.pyx":1735 * * cdef create_CreatePublicationStmt(structs.CreatePublicationStmt* data, offset_to_index): * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->pubname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->pubname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1735, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_pubname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1736 * cdef create_CreatePublicationStmt(structs.CreatePublicationStmt* data, offset_to_index): * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) * cdef object v_for_all_tables = bool(data.for_all_tables) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1736, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1737 * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_for_all_tables = bool(data.for_all_tables) * return ast.CreatePublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->pubobjects, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1737, __pyx_L1_error) __pyx_v_v_pubobjects = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1738 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) * cdef object v_for_all_tables = bool(data.for_all_tables) # <<<<<<<<<<<<<< * return ast.CreatePublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->for_all_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_for_all_tables = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1739 * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) * cdef object v_for_all_tables = bool(data.for_all_tables) * return ast.CreatePublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreatePublicationStmt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_pubname, __pyx_v_v_options, __pyx_v_v_pubobjects, __pyx_v_v_for_all_tables}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 4+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1734 * * * cdef create_CreatePublicationStmt(structs.CreatePublicationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CreatePublicationStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_pubname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_pubobjects); __Pyx_XDECREF(__pyx_v_v_for_all_tables); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1742 * * * cdef create_AlterPublicationStmt(structs.AlterPublicationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_AlterPublicationStmt(AlterPublicationStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_pubname = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_pubobjects = 0; PyObject *__pyx_v_v_for_all_tables = 0; PyObject *__pyx_v_v_action = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterPublicationStmt", 1); /* "pglast/ast.pyx":1743 * * cdef create_AlterPublicationStmt(structs.AlterPublicationStmt* data, offset_to_index): * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->pubname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->pubname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1743, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_pubname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1744 * cdef create_AlterPublicationStmt(structs.AlterPublicationStmt* data, offset_to_index): * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) * cdef object v_for_all_tables = bool(data.for_all_tables) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1744, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1745 * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_for_all_tables = bool(data.for_all_tables) * cdef object v_action = getattr(enums, 'AlterPublicationAction')(data.action) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->pubobjects, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1745, __pyx_L1_error) __pyx_v_v_pubobjects = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1746 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) * cdef object v_for_all_tables = bool(data.for_all_tables) # <<<<<<<<<<<<<< * cdef object v_action = getattr(enums, 'AlterPublicationAction')(data.action) * return ast.AlterPublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables, v_action) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->for_all_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_for_all_tables = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1747 * cdef tuple v_pubobjects = _pg_list_to_tuple(data.pubobjects, offset_to_index) * cdef object v_for_all_tables = bool(data.for_all_tables) * cdef object v_action = getattr(enums, 'AlterPublicationAction')(data.action) # <<<<<<<<<<<<<< * return ast.AlterPublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables, v_action) * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_AlterPublicationAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_AlterPublicationAction(__pyx_v_data->action); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1748 * cdef object v_for_all_tables = bool(data.for_all_tables) * cdef object v_action = getattr(enums, 'AlterPublicationAction')(data.action) * return ast.AlterPublicationStmt(v_pubname, v_options, v_pubobjects, v_for_all_tables, v_action) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_AlterPublicationStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_6, __pyx_v_v_pubname, __pyx_v_v_options, __pyx_v_v_pubobjects, __pyx_v_v_for_all_tables, __pyx_v_v_action}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 5+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1742 * * * cdef create_AlterPublicationStmt(structs.AlterPublicationStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_pubname = data.pubname.decode("utf-8") if data.pubname is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_AlterPublicationStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_pubname); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_pubobjects); __Pyx_XDECREF(__pyx_v_v_for_all_tables); __Pyx_XDECREF(__pyx_v_v_action); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1751 * * * cdef create_CreateSubscriptionStmt(structs.CreateSubscriptionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CreateSubscriptionStmt(CreateSubscriptionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subname = 0; PyObject *__pyx_v_v_conninfo = 0; PyObject *__pyx_v_v_publication = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CreateSubscriptionStmt", 1); /* "pglast/ast.pyx":1752 * * cdef create_CreateSubscriptionStmt(structs.CreateSubscriptionStmt* data, offset_to_index): * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->subname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->subname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1752, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_subname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1753 * cdef create_CreateSubscriptionStmt(structs.CreateSubscriptionStmt* data, offset_to_index): * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->conninfo != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->conninfo; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1753, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conninfo = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1754 * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateSubscriptionStmt(v_subname, v_conninfo, v_publication, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->publication, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1754, __pyx_L1_error) __pyx_v_v_publication = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1755 * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.CreateSubscriptionStmt(v_subname, v_conninfo, v_publication, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1755, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1756 * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.CreateSubscriptionStmt(v_subname, v_conninfo, v_publication, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CreateSubscriptionStmt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_v_subname, __pyx_v_v_conninfo, __pyx_v_v_publication, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1751 * * * cdef create_CreateSubscriptionStmt(structs.CreateSubscriptionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_CreateSubscriptionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subname); __Pyx_XDECREF(__pyx_v_v_conninfo); __Pyx_XDECREF(__pyx_v_v_publication); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1759 * * * cdef create_AlterSubscriptionStmt(structs.AlterSubscriptionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'AlterSubscriptionType')(data.kind) * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_AlterSubscriptionStmt(AlterSubscriptionStmt *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_kind = 0; PyObject *__pyx_v_v_subname = 0; PyObject *__pyx_v_v_conninfo = 0; PyObject *__pyx_v_v_publication = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlterSubscriptionStmt", 1); /* "pglast/ast.pyx":1760 * * cdef create_AlterSubscriptionStmt(structs.AlterSubscriptionStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'AlterSubscriptionType')(data.kind) # <<<<<<<<<<<<<< * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_AlterSubscriptionType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_AlterSubscriptionType(__pyx_v_data->kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_kind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1761 * cdef create_AlterSubscriptionStmt(structs.AlterSubscriptionStmt* data, offset_to_index): * cdef object v_kind = getattr(enums, 'AlterSubscriptionType')(data.kind) * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->subname != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->subname; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1761, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_subname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1762 * cdef object v_kind = getattr(enums, 'AlterSubscriptionType')(data.kind) * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->conninfo != NULL); if (__pyx_t_6) { __pyx_t_9 = __pyx_v_data->conninfo; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1762, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_conninfo = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1763 * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterSubscriptionStmt(v_kind, v_subname, v_conninfo, v_publication, v_options) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->publication, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1763, __pyx_L1_error) __pyx_v_v_publication = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1764 * cdef object v_conninfo = data.conninfo.decode("utf-8") if data.conninfo is not NULL else None * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlterSubscriptionStmt(v_kind, v_subname, v_conninfo, v_publication, v_options) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1764, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1765 * cdef tuple v_publication = _pg_list_to_tuple(data.publication, offset_to_index) * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * return ast.AlterSubscriptionStmt(v_kind, v_subname, v_conninfo, v_publication, v_options) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_AlterSubscriptionStmt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_kind, __pyx_v_v_subname, __pyx_v_v_conninfo, __pyx_v_v_publication, __pyx_v_v_options}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1759 * * * cdef create_AlterSubscriptionStmt(structs.AlterSubscriptionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_kind = getattr(enums, 'AlterSubscriptionType')(data.kind) * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_AlterSubscriptionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_kind); __Pyx_XDECREF(__pyx_v_v_subname); __Pyx_XDECREF(__pyx_v_v_conninfo); __Pyx_XDECREF(__pyx_v_v_publication); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1768 * * * cdef create_DropSubscriptionStmt(structs.DropSubscriptionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ static PyObject *__pyx_f_6pglast_6parser_create_DropSubscriptionStmt(DropSubscriptionStmt *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subname = 0; PyObject *__pyx_v_v_missing_ok = 0; PyObject *__pyx_v_v_behavior = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_DropSubscriptionStmt", 1); /* "pglast/ast.pyx":1769 * * cdef create_DropSubscriptionStmt(structs.DropSubscriptionStmt* data, offset_to_index): * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) */ __pyx_t_2 = (__pyx_v_data->subname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->subname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1769, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_subname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1770 * cdef create_DropSubscriptionStmt(structs.DropSubscriptionStmt* data, offset_to_index): * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) # <<<<<<<<<<<<<< * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.DropSubscriptionStmt(v_subname, v_missing_ok, v_behavior) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->missing_ok); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_missing_ok = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1771 * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) # <<<<<<<<<<<<<< * return ast.DropSubscriptionStmt(v_subname, v_missing_ok, v_behavior) * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_enums); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_5, __pyx_n_u_DropBehavior); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_DropBehavior(__pyx_v_data->behavior); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_behavior = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1772 * cdef object v_missing_ok = bool(data.missing_ok) * cdef object v_behavior = getattr(enums, 'DropBehavior')(data.behavior) * return ast.DropSubscriptionStmt(v_subname, v_missing_ok, v_behavior) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DropSubscriptionStmt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_v_subname, __pyx_v_v_missing_ok, __pyx_v_v_behavior}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1768 * * * cdef create_DropSubscriptionStmt(structs.DropSubscriptionStmt* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subname = data.subname.decode("utf-8") if data.subname is not NULL else None * cdef object v_missing_ok = bool(data.missing_ok) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_DropSubscriptionStmt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subname); __Pyx_XDECREF(__pyx_v_v_missing_ok); __Pyx_XDECREF(__pyx_v_v_behavior); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1775 * * * cdef create_Alias(structs.Alias* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_aliasname = data.aliasname.decode("utf-8") if data.aliasname is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_Alias(Alias *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_aliasname = 0; PyObject *__pyx_v_v_colnames = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Alias", 1); /* "pglast/ast.pyx":1776 * * cdef create_Alias(structs.Alias* data, offset_to_index): * cdef object v_aliasname = data.aliasname.decode("utf-8") if data.aliasname is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * return ast.Alias(v_aliasname, v_colnames) */ __pyx_t_2 = (__pyx_v_data->aliasname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->aliasname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1776, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_aliasname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1777 * cdef create_Alias(structs.Alias* data, offset_to_index): * cdef object v_aliasname = data.aliasname.decode("utf-8") if data.aliasname is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) # <<<<<<<<<<<<<< * return ast.Alias(v_aliasname, v_colnames) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1777, __pyx_L1_error) __pyx_v_v_colnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1778 * cdef object v_aliasname = data.aliasname.decode("utf-8") if data.aliasname is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * return ast.Alias(v_aliasname, v_colnames) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Alias); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_v_aliasname, __pyx_v_v_colnames}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1775 * * * cdef create_Alias(structs.Alias* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_aliasname = data.aliasname.decode("utf-8") if data.aliasname is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_Alias", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_aliasname); __Pyx_XDECREF(__pyx_v_v_colnames); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1781 * * * cdef create_RangeVar(structs.RangeVar* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_catalogname = data.catalogname.decode("utf-8") if data.catalogname is not NULL else None * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_RangeVar(RangeVar *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_catalogname = 0; PyObject *__pyx_v_v_schemaname = 0; PyObject *__pyx_v_v_relname = 0; PyObject *__pyx_v_v_inh = 0; PyObject *__pyx_v_v_relpersistence = 0; PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; char const *__pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeVar", 1); /* "pglast/ast.pyx":1782 * * cdef create_RangeVar(structs.RangeVar* data, offset_to_index): * cdef object v_catalogname = data.catalogname.decode("utf-8") if data.catalogname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None */ __pyx_t_2 = (__pyx_v_data->catalogname != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->catalogname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1782, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_catalogname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1783 * cdef create_RangeVar(structs.RangeVar* data, offset_to_index): * cdef object v_catalogname = data.catalogname.decode("utf-8") if data.catalogname is not NULL else None * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None * cdef object v_inh = bool(data.inh) */ __pyx_t_2 = (__pyx_v_data->schemaname != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_v_data->schemaname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1783, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_6, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_schemaname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1784 * cdef object v_catalogname = data.catalogname.decode("utf-8") if data.catalogname is not NULL else None * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_inh = bool(data.inh) * cdef object v_relpersistence = chr(data.relpersistence) */ __pyx_t_2 = (__pyx_v_data->relname != NULL); if (__pyx_t_2) { __pyx_t_7 = __pyx_v_data->relname; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1784, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_relname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1785 * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None * cdef object v_inh = bool(data.inh) # <<<<<<<<<<<<<< * cdef object v_relpersistence = chr(data.relpersistence) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->inh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1785, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_inh = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1786 * cdef object v_relname = data.relname.decode("utf-8") if data.relname is not NULL else None * cdef object v_inh = bool(data.inh) * cdef object v_relpersistence = chr(data.relpersistence) # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->relpersistence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_relpersistence = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":1787 * cdef object v_inh = bool(data.inh) * cdef object v_relpersistence = chr(data.relpersistence) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RangeVar(v_catalogname, v_schemaname, v_relname, v_inh, v_relpersistence, v_alias, v_location) */ __pyx_t_2 = (__pyx_v_data->alias != NULL); if (__pyx_t_2) { __pyx_t_1 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_5 = Py_None; } __pyx_v_v_alias = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":1788 * cdef object v_relpersistence = chr(data.relpersistence) * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RangeVar(v_catalogname, v_schemaname, v_relname, v_inh, v_relpersistence, v_alias, v_location) * */ __pyx_t_1 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_8 = __pyx_v_offset_to_index; __pyx_t_9 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_v_location = __pyx_t_5; __pyx_t_5 = 0; /* "pglast/ast.pyx":1789 * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.RangeVar(v_catalogname, v_schemaname, v_relname, v_inh, v_relpersistence, v_alias, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ast); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_RangeVar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_10 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_8, __pyx_v_v_catalogname, __pyx_v_v_schemaname, __pyx_v_v_relname, __pyx_v_v_inh, __pyx_v_v_relpersistence, __pyx_v_v_alias, __pyx_v_v_location}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 7+__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1781 * * * cdef create_RangeVar(structs.RangeVar* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_catalogname = data.catalogname.decode("utf-8") if data.catalogname is not NULL else None * cdef object v_schemaname = data.schemaname.decode("utf-8") if data.schemaname is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("pglast.parser.create_RangeVar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_catalogname); __Pyx_XDECREF(__pyx_v_v_schemaname); __Pyx_XDECREF(__pyx_v_v_relname); __Pyx_XDECREF(__pyx_v_v_inh); __Pyx_XDECREF(__pyx_v_v_relpersistence); __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1792 * * * cdef create_TableFunc(structs.TableFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_functype = getattr(enums, 'TableFuncType')(data.functype) * cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_TableFunc(TableFunc *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_functype = 0; PyObject *__pyx_v_v_ns_uris = 0; PyObject *__pyx_v_v_ns_names = 0; PyObject *__pyx_v_v_docexpr = 0; PyObject *__pyx_v_v_rowexpr = 0; PyObject *__pyx_v_v_colnames = 0; PyObject *__pyx_v_v_coltypes = 0; PyObject *__pyx_v_v_coltypmods = 0; PyObject *__pyx_v_v_colcollations = 0; PyObject *__pyx_v_v_colexprs = 0; PyObject *__pyx_v_v_coldefexprs = 0; PyObject *__pyx_v_v_colvalexprs = 0; PyObject *__pyx_v_v_passingvalexprs = 0; PyObject *__pyx_v_v_notnulls = 0; PyObject *__pyx_v_v_plan = 0; PyObject *__pyx_v_v_ordinalitycol = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TableFunc", 1); /* "pglast/ast.pyx":1793 * * cdef create_TableFunc(structs.TableFunc* data, offset_to_index): * cdef object v_functype = getattr(enums, 'TableFuncType')(data.functype) # <<<<<<<<<<<<<< * cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) * cdef tuple v_ns_names = _pg_list_to_tuple(data.ns_names, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_TableFuncType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_TableFuncType(__pyx_v_data->functype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_functype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1794 * cdef create_TableFunc(structs.TableFunc* data, offset_to_index): * cdef object v_functype = getattr(enums, 'TableFuncType')(data.functype) * cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_ns_names = _pg_list_to_tuple(data.ns_names, offset_to_index) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ns_uris, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1794, __pyx_L1_error) __pyx_v_v_ns_uris = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1795 * cdef object v_functype = getattr(enums, 'TableFuncType')(data.functype) * cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) * cdef tuple v_ns_names = _pg_list_to_tuple(data.ns_names, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->ns_names, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1795, __pyx_L1_error) __pyx_v_v_ns_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1796 * cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) * cdef tuple v_ns_names = _pg_list_to_tuple(data.ns_names, offset_to_index) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->docexpr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->docexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_docexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1797 * cdef tuple v_ns_names = _pg_list_to_tuple(data.ns_names, offset_to_index) * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->rowexpr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rowexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rowexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1798 * cdef object v_docexpr = create(data.docexpr, offset_to_index) if data.docexpr is not NULL else None * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1798, __pyx_L1_error) __pyx_v_v_colnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1799 * cdef object v_rowexpr = create(data.rowexpr, offset_to_index) if data.rowexpr is not NULL else None * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coltypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1799, __pyx_L1_error) __pyx_v_v_coltypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1800 * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) * cdef tuple v_colexprs = _pg_list_to_tuple(data.colexprs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coltypmods, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1800, __pyx_L1_error) __pyx_v_v_coltypmods = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1801 * cdef tuple v_coltypes = _pg_list_to_tuple(data.coltypes, offset_to_index) * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_colexprs = _pg_list_to_tuple(data.colexprs, offset_to_index) * cdef tuple v_coldefexprs = _pg_list_to_tuple(data.coldefexprs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colcollations, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1801, __pyx_L1_error) __pyx_v_v_colcollations = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1802 * cdef tuple v_coltypmods = _pg_list_to_tuple(data.coltypmods, offset_to_index) * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) * cdef tuple v_colexprs = _pg_list_to_tuple(data.colexprs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_coldefexprs = _pg_list_to_tuple(data.coldefexprs, offset_to_index) * cdef tuple v_colvalexprs = _pg_list_to_tuple(data.colvalexprs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colexprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1802, __pyx_L1_error) __pyx_v_v_colexprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1803 * cdef tuple v_colcollations = _pg_list_to_tuple(data.colcollations, offset_to_index) * cdef tuple v_colexprs = _pg_list_to_tuple(data.colexprs, offset_to_index) * cdef tuple v_coldefexprs = _pg_list_to_tuple(data.coldefexprs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_colvalexprs = _pg_list_to_tuple(data.colvalexprs, offset_to_index) * cdef tuple v_passingvalexprs = _pg_list_to_tuple(data.passingvalexprs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->coldefexprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1803, __pyx_L1_error) __pyx_v_v_coldefexprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1804 * cdef tuple v_colexprs = _pg_list_to_tuple(data.colexprs, offset_to_index) * cdef tuple v_coldefexprs = _pg_list_to_tuple(data.coldefexprs, offset_to_index) * cdef tuple v_colvalexprs = _pg_list_to_tuple(data.colvalexprs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_passingvalexprs = _pg_list_to_tuple(data.passingvalexprs, offset_to_index) * cdef set v_notnulls = _pg_bitmapset_to_set(data.notnulls) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colvalexprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1804, __pyx_L1_error) __pyx_v_v_colvalexprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1805 * cdef tuple v_coldefexprs = _pg_list_to_tuple(data.coldefexprs, offset_to_index) * cdef tuple v_colvalexprs = _pg_list_to_tuple(data.colvalexprs, offset_to_index) * cdef tuple v_passingvalexprs = _pg_list_to_tuple(data.passingvalexprs, offset_to_index) # <<<<<<<<<<<<<< * cdef set v_notnulls = _pg_bitmapset_to_set(data.notnulls) * cdef object v_plan = create(data.plan, offset_to_index) if data.plan is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->passingvalexprs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1805, __pyx_L1_error) __pyx_v_v_passingvalexprs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1806 * cdef tuple v_colvalexprs = _pg_list_to_tuple(data.colvalexprs, offset_to_index) * cdef tuple v_passingvalexprs = _pg_list_to_tuple(data.passingvalexprs, offset_to_index) * cdef set v_notnulls = _pg_bitmapset_to_set(data.notnulls) # <<<<<<<<<<<<<< * cdef object v_plan = create(data.plan, offset_to_index) if data.plan is not NULL else None * cdef object v_ordinalitycol = data.ordinalitycol */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_bitmapset_to_set(__pyx_v_data->notnulls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 1806, __pyx_L1_error) __pyx_v_v_notnulls = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1807 * cdef tuple v_passingvalexprs = _pg_list_to_tuple(data.passingvalexprs, offset_to_index) * cdef set v_notnulls = _pg_bitmapset_to_set(data.notnulls) * cdef object v_plan = create(data.plan, offset_to_index) if data.plan is not NULL else None # <<<<<<<<<<<<<< * cdef object v_ordinalitycol = data.ordinalitycol * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->plan != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->plan, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_plan = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1808 * cdef set v_notnulls = _pg_bitmapset_to_set(data.notnulls) * cdef object v_plan = create(data.plan, offset_to_index) if data.plan is not NULL else None * cdef object v_ordinalitycol = data.ordinalitycol # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.TableFunc(v_functype, v_ns_uris, v_ns_names, v_docexpr, v_rowexpr, v_colnames, v_coltypes, v_coltypmods, v_colcollations, v_colexprs, v_coldefexprs, v_colvalexprs, v_passingvalexprs, v_notnulls, v_plan, v_ordinalitycol, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->ordinalitycol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_ordinalitycol = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1809 * cdef object v_plan = create(data.plan, offset_to_index) if data.plan is not NULL else None * cdef object v_ordinalitycol = data.ordinalitycol * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.TableFunc(v_functype, v_ns_uris, v_ns_names, v_docexpr, v_rowexpr, v_colnames, v_coltypes, v_coltypmods, v_colcollations, v_colexprs, v_coldefexprs, v_colvalexprs, v_passingvalexprs, v_notnulls, v_plan, v_ordinalitycol, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1810 * cdef object v_ordinalitycol = data.ordinalitycol * cdef object v_location = offset_to_index(data.location) * return ast.TableFunc(v_functype, v_ns_uris, v_ns_names, v_docexpr, v_rowexpr, v_colnames, v_coltypes, v_coltypmods, v_colcollations, v_colexprs, v_coldefexprs, v_colvalexprs, v_passingvalexprs, v_notnulls, v_plan, v_ordinalitycol, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_TableFunc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[18] = {__pyx_t_2, __pyx_v_v_functype, __pyx_v_v_ns_uris, __pyx_v_v_ns_names, __pyx_v_v_docexpr, __pyx_v_v_rowexpr, __pyx_v_v_colnames, __pyx_v_v_coltypes, __pyx_v_v_coltypmods, __pyx_v_v_colcollations, __pyx_v_v_colexprs, __pyx_v_v_coldefexprs, __pyx_v_v_colvalexprs, __pyx_v_v_passingvalexprs, __pyx_v_v_notnulls, __pyx_v_v_plan, __pyx_v_v_ordinalitycol, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 17+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1792 * * * cdef create_TableFunc(structs.TableFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_functype = getattr(enums, 'TableFuncType')(data.functype) * cdef tuple v_ns_uris = _pg_list_to_tuple(data.ns_uris, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_TableFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_functype); __Pyx_XDECREF(__pyx_v_v_ns_uris); __Pyx_XDECREF(__pyx_v_v_ns_names); __Pyx_XDECREF(__pyx_v_v_docexpr); __Pyx_XDECREF(__pyx_v_v_rowexpr); __Pyx_XDECREF(__pyx_v_v_colnames); __Pyx_XDECREF(__pyx_v_v_coltypes); __Pyx_XDECREF(__pyx_v_v_coltypmods); __Pyx_XDECREF(__pyx_v_v_colcollations); __Pyx_XDECREF(__pyx_v_v_colexprs); __Pyx_XDECREF(__pyx_v_v_coldefexprs); __Pyx_XDECREF(__pyx_v_v_colvalexprs); __Pyx_XDECREF(__pyx_v_v_passingvalexprs); __Pyx_XDECREF(__pyx_v_v_notnulls); __Pyx_XDECREF(__pyx_v_v_plan); __Pyx_XDECREF(__pyx_v_v_ordinalitycol); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1813 * * * cdef create_IntoClause(structs.IntoClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rel = create(data.rel, offset_to_index) if data.rel is not NULL else None * cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_IntoClause(IntoClause *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_rel = 0; PyObject *__pyx_v_v_colNames = 0; PyObject *__pyx_v_v_accessMethod = 0; PyObject *__pyx_v_v_options = 0; PyObject *__pyx_v_v_onCommit = 0; PyObject *__pyx_v_v_tableSpaceName = 0; PyObject *__pyx_v_v_viewQuery = 0; PyObject *__pyx_v_v_skipData = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; char const *__pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_IntoClause", 1); /* "pglast/ast.pyx":1814 * * cdef create_IntoClause(structs.IntoClause* data, offset_to_index): * cdef object v_rel = create(data.rel, offset_to_index) if data.rel is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None */ __pyx_t_2 = (__pyx_v_data->rel != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rel, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rel = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1815 * cdef create_IntoClause(structs.IntoClause* data, offset_to_index): * cdef object v_rel = create(data.rel, offset_to_index) if data.rel is not NULL else None * cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colNames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1815, __pyx_L1_error) __pyx_v_v_colNames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1816 * cdef object v_rel = create(data.rel, offset_to_index) if data.rel is not NULL else None * cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_onCommit = getattr(enums, 'OnCommitAction')(data.onCommit) */ __pyx_t_2 = (__pyx_v_data->accessMethod != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->accessMethod; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1816, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_accessMethod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1817 * cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_onCommit = getattr(enums, 'OnCommitAction')(data.onCommit) * cdef object v_tableSpaceName = data.tableSpaceName.decode("utf-8") if data.tableSpaceName is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->options, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1817, __pyx_L1_error) __pyx_v_v_options = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1818 * cdef object v_accessMethod = data.accessMethod.decode("utf-8") if data.accessMethod is not NULL else None * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_onCommit = getattr(enums, 'OnCommitAction')(data.onCommit) # <<<<<<<<<<<<<< * cdef object v_tableSpaceName = data.tableSpaceName.decode("utf-8") if data.tableSpaceName is not NULL else None * cdef object v_viewQuery = create(data.viewQuery, offset_to_index) if data.viewQuery is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_OnCommitAction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_OnCommitAction(__pyx_v_data->onCommit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_onCommit = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1819 * cdef tuple v_options = _pg_list_to_tuple(data.options, offset_to_index) * cdef object v_onCommit = getattr(enums, 'OnCommitAction')(data.onCommit) * cdef object v_tableSpaceName = data.tableSpaceName.decode("utf-8") if data.tableSpaceName is not NULL else None # <<<<<<<<<<<<<< * cdef object v_viewQuery = create(data.viewQuery, offset_to_index) if data.viewQuery is not NULL else None * cdef object v_skipData = bool(data.skipData) */ __pyx_t_2 = (__pyx_v_data->tableSpaceName != NULL); if (__pyx_t_2) { __pyx_t_9 = __pyx_v_data->tableSpaceName; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_9); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1819, __pyx_L1_error) __pyx_t_6 = __Pyx_decode_c_string(__pyx_t_9, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_tableSpaceName = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1820 * cdef object v_onCommit = getattr(enums, 'OnCommitAction')(data.onCommit) * cdef object v_tableSpaceName = data.tableSpaceName.decode("utf-8") if data.tableSpaceName is not NULL else None * cdef object v_viewQuery = create(data.viewQuery, offset_to_index) if data.viewQuery is not NULL else None # <<<<<<<<<<<<<< * cdef object v_skipData = bool(data.skipData) * return ast.IntoClause(v_rel, v_colNames, v_accessMethod, v_options, v_onCommit, v_tableSpaceName, v_viewQuery, v_skipData) */ __pyx_t_2 = (__pyx_v_data->viewQuery != NULL); if (__pyx_t_2) { __pyx_t_6 = __pyx_f_6pglast_6parser_create(__pyx_v_data->viewQuery, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_viewQuery = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1821 * cdef object v_tableSpaceName = data.tableSpaceName.decode("utf-8") if data.tableSpaceName is not NULL else None * cdef object v_viewQuery = create(data.viewQuery, offset_to_index) if data.viewQuery is not NULL else None * cdef object v_skipData = bool(data.skipData) # <<<<<<<<<<<<<< * return ast.IntoClause(v_rel, v_colNames, v_accessMethod, v_options, v_onCommit, v_tableSpaceName, v_viewQuery, v_skipData) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->skipData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_skipData = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1822 * cdef object v_viewQuery = create(data.viewQuery, offset_to_index) if data.viewQuery is not NULL else None * cdef object v_skipData = bool(data.skipData) * return ast.IntoClause(v_rel, v_colNames, v_accessMethod, v_options, v_onCommit, v_tableSpaceName, v_viewQuery, v_skipData) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_IntoClause); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_6, __pyx_v_v_rel, __pyx_v_v_colNames, __pyx_v_v_accessMethod, __pyx_v_v_options, __pyx_v_v_onCommit, __pyx_v_v_tableSpaceName, __pyx_v_v_viewQuery, __pyx_v_v_skipData}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 8+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1813 * * * cdef create_IntoClause(structs.IntoClause* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rel = create(data.rel, offset_to_index) if data.rel is not NULL else None * cdef tuple v_colNames = _pg_list_to_tuple(data.colNames, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_IntoClause", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_rel); __Pyx_XDECREF(__pyx_v_v_colNames); __Pyx_XDECREF(__pyx_v_v_accessMethod); __Pyx_XDECREF(__pyx_v_v_options); __Pyx_XDECREF(__pyx_v_v_onCommit); __Pyx_XDECREF(__pyx_v_v_tableSpaceName); __Pyx_XDECREF(__pyx_v_v_viewQuery); __Pyx_XDECREF(__pyx_v_v_skipData); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1825 * * * cdef create_Var(structs.Var* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_varno = data.varno * cdef object v_varattno = data.varattno */ static PyObject *__pyx_f_6pglast_6parser_create_Var(Var *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_varno = 0; PyObject *__pyx_v_v_varattno = 0; PyObject *__pyx_v_v_vartypmod = 0; PyObject *__pyx_v_v_varnullingrels = 0; PyObject *__pyx_v_v_varlevelsup = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Var", 1); /* "pglast/ast.pyx":1826 * * cdef create_Var(structs.Var* data, offset_to_index): * cdef object v_varno = data.varno # <<<<<<<<<<<<<< * cdef object v_varattno = data.varattno * cdef object v_vartypmod = data.vartypmod */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->varno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_varno = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1827 * cdef create_Var(structs.Var* data, offset_to_index): * cdef object v_varno = data.varno * cdef object v_varattno = data.varattno # <<<<<<<<<<<<<< * cdef object v_vartypmod = data.vartypmod * cdef set v_varnullingrels = _pg_bitmapset_to_set(data.varnullingrels) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->varattno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_varattno = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1828 * cdef object v_varno = data.varno * cdef object v_varattno = data.varattno * cdef object v_vartypmod = data.vartypmod # <<<<<<<<<<<<<< * cdef set v_varnullingrels = _pg_bitmapset_to_set(data.varnullingrels) * cdef object v_varlevelsup = data.varlevelsup */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->vartypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_vartypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1829 * cdef object v_varattno = data.varattno * cdef object v_vartypmod = data.vartypmod * cdef set v_varnullingrels = _pg_bitmapset_to_set(data.varnullingrels) # <<<<<<<<<<<<<< * cdef object v_varlevelsup = data.varlevelsup * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_bitmapset_to_set(__pyx_v_data->varnullingrels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("set", __pyx_t_1))) __PYX_ERR(0, 1829, __pyx_L1_error) __pyx_v_v_varnullingrels = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1830 * cdef object v_vartypmod = data.vartypmod * cdef set v_varnullingrels = _pg_bitmapset_to_set(data.varnullingrels) * cdef object v_varlevelsup = data.varlevelsup # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.Var(v_varno, v_varattno, v_vartypmod, v_varnullingrels, v_varlevelsup, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->varlevelsup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_varlevelsup = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1831 * cdef set v_varnullingrels = _pg_bitmapset_to_set(data.varnullingrels) * cdef object v_varlevelsup = data.varlevelsup * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.Var(v_varno, v_varattno, v_vartypmod, v_varnullingrels, v_varlevelsup, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1832 * cdef object v_varlevelsup = data.varlevelsup * cdef object v_location = offset_to_index(data.location) * return ast.Var(v_varno, v_varattno, v_vartypmod, v_varnullingrels, v_varlevelsup, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_varno, __pyx_v_v_varattno, __pyx_v_v_vartypmod, __pyx_v_v_varnullingrels, __pyx_v_v_varlevelsup, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1825 * * * cdef create_Var(structs.Var* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_varno = data.varno * cdef object v_varattno = data.varattno */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_Var", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_varno); __Pyx_XDECREF(__pyx_v_v_varattno); __Pyx_XDECREF(__pyx_v_v_vartypmod); __Pyx_XDECREF(__pyx_v_v_varnullingrels); __Pyx_XDECREF(__pyx_v_v_varlevelsup); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1835 * * * cdef create_Param(structs.Param* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_paramkind = getattr(enums, 'ParamKind')(data.paramkind) * cdef object v_paramid = data.paramid */ static PyObject *__pyx_f_6pglast_6parser_create_Param(Param *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_paramkind = 0; PyObject *__pyx_v_v_paramid = 0; PyObject *__pyx_v_v_paramtypmod = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Param", 1); /* "pglast/ast.pyx":1836 * * cdef create_Param(structs.Param* data, offset_to_index): * cdef object v_paramkind = getattr(enums, 'ParamKind')(data.paramkind) # <<<<<<<<<<<<<< * cdef object v_paramid = data.paramid * cdef object v_paramtypmod = data.paramtypmod */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_ParamKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_ParamKind(__pyx_v_data->paramkind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_paramkind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1837 * cdef create_Param(structs.Param* data, offset_to_index): * cdef object v_paramkind = getattr(enums, 'ParamKind')(data.paramkind) * cdef object v_paramid = data.paramid # <<<<<<<<<<<<<< * cdef object v_paramtypmod = data.paramtypmod * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->paramid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_paramid = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1838 * cdef object v_paramkind = getattr(enums, 'ParamKind')(data.paramkind) * cdef object v_paramid = data.paramid * cdef object v_paramtypmod = data.paramtypmod # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.Param(v_paramkind, v_paramid, v_paramtypmod, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->paramtypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_paramtypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1839 * cdef object v_paramid = data.paramid * cdef object v_paramtypmod = data.paramtypmod * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.Param(v_paramkind, v_paramid, v_paramtypmod, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1840 * cdef object v_paramtypmod = data.paramtypmod * cdef object v_location = offset_to_index(data.location) * return ast.Param(v_paramkind, v_paramid, v_paramtypmod, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Param); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_v_paramkind, __pyx_v_v_paramid, __pyx_v_v_paramtypmod, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1835 * * * cdef create_Param(structs.Param* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_paramkind = getattr(enums, 'ParamKind')(data.paramkind) * cdef object v_paramid = data.paramid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_Param", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_paramkind); __Pyx_XDECREF(__pyx_v_v_paramid); __Pyx_XDECREF(__pyx_v_v_paramtypmod); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1843 * * * cdef create_Aggref(structs.Aggref* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_aggargtypes = _pg_list_to_tuple(data.aggargtypes, offset_to_index) * cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_Aggref(Aggref *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_aggargtypes = 0; PyObject *__pyx_v_v_aggdirectargs = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_aggorder = 0; PyObject *__pyx_v_v_aggdistinct = 0; PyObject *__pyx_v_v_aggfilter = 0; PyObject *__pyx_v_v_aggstar = 0; PyObject *__pyx_v_v_aggvariadic = 0; PyObject *__pyx_v_v_aggkind = 0; PyObject *__pyx_v_v_agglevelsup = 0; PyObject *__pyx_v_v_aggsplit = 0; PyObject *__pyx_v_v_aggno = 0; PyObject *__pyx_v_v_aggtransno = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Aggref", 1); /* "pglast/ast.pyx":1844 * * cdef create_Aggref(structs.Aggref* data, offset_to_index): * cdef tuple v_aggargtypes = _pg_list_to_tuple(data.aggargtypes, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->aggargtypes, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1844, __pyx_L1_error) __pyx_v_v_aggargtypes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1845 * cdef create_Aggref(structs.Aggref* data, offset_to_index): * cdef tuple v_aggargtypes = _pg_list_to_tuple(data.aggargtypes, offset_to_index) * cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_aggorder = _pg_list_to_tuple(data.aggorder, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->aggdirectargs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1845, __pyx_L1_error) __pyx_v_v_aggdirectargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1846 * cdef tuple v_aggargtypes = _pg_list_to_tuple(data.aggargtypes, offset_to_index) * cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_aggorder = _pg_list_to_tuple(data.aggorder, offset_to_index) * cdef tuple v_aggdistinct = _pg_list_to_tuple(data.aggdistinct, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1846, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1847 * cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_aggorder = _pg_list_to_tuple(data.aggorder, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_aggdistinct = _pg_list_to_tuple(data.aggdistinct, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->aggorder, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1847, __pyx_L1_error) __pyx_v_v_aggorder = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1848 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_aggorder = _pg_list_to_tuple(data.aggorder, offset_to_index) * cdef tuple v_aggdistinct = _pg_list_to_tuple(data.aggdistinct, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None * cdef object v_aggstar = bool(data.aggstar) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->aggdistinct, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1848, __pyx_L1_error) __pyx_v_v_aggdistinct = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1849 * cdef tuple v_aggorder = _pg_list_to_tuple(data.aggorder, offset_to_index) * cdef tuple v_aggdistinct = _pg_list_to_tuple(data.aggdistinct, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None # <<<<<<<<<<<<<< * cdef object v_aggstar = bool(data.aggstar) * cdef object v_aggvariadic = bool(data.aggvariadic) */ __pyx_t_2 = (__pyx_v_data->aggfilter != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->aggfilter, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_aggfilter = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1850 * cdef tuple v_aggdistinct = _pg_list_to_tuple(data.aggdistinct, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None * cdef object v_aggstar = bool(data.aggstar) # <<<<<<<<<<<<<< * cdef object v_aggvariadic = bool(data.aggvariadic) * cdef object v_aggkind = chr(data.aggkind) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->aggstar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_aggstar = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1851 * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None * cdef object v_aggstar = bool(data.aggstar) * cdef object v_aggvariadic = bool(data.aggvariadic) # <<<<<<<<<<<<<< * cdef object v_aggkind = chr(data.aggkind) * cdef object v_agglevelsup = data.agglevelsup */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->aggvariadic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_aggvariadic = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1852 * cdef object v_aggstar = bool(data.aggstar) * cdef object v_aggvariadic = bool(data.aggvariadic) * cdef object v_aggkind = chr(data.aggkind) # <<<<<<<<<<<<<< * cdef object v_agglevelsup = data.agglevelsup * cdef object v_aggsplit = getattr(enums, 'AggSplit')(data.aggsplit) */ __pyx_t_1 = __Pyx_PyInt_From_char(__pyx_v_data->aggkind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_v_aggkind = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":1853 * cdef object v_aggvariadic = bool(data.aggvariadic) * cdef object v_aggkind = chr(data.aggkind) * cdef object v_agglevelsup = data.agglevelsup # <<<<<<<<<<<<<< * cdef object v_aggsplit = getattr(enums, 'AggSplit')(data.aggsplit) * cdef object v_aggno = data.aggno */ __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->agglevelsup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_v_agglevelsup = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":1854 * cdef object v_aggkind = chr(data.aggkind) * cdef object v_agglevelsup = data.agglevelsup * cdef object v_aggsplit = getattr(enums, 'AggSplit')(data.aggsplit) # <<<<<<<<<<<<<< * cdef object v_aggno = data.aggno * cdef object v_aggtransno = data.aggtransno */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_enums); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_1, __pyx_n_u_AggSplit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_AggSplit(__pyx_v_data->aggsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_aggsplit = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":1855 * cdef object v_agglevelsup = data.agglevelsup * cdef object v_aggsplit = getattr(enums, 'AggSplit')(data.aggsplit) * cdef object v_aggno = data.aggno # <<<<<<<<<<<<<< * cdef object v_aggtransno = data.aggtransno * cdef object v_location = offset_to_index(data.location) */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_data->aggno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_v_aggno = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":1856 * cdef object v_aggsplit = getattr(enums, 'AggSplit')(data.aggsplit) * cdef object v_aggno = data.aggno * cdef object v_aggtransno = data.aggtransno # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.Aggref(v_aggargtypes, v_aggdirectargs, v_args, v_aggorder, v_aggdistinct, v_aggfilter, v_aggstar, v_aggvariadic, v_aggkind, v_agglevelsup, v_aggsplit, v_aggno, v_aggtransno, v_location) */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_data->aggtransno); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_v_aggtransno = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":1857 * cdef object v_aggno = data.aggno * cdef object v_aggtransno = data.aggtransno * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.Aggref(v_aggargtypes, v_aggdirectargs, v_args, v_aggorder, v_aggdistinct, v_aggfilter, v_aggstar, v_aggvariadic, v_aggkind, v_agglevelsup, v_aggsplit, v_aggno, v_aggtransno, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_1 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_v_location = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/ast.pyx":1858 * cdef object v_aggtransno = data.aggtransno * cdef object v_location = offset_to_index(data.location) * return ast.Aggref(v_aggargtypes, v_aggdirectargs, v_args, v_aggorder, v_aggdistinct, v_aggfilter, v_aggstar, v_aggvariadic, v_aggkind, v_agglevelsup, v_aggsplit, v_aggno, v_aggtransno, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Aggref); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[15] = {__pyx_t_1, __pyx_v_v_aggargtypes, __pyx_v_v_aggdirectargs, __pyx_v_v_args, __pyx_v_v_aggorder, __pyx_v_v_aggdistinct, __pyx_v_v_aggfilter, __pyx_v_v_aggstar, __pyx_v_v_aggvariadic, __pyx_v_v_aggkind, __pyx_v_v_agglevelsup, __pyx_v_v_aggsplit, __pyx_v_v_aggno, __pyx_v_v_aggtransno, __pyx_v_v_location}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 14+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1843 * * * cdef create_Aggref(structs.Aggref* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_aggargtypes = _pg_list_to_tuple(data.aggargtypes, offset_to_index) * cdef tuple v_aggdirectargs = _pg_list_to_tuple(data.aggdirectargs, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_Aggref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_aggargtypes); __Pyx_XDECREF(__pyx_v_v_aggdirectargs); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_aggorder); __Pyx_XDECREF(__pyx_v_v_aggdistinct); __Pyx_XDECREF(__pyx_v_v_aggfilter); __Pyx_XDECREF(__pyx_v_v_aggstar); __Pyx_XDECREF(__pyx_v_v_aggvariadic); __Pyx_XDECREF(__pyx_v_v_aggkind); __Pyx_XDECREF(__pyx_v_v_agglevelsup); __Pyx_XDECREF(__pyx_v_v_aggsplit); __Pyx_XDECREF(__pyx_v_v_aggno); __Pyx_XDECREF(__pyx_v_v_aggtransno); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1861 * * * cdef create_GroupingFunc(structs.GroupingFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_GroupingFunc(GroupingFunc *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_refs = 0; PyObject *__pyx_v_v_agglevelsup = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_GroupingFunc", 1); /* "pglast/ast.pyx":1862 * * cdef create_GroupingFunc(structs.GroupingFunc* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) * cdef object v_agglevelsup = data.agglevelsup */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1862, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1863 * cdef create_GroupingFunc(structs.GroupingFunc* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_agglevelsup = data.agglevelsup * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->refs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1863, __pyx_L1_error) __pyx_v_v_refs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1864 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) * cdef object v_agglevelsup = data.agglevelsup # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.GroupingFunc(v_args, v_refs, v_agglevelsup, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->agglevelsup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_agglevelsup = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1865 * cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) * cdef object v_agglevelsup = data.agglevelsup * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.GroupingFunc(v_args, v_refs, v_agglevelsup, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1866 * cdef object v_agglevelsup = data.agglevelsup * cdef object v_location = offset_to_index(data.location) * return ast.GroupingFunc(v_args, v_refs, v_agglevelsup, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_GroupingFunc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_args, __pyx_v_v_refs, __pyx_v_v_agglevelsup, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1861 * * * cdef create_GroupingFunc(structs.GroupingFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef tuple v_refs = _pg_list_to_tuple(data.refs, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_GroupingFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_refs); __Pyx_XDECREF(__pyx_v_v_agglevelsup); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1869 * * * cdef create_WindowFunc(structs.WindowFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_WindowFunc(WindowFunc *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_aggfilter = 0; PyObject *__pyx_v_v_runCondition = 0; PyObject *__pyx_v_v_winref = 0; PyObject *__pyx_v_v_winstar = 0; PyObject *__pyx_v_v_winagg = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_WindowFunc", 1); /* "pglast/ast.pyx":1870 * * cdef create_WindowFunc(structs.WindowFunc* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None * cdef tuple v_runCondition = _pg_list_to_tuple(data.runCondition, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1870, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1871 * cdef create_WindowFunc(structs.WindowFunc* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_runCondition = _pg_list_to_tuple(data.runCondition, offset_to_index) * cdef object v_winref = data.winref */ __pyx_t_2 = (__pyx_v_data->aggfilter != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->aggfilter, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_aggfilter = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1872 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None * cdef tuple v_runCondition = _pg_list_to_tuple(data.runCondition, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_winref = data.winref * cdef object v_winstar = bool(data.winstar) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->runCondition, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1872, __pyx_L1_error) __pyx_v_v_runCondition = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1873 * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None * cdef tuple v_runCondition = _pg_list_to_tuple(data.runCondition, offset_to_index) * cdef object v_winref = data.winref # <<<<<<<<<<<<<< * cdef object v_winstar = bool(data.winstar) * cdef object v_winagg = bool(data.winagg) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->winref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_winref = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1874 * cdef tuple v_runCondition = _pg_list_to_tuple(data.runCondition, offset_to_index) * cdef object v_winref = data.winref * cdef object v_winstar = bool(data.winstar) # <<<<<<<<<<<<<< * cdef object v_winagg = bool(data.winagg) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->winstar); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_winstar = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1875 * cdef object v_winref = data.winref * cdef object v_winstar = bool(data.winstar) * cdef object v_winagg = bool(data.winagg) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.WindowFunc(v_args, v_aggfilter, v_runCondition, v_winref, v_winstar, v_winagg, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->winagg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_winagg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1876 * cdef object v_winstar = bool(data.winstar) * cdef object v_winagg = bool(data.winagg) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.WindowFunc(v_args, v_aggfilter, v_runCondition, v_winref, v_winstar, v_winagg, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1877 * cdef object v_winagg = bool(data.winagg) * cdef object v_location = offset_to_index(data.location) * return ast.WindowFunc(v_args, v_aggfilter, v_runCondition, v_winref, v_winstar, v_winagg, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_WindowFunc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_v_v_args, __pyx_v_v_aggfilter, __pyx_v_v_runCondition, __pyx_v_v_winref, __pyx_v_v_winstar, __pyx_v_v_winagg, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 7+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1869 * * * cdef create_WindowFunc(structs.WindowFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_aggfilter = create(data.aggfilter, offset_to_index) if data.aggfilter is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_WindowFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_aggfilter); __Pyx_XDECREF(__pyx_v_v_runCondition); __Pyx_XDECREF(__pyx_v_v_winref); __Pyx_XDECREF(__pyx_v_v_winstar); __Pyx_XDECREF(__pyx_v_v_winagg); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1880 * * * cdef create_WindowFuncRunCondition(structs.WindowFuncRunCondition* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_wfunc_left = bool(data.wfunc_left) * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_WindowFuncRunCondition(WindowFuncRunCondition *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_wfunc_left = 0; PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_WindowFuncRunCondition", 1); /* "pglast/ast.pyx":1881 * * cdef create_WindowFuncRunCondition(structs.WindowFuncRunCondition* data, offset_to_index): * cdef object v_wfunc_left = bool(data.wfunc_left) # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * return ast.WindowFuncRunCondition(v_wfunc_left, v_arg) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->wfunc_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_wfunc_left = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1882 * cdef create_WindowFuncRunCondition(structs.WindowFuncRunCondition* data, offset_to_index): * cdef object v_wfunc_left = bool(data.wfunc_left) * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * return ast.WindowFuncRunCondition(v_wfunc_left, v_arg) * */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1883 * cdef object v_wfunc_left = bool(data.wfunc_left) * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * return ast.WindowFuncRunCondition(v_wfunc_left, v_arg) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_WindowFuncRunCondition); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_wfunc_left, __pyx_v_v_arg}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1880 * * * cdef create_WindowFuncRunCondition(structs.WindowFuncRunCondition* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_wfunc_left = bool(data.wfunc_left) * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_WindowFuncRunCondition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_wfunc_left); __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1886 * * * cdef create_MergeSupportFunc(structs.MergeSupportFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.MergeSupportFunc(v_location) */ static PyObject *__pyx_f_6pglast_6parser_create_MergeSupportFunc(MergeSupportFunc *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_MergeSupportFunc", 1); /* "pglast/ast.pyx":1887 * * cdef create_MergeSupportFunc(structs.MergeSupportFunc* data, offset_to_index): * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.MergeSupportFunc(v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1888 * cdef create_MergeSupportFunc(structs.MergeSupportFunc* data, offset_to_index): * cdef object v_location = offset_to_index(data.location) * return ast.MergeSupportFunc(v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MergeSupportFunc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1886 * * * cdef create_MergeSupportFunc(structs.MergeSupportFunc* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.MergeSupportFunc(v_location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_MergeSupportFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1891 * * * cdef create_SubscriptingRef(structs.SubscriptingRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_reftypmod = data.reftypmod * cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_SubscriptingRef(SubscriptingRef *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_reftypmod = 0; PyObject *__pyx_v_v_refupperindexpr = 0; PyObject *__pyx_v_v_reflowerindexpr = 0; PyObject *__pyx_v_v_refexpr = 0; PyObject *__pyx_v_v_refassgnexpr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SubscriptingRef", 1); /* "pglast/ast.pyx":1892 * * cdef create_SubscriptingRef(structs.SubscriptingRef* data, offset_to_index): * cdef object v_reftypmod = data.reftypmod # <<<<<<<<<<<<<< * cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) * cdef tuple v_reflowerindexpr = _pg_list_to_tuple(data.reflowerindexpr, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->reftypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_reftypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1893 * cdef create_SubscriptingRef(structs.SubscriptingRef* data, offset_to_index): * cdef object v_reftypmod = data.reftypmod * cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_reflowerindexpr = _pg_list_to_tuple(data.reflowerindexpr, offset_to_index) * cdef object v_refexpr = create(data.refexpr, offset_to_index) if data.refexpr is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->refupperindexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1893, __pyx_L1_error) __pyx_v_v_refupperindexpr = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1894 * cdef object v_reftypmod = data.reftypmod * cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) * cdef tuple v_reflowerindexpr = _pg_list_to_tuple(data.reflowerindexpr, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_refexpr = create(data.refexpr, offset_to_index) if data.refexpr is not NULL else None * cdef object v_refassgnexpr = create(data.refassgnexpr, offset_to_index) if data.refassgnexpr is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->reflowerindexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1894, __pyx_L1_error) __pyx_v_v_reflowerindexpr = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1895 * cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) * cdef tuple v_reflowerindexpr = _pg_list_to_tuple(data.reflowerindexpr, offset_to_index) * cdef object v_refexpr = create(data.refexpr, offset_to_index) if data.refexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_refassgnexpr = create(data.refassgnexpr, offset_to_index) if data.refassgnexpr is not NULL else None * return ast.SubscriptingRef(v_reftypmod, v_refupperindexpr, v_reflowerindexpr, v_refexpr, v_refassgnexpr) */ __pyx_t_2 = (__pyx_v_data->refexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->refexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_refexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1896 * cdef tuple v_reflowerindexpr = _pg_list_to_tuple(data.reflowerindexpr, offset_to_index) * cdef object v_refexpr = create(data.refexpr, offset_to_index) if data.refexpr is not NULL else None * cdef object v_refassgnexpr = create(data.refassgnexpr, offset_to_index) if data.refassgnexpr is not NULL else None # <<<<<<<<<<<<<< * return ast.SubscriptingRef(v_reftypmod, v_refupperindexpr, v_reflowerindexpr, v_refexpr, v_refassgnexpr) * */ __pyx_t_2 = (__pyx_v_data->refassgnexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->refassgnexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_refassgnexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1897 * cdef object v_refexpr = create(data.refexpr, offset_to_index) if data.refexpr is not NULL else None * cdef object v_refassgnexpr = create(data.refassgnexpr, offset_to_index) if data.refassgnexpr is not NULL else None * return ast.SubscriptingRef(v_reftypmod, v_refupperindexpr, v_reflowerindexpr, v_refexpr, v_refassgnexpr) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SubscriptingRef); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_reftypmod, __pyx_v_v_refupperindexpr, __pyx_v_v_reflowerindexpr, __pyx_v_v_refexpr, __pyx_v_v_refassgnexpr}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 5+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1891 * * * cdef create_SubscriptingRef(structs.SubscriptingRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_reftypmod = data.reftypmod * cdef tuple v_refupperindexpr = _pg_list_to_tuple(data.refupperindexpr, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SubscriptingRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_reftypmod); __Pyx_XDECREF(__pyx_v_v_refupperindexpr); __Pyx_XDECREF(__pyx_v_v_reflowerindexpr); __Pyx_XDECREF(__pyx_v_v_refexpr); __Pyx_XDECREF(__pyx_v_v_refassgnexpr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1900 * * * cdef create_FuncExpr(structs.FuncExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_funcretset = bool(data.funcretset) * cdef object v_funcvariadic = bool(data.funcvariadic) */ static PyObject *__pyx_f_6pglast_6parser_create_FuncExpr(FuncExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_funcretset = 0; PyObject *__pyx_v_v_funcvariadic = 0; PyObject *__pyx_v_v_funcformat = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FuncExpr", 1); /* "pglast/ast.pyx":1901 * * cdef create_FuncExpr(structs.FuncExpr* data, offset_to_index): * cdef object v_funcretset = bool(data.funcretset) # <<<<<<<<<<<<<< * cdef object v_funcvariadic = bool(data.funcvariadic) * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->funcretset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_funcretset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1902 * cdef create_FuncExpr(structs.FuncExpr* data, offset_to_index): * cdef object v_funcretset = bool(data.funcretset) * cdef object v_funcvariadic = bool(data.funcvariadic) # <<<<<<<<<<<<<< * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->funcvariadic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_funcvariadic = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1903 * cdef object v_funcretset = bool(data.funcretset) * cdef object v_funcvariadic = bool(data.funcvariadic) * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->funcformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_funcformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1904 * cdef object v_funcvariadic = bool(data.funcvariadic) * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.FuncExpr(v_funcretset, v_funcvariadic, v_funcformat, v_args, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1904, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1905 * cdef object v_funcformat = getattr(enums, 'CoercionForm')(data.funcformat) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.FuncExpr(v_funcretset, v_funcvariadic, v_funcformat, v_args, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1906 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.FuncExpr(v_funcretset, v_funcvariadic, v_funcformat, v_args, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FuncExpr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_funcretset, __pyx_v_v_funcvariadic, __pyx_v_v_funcformat, __pyx_v_v_args, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1900 * * * cdef create_FuncExpr(structs.FuncExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_funcretset = bool(data.funcretset) * cdef object v_funcvariadic = bool(data.funcvariadic) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_FuncExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_funcretset); __Pyx_XDECREF(__pyx_v_v_funcvariadic); __Pyx_XDECREF(__pyx_v_v_funcformat); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1909 * * * cdef create_NamedArgExpr(structs.NamedArgExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_NamedArgExpr(NamedArgExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_argnumber = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_NamedArgExpr", 1); /* "pglast/ast.pyx":1910 * * cdef create_NamedArgExpr(structs.NamedArgExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argnumber = data.argnumber */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1911 * cdef create_NamedArgExpr(structs.NamedArgExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_argnumber = data.argnumber * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->name != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1911, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1912 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argnumber = data.argnumber # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.NamedArgExpr(v_arg, v_name, v_argnumber, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->argnumber); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_argnumber = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1913 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef object v_argnumber = data.argnumber * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.NamedArgExpr(v_arg, v_name, v_argnumber, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_6 = __pyx_v_offset_to_index; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1914 * cdef object v_argnumber = data.argnumber * cdef object v_location = offset_to_index(data.location) * return ast.NamedArgExpr(v_arg, v_name, v_argnumber, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ast); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_NamedArgExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_6, __pyx_v_v_arg, __pyx_v_v_name, __pyx_v_v_argnumber, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1909 * * * cdef create_NamedArgExpr(structs.NamedArgExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pglast.parser.create_NamedArgExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_argnumber); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1917 * * * cdef create_OpExpr(structs.OpExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_opretset = bool(data.opretset) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_OpExpr(OpExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_opretset = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_OpExpr", 1); /* "pglast/ast.pyx":1918 * * cdef create_OpExpr(structs.OpExpr* data, offset_to_index): * cdef object v_opretset = bool(data.opretset) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->opretset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_opretset = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1919 * cdef create_OpExpr(structs.OpExpr* data, offset_to_index): * cdef object v_opretset = bool(data.opretset) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.OpExpr(v_opretset, v_args, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1919, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1920 * cdef object v_opretset = bool(data.opretset) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.OpExpr(v_opretset, v_args, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1921 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.OpExpr(v_opretset, v_args, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_OpExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_opretset, __pyx_v_v_args, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1917 * * * cdef create_OpExpr(structs.OpExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_opretset = bool(data.opretset) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_OpExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_opretset); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1924 * * * cdef create_ScalarArrayOpExpr(structs.ScalarArrayOpExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_useOr = bool(data.useOr) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_ScalarArrayOpExpr(ScalarArrayOpExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_useOr = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ScalarArrayOpExpr", 1); /* "pglast/ast.pyx":1925 * * cdef create_ScalarArrayOpExpr(structs.ScalarArrayOpExpr* data, offset_to_index): * cdef object v_useOr = bool(data.useOr) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->useOr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1925, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_useOr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1926 * cdef create_ScalarArrayOpExpr(structs.ScalarArrayOpExpr* data, offset_to_index): * cdef object v_useOr = bool(data.useOr) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ScalarArrayOpExpr(v_useOr, v_args, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1926, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1927 * cdef object v_useOr = bool(data.useOr) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ScalarArrayOpExpr(v_useOr, v_args, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1928 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.ScalarArrayOpExpr(v_useOr, v_args, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ScalarArrayOpExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_useOr, __pyx_v_v_args, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1924 * * * cdef create_ScalarArrayOpExpr(structs.ScalarArrayOpExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_useOr = bool(data.useOr) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_ScalarArrayOpExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_useOr); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1931 * * * cdef create_BoolExpr(structs.BoolExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_boolop = getattr(enums, 'BoolExprType')(data.boolop) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_BoolExpr(BoolExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_boolop = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_BoolExpr", 1); /* "pglast/ast.pyx":1932 * * cdef create_BoolExpr(structs.BoolExpr* data, offset_to_index): * cdef object v_boolop = getattr(enums, 'BoolExprType')(data.boolop) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_BoolExprType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_BoolExprType(__pyx_v_data->boolop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_boolop = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1933 * cdef create_BoolExpr(structs.BoolExpr* data, offset_to_index): * cdef object v_boolop = getattr(enums, 'BoolExprType')(data.boolop) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.BoolExpr(v_boolop, v_args, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1933, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1934 * cdef object v_boolop = getattr(enums, 'BoolExprType')(data.boolop) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.BoolExpr(v_boolop, v_args, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1935 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.BoolExpr(v_boolop, v_args, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BoolExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_boolop, __pyx_v_v_args, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1931 * * * cdef create_BoolExpr(structs.BoolExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_boolop = getattr(enums, 'BoolExprType')(data.boolop) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_BoolExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_boolop); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1938 * * * cdef create_SubLink(structs.SubLink* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_subLinkId = data.subLinkId */ static PyObject *__pyx_f_6pglast_6parser_create_SubLink(SubLink *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subLinkType = 0; PyObject *__pyx_v_v_subLinkId = 0; PyObject *__pyx_v_v_testexpr = 0; PyObject *__pyx_v_v_operName = 0; PyObject *__pyx_v_v_subselect = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SubLink", 1); /* "pglast/ast.pyx":1939 * * cdef create_SubLink(structs.SubLink* data, offset_to_index): * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) # <<<<<<<<<<<<<< * cdef object v_subLinkId = data.subLinkId * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_SubLinkType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_SubLinkType(__pyx_v_data->subLinkType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_subLinkType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1940 * cdef create_SubLink(structs.SubLink* data, offset_to_index): * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_subLinkId = data.subLinkId # <<<<<<<<<<<<<< * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None * cdef tuple v_operName = _pg_list_to_tuple(data.operName, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->subLinkId); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_subLinkId = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1941 * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_subLinkId = data.subLinkId * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_operName = _pg_list_to_tuple(data.operName, offset_to_index) * cdef object v_subselect = create(data.subselect, offset_to_index) if data.subselect is not NULL else None */ __pyx_t_6 = (__pyx_v_data->testexpr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->testexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_testexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1942 * cdef object v_subLinkId = data.subLinkId * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None * cdef tuple v_operName = _pg_list_to_tuple(data.operName, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_subselect = create(data.subselect, offset_to_index) if data.subselect is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->operName, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1942, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1942, __pyx_L1_error) __pyx_v_v_operName = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1943 * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None * cdef tuple v_operName = _pg_list_to_tuple(data.operName, offset_to_index) * cdef object v_subselect = create(data.subselect, offset_to_index) if data.subselect is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.SubLink(v_subLinkType, v_subLinkId, v_testexpr, v_operName, v_subselect, v_location) */ __pyx_t_6 = (__pyx_v_data->subselect != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->subselect, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_subselect = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1944 * cdef tuple v_operName = _pg_list_to_tuple(data.operName, offset_to_index) * cdef object v_subselect = create(data.subselect, offset_to_index) if data.subselect is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.SubLink(v_subLinkType, v_subLinkId, v_testexpr, v_operName, v_subselect, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1945 * cdef object v_subselect = create(data.subselect, offset_to_index) if data.subselect is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.SubLink(v_subLinkType, v_subLinkId, v_testexpr, v_operName, v_subselect, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SubLink); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_2, __pyx_v_v_subLinkType, __pyx_v_v_subLinkId, __pyx_v_v_testexpr, __pyx_v_v_operName, __pyx_v_v_subselect, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1938 * * * cdef create_SubLink(structs.SubLink* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_subLinkId = data.subLinkId */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SubLink", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subLinkType); __Pyx_XDECREF(__pyx_v_v_subLinkId); __Pyx_XDECREF(__pyx_v_v_testexpr); __Pyx_XDECREF(__pyx_v_v_operName); __Pyx_XDECREF(__pyx_v_v_subselect); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1948 * * * cdef create_SubPlan(structs.SubPlan* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_SubPlan(SubPlan *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subLinkType = 0; PyObject *__pyx_v_v_testexpr = 0; PyObject *__pyx_v_v_paramIds = 0; PyObject *__pyx_v_v_plan_id = 0; PyObject *__pyx_v_v_plan_name = 0; PyObject *__pyx_v_v_firstColTypmod = 0; PyObject *__pyx_v_v_useHashTable = 0; PyObject *__pyx_v_v_unknownEqFalse = 0; PyObject *__pyx_v_v_parallel_safe = 0; PyObject *__pyx_v_v_setParam = 0; PyObject *__pyx_v_v_parParam = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_startup_cost = 0; PyObject *__pyx_v_v_per_call_cost = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SubPlan", 1); /* "pglast/ast.pyx":1949 * * cdef create_SubPlan(structs.SubPlan* data, offset_to_index): * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) # <<<<<<<<<<<<<< * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None * cdef tuple v_paramIds = _pg_list_to_tuple(data.paramIds, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_SubLinkType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_SubLinkType(__pyx_v_data->subLinkType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_subLinkType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1950 * cdef create_SubPlan(structs.SubPlan* data, offset_to_index): * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_paramIds = _pg_list_to_tuple(data.paramIds, offset_to_index) * cdef object v_plan_id = data.plan_id */ __pyx_t_6 = (__pyx_v_data->testexpr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->testexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_testexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1951 * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None * cdef tuple v_paramIds = _pg_list_to_tuple(data.paramIds, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_plan_id = data.plan_id * cdef object v_plan_name = data.plan_name.decode("utf-8") if data.plan_name is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->paramIds, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1951, __pyx_L1_error) __pyx_v_v_paramIds = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1952 * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None * cdef tuple v_paramIds = _pg_list_to_tuple(data.paramIds, offset_to_index) * cdef object v_plan_id = data.plan_id # <<<<<<<<<<<<<< * cdef object v_plan_name = data.plan_name.decode("utf-8") if data.plan_name is not NULL else None * cdef object v_firstColTypmod = data.firstColTypmod */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->plan_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_plan_id = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1953 * cdef tuple v_paramIds = _pg_list_to_tuple(data.paramIds, offset_to_index) * cdef object v_plan_id = data.plan_id * cdef object v_plan_name = data.plan_name.decode("utf-8") if data.plan_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_firstColTypmod = data.firstColTypmod * cdef object v_useHashTable = bool(data.useHashTable) */ __pyx_t_6 = (__pyx_v_data->plan_name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->plan_name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1953, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_plan_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1954 * cdef object v_plan_id = data.plan_id * cdef object v_plan_name = data.plan_name.decode("utf-8") if data.plan_name is not NULL else None * cdef object v_firstColTypmod = data.firstColTypmod # <<<<<<<<<<<<<< * cdef object v_useHashTable = bool(data.useHashTable) * cdef object v_unknownEqFalse = bool(data.unknownEqFalse) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->firstColTypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_firstColTypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1955 * cdef object v_plan_name = data.plan_name.decode("utf-8") if data.plan_name is not NULL else None * cdef object v_firstColTypmod = data.firstColTypmod * cdef object v_useHashTable = bool(data.useHashTable) # <<<<<<<<<<<<<< * cdef object v_unknownEqFalse = bool(data.unknownEqFalse) * cdef object v_parallel_safe = bool(data.parallel_safe) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->useHashTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_useHashTable = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1956 * cdef object v_firstColTypmod = data.firstColTypmod * cdef object v_useHashTable = bool(data.useHashTable) * cdef object v_unknownEqFalse = bool(data.unknownEqFalse) # <<<<<<<<<<<<<< * cdef object v_parallel_safe = bool(data.parallel_safe) * cdef tuple v_setParam = _pg_list_to_tuple(data.setParam, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unknownEqFalse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unknownEqFalse = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1957 * cdef object v_useHashTable = bool(data.useHashTable) * cdef object v_unknownEqFalse = bool(data.unknownEqFalse) * cdef object v_parallel_safe = bool(data.parallel_safe) # <<<<<<<<<<<<<< * cdef tuple v_setParam = _pg_list_to_tuple(data.setParam, offset_to_index) * cdef tuple v_parParam = _pg_list_to_tuple(data.parParam, offset_to_index) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->parallel_safe); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_parallel_safe = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1958 * cdef object v_unknownEqFalse = bool(data.unknownEqFalse) * cdef object v_parallel_safe = bool(data.parallel_safe) * cdef tuple v_setParam = _pg_list_to_tuple(data.setParam, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_parParam = _pg_list_to_tuple(data.parParam, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->setParam, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1958, __pyx_L1_error) __pyx_v_v_setParam = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1959 * cdef object v_parallel_safe = bool(data.parallel_safe) * cdef tuple v_setParam = _pg_list_to_tuple(data.setParam, offset_to_index) * cdef tuple v_parParam = _pg_list_to_tuple(data.parParam, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_startup_cost = data.startup_cost */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->parParam, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1959, __pyx_L1_error) __pyx_v_v_parParam = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1960 * cdef tuple v_setParam = _pg_list_to_tuple(data.setParam, offset_to_index) * cdef tuple v_parParam = _pg_list_to_tuple(data.parParam, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_startup_cost = data.startup_cost * cdef object v_per_call_cost = data.per_call_cost */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1960, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1961 * cdef tuple v_parParam = _pg_list_to_tuple(data.parParam, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_startup_cost = data.startup_cost # <<<<<<<<<<<<<< * cdef object v_per_call_cost = data.per_call_cost * return ast.SubPlan(v_subLinkType, v_testexpr, v_paramIds, v_plan_id, v_plan_name, v_firstColTypmod, v_useHashTable, v_unknownEqFalse, v_parallel_safe, v_setParam, v_parParam, v_args, v_startup_cost, v_per_call_cost) */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_data->startup_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_startup_cost = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1962 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_startup_cost = data.startup_cost * cdef object v_per_call_cost = data.per_call_cost # <<<<<<<<<<<<<< * return ast.SubPlan(v_subLinkType, v_testexpr, v_paramIds, v_plan_id, v_plan_name, v_firstColTypmod, v_useHashTable, v_unknownEqFalse, v_parallel_safe, v_setParam, v_parParam, v_args, v_startup_cost, v_per_call_cost) * */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_data->per_call_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_per_call_cost = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1963 * cdef object v_startup_cost = data.startup_cost * cdef object v_per_call_cost = data.per_call_cost * return ast.SubPlan(v_subLinkType, v_testexpr, v_paramIds, v_plan_id, v_plan_name, v_firstColTypmod, v_useHashTable, v_unknownEqFalse, v_parallel_safe, v_setParam, v_parParam, v_args, v_startup_cost, v_per_call_cost) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SubPlan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[15] = {__pyx_t_3, __pyx_v_v_subLinkType, __pyx_v_v_testexpr, __pyx_v_v_paramIds, __pyx_v_v_plan_id, __pyx_v_v_plan_name, __pyx_v_v_firstColTypmod, __pyx_v_v_useHashTable, __pyx_v_v_unknownEqFalse, __pyx_v_v_parallel_safe, __pyx_v_v_setParam, __pyx_v_v_parParam, __pyx_v_v_args, __pyx_v_v_startup_cost, __pyx_v_v_per_call_cost}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 14+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1948 * * * cdef create_SubPlan(structs.SubPlan* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_subLinkType = getattr(enums, 'SubLinkType')(data.subLinkType) * cdef object v_testexpr = create(data.testexpr, offset_to_index) if data.testexpr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SubPlan", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subLinkType); __Pyx_XDECREF(__pyx_v_v_testexpr); __Pyx_XDECREF(__pyx_v_v_paramIds); __Pyx_XDECREF(__pyx_v_v_plan_id); __Pyx_XDECREF(__pyx_v_v_plan_name); __Pyx_XDECREF(__pyx_v_v_firstColTypmod); __Pyx_XDECREF(__pyx_v_v_useHashTable); __Pyx_XDECREF(__pyx_v_v_unknownEqFalse); __Pyx_XDECREF(__pyx_v_v_parallel_safe); __Pyx_XDECREF(__pyx_v_v_setParam); __Pyx_XDECREF(__pyx_v_v_parParam); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_startup_cost); __Pyx_XDECREF(__pyx_v_v_per_call_cost); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1966 * * * cdef create_AlternativeSubPlan(structs.AlternativeSubPlan* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_subplans = _pg_list_to_tuple(data.subplans, offset_to_index) * return ast.AlternativeSubPlan(v_subplans) */ static PyObject *__pyx_f_6pglast_6parser_create_AlternativeSubPlan(AlternativeSubPlan *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_subplans = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_AlternativeSubPlan", 1); /* "pglast/ast.pyx":1967 * * cdef create_AlternativeSubPlan(structs.AlternativeSubPlan* data, offset_to_index): * cdef tuple v_subplans = _pg_list_to_tuple(data.subplans, offset_to_index) # <<<<<<<<<<<<<< * return ast.AlternativeSubPlan(v_subplans) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->subplans, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1967, __pyx_L1_error) __pyx_v_v_subplans = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1968 * cdef create_AlternativeSubPlan(structs.AlternativeSubPlan* data, offset_to_index): * cdef tuple v_subplans = _pg_list_to_tuple(data.subplans, offset_to_index) * return ast.AlternativeSubPlan(v_subplans) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AlternativeSubPlan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v_subplans}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1966 * * * cdef create_AlternativeSubPlan(structs.AlternativeSubPlan* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_subplans = _pg_list_to_tuple(data.subplans, offset_to_index) * return ast.AlternativeSubPlan(v_subplans) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_AlternativeSubPlan", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_subplans); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1971 * * * cdef create_FieldSelect(structs.FieldSelect* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_fieldnum = data.fieldnum */ static PyObject *__pyx_f_6pglast_6parser_create_FieldSelect(FieldSelect *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_fieldnum = 0; PyObject *__pyx_v_v_resulttypmod = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FieldSelect", 1); /* "pglast/ast.pyx":1972 * * cdef create_FieldSelect(structs.FieldSelect* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_fieldnum = data.fieldnum * cdef object v_resulttypmod = data.resulttypmod */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1973 * cdef create_FieldSelect(structs.FieldSelect* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_fieldnum = data.fieldnum # <<<<<<<<<<<<<< * cdef object v_resulttypmod = data.resulttypmod * return ast.FieldSelect(v_arg, v_fieldnum, v_resulttypmod) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->fieldnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_fieldnum = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1974 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_fieldnum = data.fieldnum * cdef object v_resulttypmod = data.resulttypmod # <<<<<<<<<<<<<< * return ast.FieldSelect(v_arg, v_fieldnum, v_resulttypmod) * */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->resulttypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resulttypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1975 * cdef object v_fieldnum = data.fieldnum * cdef object v_resulttypmod = data.resulttypmod * return ast.FieldSelect(v_arg, v_fieldnum, v_resulttypmod) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FieldSelect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_fieldnum, __pyx_v_v_resulttypmod}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1971 * * * cdef create_FieldSelect(structs.FieldSelect* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_fieldnum = data.fieldnum */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_FieldSelect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_fieldnum); __Pyx_XDECREF(__pyx_v_v_resulttypmod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1978 * * * cdef create_FieldStore(structs.FieldStore* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_FieldStore(FieldStore *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_newvals = 0; PyObject *__pyx_v_v_fieldnums = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FieldStore", 1); /* "pglast/ast.pyx":1979 * * cdef create_FieldStore(structs.FieldStore* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) * cdef tuple v_fieldnums = _pg_list_to_tuple(data.fieldnums, offset_to_index) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1980 * cdef create_FieldStore(structs.FieldStore* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_fieldnums = _pg_list_to_tuple(data.fieldnums, offset_to_index) * return ast.FieldStore(v_arg, v_newvals, v_fieldnums) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->newvals, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1980, __pyx_L1_error) __pyx_v_v_newvals = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1981 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) * cdef tuple v_fieldnums = _pg_list_to_tuple(data.fieldnums, offset_to_index) # <<<<<<<<<<<<<< * return ast.FieldStore(v_arg, v_newvals, v_fieldnums) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fieldnums, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 1981, __pyx_L1_error) __pyx_v_v_fieldnums = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":1982 * cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) * cdef tuple v_fieldnums = _pg_list_to_tuple(data.fieldnums, offset_to_index) * return ast.FieldStore(v_arg, v_newvals, v_fieldnums) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FieldStore); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_newvals, __pyx_v_v_fieldnums}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1978 * * * cdef create_FieldStore(structs.FieldStore* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_newvals = _pg_list_to_tuple(data.newvals, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_FieldStore", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_newvals); __Pyx_XDECREF(__pyx_v_v_fieldnums); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1985 * * * cdef create_RelabelType(structs.RelabelType* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod */ static PyObject *__pyx_f_6pglast_6parser_create_RelabelType(RelabelType *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_resulttypmod = 0; PyObject *__pyx_v_v_relabelformat = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RelabelType", 1); /* "pglast/ast.pyx":1986 * * cdef create_RelabelType(structs.RelabelType* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_resulttypmod = data.resulttypmod * cdef object v_relabelformat = getattr(enums, 'CoercionForm')(data.relabelformat) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1987 * cdef create_RelabelType(structs.RelabelType* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod # <<<<<<<<<<<<<< * cdef object v_relabelformat = getattr(enums, 'CoercionForm')(data.relabelformat) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->resulttypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resulttypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1988 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod * cdef object v_relabelformat = getattr(enums, 'CoercionForm')(data.relabelformat) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RelabelType(v_arg, v_resulttypmod, v_relabelformat, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->relabelformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_relabelformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1989 * cdef object v_resulttypmod = data.resulttypmod * cdef object v_relabelformat = getattr(enums, 'CoercionForm')(data.relabelformat) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RelabelType(v_arg, v_resulttypmod, v_relabelformat, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1990 * cdef object v_relabelformat = getattr(enums, 'CoercionForm')(data.relabelformat) * cdef object v_location = offset_to_index(data.location) * return ast.RelabelType(v_arg, v_resulttypmod, v_relabelformat, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RelabelType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_resulttypmod, __pyx_v_v_relabelformat, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1985 * * * cdef create_RelabelType(structs.RelabelType* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_RelabelType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_resulttypmod); __Pyx_XDECREF(__pyx_v_v_relabelformat); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":1993 * * * cdef create_CoerceViaIO(structs.CoerceViaIO* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) */ static PyObject *__pyx_f_6pglast_6parser_create_CoerceViaIO(CoerceViaIO *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_coerceformat = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CoerceViaIO", 1); /* "pglast/ast.pyx":1994 * * cdef create_CoerceViaIO(structs.CoerceViaIO* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1995 * cdef create_CoerceViaIO(structs.CoerceViaIO* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CoerceViaIO(v_arg, v_coerceformat, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->coerceformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_coerceformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1996 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CoerceViaIO(v_arg, v_coerceformat, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":1997 * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) * cdef object v_location = offset_to_index(data.location) * return ast.CoerceViaIO(v_arg, v_coerceformat, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CoerceViaIO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_coerceformat, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":1993 * * * cdef create_CoerceViaIO(structs.CoerceViaIO* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CoerceViaIO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_coerceformat); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2000 * * * cdef create_ArrayCoerceExpr(structs.ArrayCoerceExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_ArrayCoerceExpr(ArrayCoerceExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_elemexpr = 0; PyObject *__pyx_v_v_resulttypmod = 0; PyObject *__pyx_v_v_coerceformat = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ArrayCoerceExpr", 1); /* "pglast/ast.pyx":2001 * * cdef create_ArrayCoerceExpr(structs.ArrayCoerceExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None * cdef object v_resulttypmod = data.resulttypmod */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2002 * cdef create_ArrayCoerceExpr(structs.ArrayCoerceExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_resulttypmod = data.resulttypmod * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) */ __pyx_t_2 = (__pyx_v_data->elemexpr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->elemexpr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_elemexpr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2003 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None * cdef object v_resulttypmod = data.resulttypmod # <<<<<<<<<<<<<< * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->resulttypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resulttypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2004 * cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None * cdef object v_resulttypmod = data.resulttypmod * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ArrayCoerceExpr(v_arg, v_elemexpr, v_resulttypmod, v_coerceformat, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->coerceformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_coerceformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2005 * cdef object v_resulttypmod = data.resulttypmod * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ArrayCoerceExpr(v_arg, v_elemexpr, v_resulttypmod, v_coerceformat, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2006 * cdef object v_coerceformat = getattr(enums, 'CoercionForm')(data.coerceformat) * cdef object v_location = offset_to_index(data.location) * return ast.ArrayCoerceExpr(v_arg, v_elemexpr, v_resulttypmod, v_coerceformat, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ArrayCoerceExpr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_elemexpr, __pyx_v_v_resulttypmod, __pyx_v_v_coerceformat, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2000 * * * cdef create_ArrayCoerceExpr(structs.ArrayCoerceExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_elemexpr = create(data.elemexpr, offset_to_index) if data.elemexpr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_ArrayCoerceExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_elemexpr); __Pyx_XDECREF(__pyx_v_v_resulttypmod); __Pyx_XDECREF(__pyx_v_v_coerceformat); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2009 * * * cdef create_ConvertRowtypeExpr(structs.ConvertRowtypeExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) */ static PyObject *__pyx_f_6pglast_6parser_create_ConvertRowtypeExpr(ConvertRowtypeExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_convertformat = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ConvertRowtypeExpr", 1); /* "pglast/ast.pyx":2010 * * cdef create_ConvertRowtypeExpr(structs.ConvertRowtypeExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2011 * cdef create_ConvertRowtypeExpr(structs.ConvertRowtypeExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ConvertRowtypeExpr(v_arg, v_convertformat, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->convertformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_convertformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2012 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ConvertRowtypeExpr(v_arg, v_convertformat, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2013 * cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) * cdef object v_location = offset_to_index(data.location) * return ast.ConvertRowtypeExpr(v_arg, v_convertformat, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ConvertRowtypeExpr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_convertformat, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2009 * * * cdef create_ConvertRowtypeExpr(structs.ConvertRowtypeExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_convertformat = getattr(enums, 'CoercionForm')(data.convertformat) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_ConvertRowtypeExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_convertformat); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2016 * * * cdef create_CollateExpr(structs.CollateExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_CollateExpr(CollateExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CollateExpr", 1); /* "pglast/ast.pyx":2017 * * cdef create_CollateExpr(structs.CollateExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CollateExpr(v_arg, v_location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2018 * cdef create_CollateExpr(structs.CollateExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CollateExpr(v_arg, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2019 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.CollateExpr(v_arg, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CollateExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_v_arg, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2016 * * * cdef create_CollateExpr(structs.CollateExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CollateExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2022 * * * cdef create_CaseExpr(structs.CaseExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_CaseExpr(CaseExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_defresult = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CaseExpr", 1); /* "pglast/ast.pyx":2023 * * cdef create_CaseExpr(structs.CaseExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_defresult = create(data.defresult, offset_to_index) if data.defresult is not NULL else None */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2024 * cdef create_CaseExpr(structs.CaseExpr* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_defresult = create(data.defresult, offset_to_index) if data.defresult is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2024, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2024, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2025 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_defresult = create(data.defresult, offset_to_index) if data.defresult is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CaseExpr(v_arg, v_args, v_defresult, v_location) */ __pyx_t_2 = (__pyx_v_data->defresult != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->defresult, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_defresult = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2026 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_defresult = create(data.defresult, offset_to_index) if data.defresult is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CaseExpr(v_arg, v_args, v_defresult, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2027 * cdef object v_defresult = create(data.defresult, offset_to_index) if data.defresult is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.CaseExpr(v_arg, v_args, v_defresult, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CaseExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_4, __pyx_v_v_arg, __pyx_v_v_args, __pyx_v_v_defresult, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2022 * * * cdef create_CaseExpr(structs.CaseExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CaseExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_defresult); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2030 * * * cdef create_CaseWhen(structs.CaseWhen* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CaseWhen(CaseWhen *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_result = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CaseWhen", 1); /* "pglast/ast.pyx":2031 * * cdef create_CaseWhen(structs.CaseWhen* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2032 * cdef create_CaseWhen(structs.CaseWhen* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CaseWhen(v_expr, v_result, v_location) */ __pyx_t_2 = (__pyx_v_data->result != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->result, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_result = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2033 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CaseWhen(v_expr, v_result, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2034 * cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None * cdef object v_location = offset_to_index(data.location) * return ast.CaseWhen(v_expr, v_result, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_CaseWhen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_expr, __pyx_v_v_result, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2030 * * * cdef create_CaseWhen(structs.CaseWhen* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_result = create(data.result, offset_to_index) if data.result is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CaseWhen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_result); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2037 * * * cdef create_CaseTestExpr(structs.CaseTestExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeMod = data.typeMod * return ast.CaseTestExpr(v_typeMod) */ static PyObject *__pyx_f_6pglast_6parser_create_CaseTestExpr(CaseTestExpr *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeMod = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CaseTestExpr", 1); /* "pglast/ast.pyx":2038 * * cdef create_CaseTestExpr(structs.CaseTestExpr* data, offset_to_index): * cdef object v_typeMod = data.typeMod # <<<<<<<<<<<<<< * return ast.CaseTestExpr(v_typeMod) * */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typeMod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typeMod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2039 * cdef create_CaseTestExpr(structs.CaseTestExpr* data, offset_to_index): * cdef object v_typeMod = data.typeMod * return ast.CaseTestExpr(v_typeMod) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CaseTestExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v_typeMod}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2037 * * * cdef create_CaseTestExpr(structs.CaseTestExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeMod = data.typeMod * return ast.CaseTestExpr(v_typeMod) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_CaseTestExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeMod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2042 * * * cdef create_ArrayExpr(structs.ArrayExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_multidims = bool(data.multidims) */ static PyObject *__pyx_f_6pglast_6parser_create_ArrayExpr(ArrayExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_elements = 0; PyObject *__pyx_v_v_multidims = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_ArrayExpr", 1); /* "pglast/ast.pyx":2043 * * cdef create_ArrayExpr(structs.ArrayExpr* data, offset_to_index): * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_multidims = bool(data.multidims) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->elements, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2043, __pyx_L1_error) __pyx_v_v_elements = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2044 * cdef create_ArrayExpr(structs.ArrayExpr* data, offset_to_index): * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_multidims = bool(data.multidims) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.ArrayExpr(v_elements, v_multidims, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->multidims); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_multidims = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2045 * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_multidims = bool(data.multidims) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.ArrayExpr(v_elements, v_multidims, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_4 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2046 * cdef object v_multidims = bool(data.multidims) * cdef object v_location = offset_to_index(data.location) * return ast.ArrayExpr(v_elements, v_multidims, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ArrayExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_v_elements, __pyx_v_v_multidims, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2042 * * * cdef create_ArrayExpr(structs.ArrayExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_elements = _pg_list_to_tuple(data.elements, offset_to_index) * cdef object v_multidims = bool(data.multidims) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_ArrayExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_elements); __Pyx_XDECREF(__pyx_v_v_multidims); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2049 * * * cdef create_RowExpr(structs.RowExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) */ static PyObject *__pyx_f_6pglast_6parser_create_RowExpr(RowExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_row_format = 0; PyObject *__pyx_v_v_colnames = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RowExpr", 1); /* "pglast/ast.pyx":2050 * * cdef create_RowExpr(structs.RowExpr* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2050, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2051 * cdef create_RowExpr(structs.RowExpr* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) # <<<<<<<<<<<<<< * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->row_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_row_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2052 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.RowExpr(v_args, v_row_format, v_colnames, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->colnames, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2052, __pyx_L1_error) __pyx_v_v_colnames = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2053 * cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.RowExpr(v_args, v_row_format, v_colnames, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2054 * cdef tuple v_colnames = _pg_list_to_tuple(data.colnames, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.RowExpr(v_args, v_row_format, v_colnames, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RowExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_v_args, __pyx_v_v_row_format, __pyx_v_v_colnames, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2049 * * * cdef create_RowExpr(structs.RowExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_row_format = getattr(enums, 'CoercionForm')(data.row_format) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RowExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_row_format); __Pyx_XDECREF(__pyx_v_v_colnames); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2057 * * * cdef create_RowCompareExpr(structs.RowCompareExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rctype = getattr(enums, 'RowCompareType')(data.rctype) * cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_RowCompareExpr(RowCompareExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_rctype = 0; PyObject *__pyx_v_v_opnos = 0; PyObject *__pyx_v_v_opfamilies = 0; PyObject *__pyx_v_v_inputcollids = 0; PyObject *__pyx_v_v_largs = 0; PyObject *__pyx_v_v_rargs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RowCompareExpr", 1); /* "pglast/ast.pyx":2058 * * cdef create_RowCompareExpr(structs.RowCompareExpr* data, offset_to_index): * cdef object v_rctype = getattr(enums, 'RowCompareType')(data.rctype) # <<<<<<<<<<<<<< * cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) * cdef tuple v_opfamilies = _pg_list_to_tuple(data.opfamilies, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_RowCompareType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_RowCompareType(__pyx_v_data->rctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_rctype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2059 * cdef create_RowCompareExpr(structs.RowCompareExpr* data, offset_to_index): * cdef object v_rctype = getattr(enums, 'RowCompareType')(data.rctype) * cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_opfamilies = _pg_list_to_tuple(data.opfamilies, offset_to_index) * cdef tuple v_inputcollids = _pg_list_to_tuple(data.inputcollids, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opnos, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2059, __pyx_L1_error) __pyx_v_v_opnos = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2060 * cdef object v_rctype = getattr(enums, 'RowCompareType')(data.rctype) * cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) * cdef tuple v_opfamilies = _pg_list_to_tuple(data.opfamilies, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_inputcollids = _pg_list_to_tuple(data.inputcollids, offset_to_index) * cdef tuple v_largs = _pg_list_to_tuple(data.largs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->opfamilies, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2060, __pyx_L1_error) __pyx_v_v_opfamilies = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2061 * cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) * cdef tuple v_opfamilies = _pg_list_to_tuple(data.opfamilies, offset_to_index) * cdef tuple v_inputcollids = _pg_list_to_tuple(data.inputcollids, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_largs = _pg_list_to_tuple(data.largs, offset_to_index) * cdef tuple v_rargs = _pg_list_to_tuple(data.rargs, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->inputcollids, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2061, __pyx_L1_error) __pyx_v_v_inputcollids = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2062 * cdef tuple v_opfamilies = _pg_list_to_tuple(data.opfamilies, offset_to_index) * cdef tuple v_inputcollids = _pg_list_to_tuple(data.inputcollids, offset_to_index) * cdef tuple v_largs = _pg_list_to_tuple(data.largs, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_rargs = _pg_list_to_tuple(data.rargs, offset_to_index) * return ast.RowCompareExpr(v_rctype, v_opnos, v_opfamilies, v_inputcollids, v_largs, v_rargs) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->largs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2062, __pyx_L1_error) __pyx_v_v_largs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2063 * cdef tuple v_inputcollids = _pg_list_to_tuple(data.inputcollids, offset_to_index) * cdef tuple v_largs = _pg_list_to_tuple(data.largs, offset_to_index) * cdef tuple v_rargs = _pg_list_to_tuple(data.rargs, offset_to_index) # <<<<<<<<<<<<<< * return ast.RowCompareExpr(v_rctype, v_opnos, v_opfamilies, v_inputcollids, v_largs, v_rargs) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->rargs, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2063, __pyx_L1_error) __pyx_v_v_rargs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2064 * cdef tuple v_largs = _pg_list_to_tuple(data.largs, offset_to_index) * cdef tuple v_rargs = _pg_list_to_tuple(data.rargs, offset_to_index) * return ast.RowCompareExpr(v_rctype, v_opnos, v_opfamilies, v_inputcollids, v_largs, v_rargs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RowCompareExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_rctype, __pyx_v_v_opnos, __pyx_v_v_opfamilies, __pyx_v_v_inputcollids, __pyx_v_v_largs, __pyx_v_v_rargs}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2057 * * * cdef create_RowCompareExpr(structs.RowCompareExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rctype = getattr(enums, 'RowCompareType')(data.rctype) * cdef tuple v_opnos = _pg_list_to_tuple(data.opnos, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_RowCompareExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_rctype); __Pyx_XDECREF(__pyx_v_v_opnos); __Pyx_XDECREF(__pyx_v_v_opfamilies); __Pyx_XDECREF(__pyx_v_v_inputcollids); __Pyx_XDECREF(__pyx_v_v_largs); __Pyx_XDECREF(__pyx_v_v_rargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2067 * * * cdef create_CoalesceExpr(structs.CoalesceExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_CoalesceExpr(CoalesceExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CoalesceExpr", 1); /* "pglast/ast.pyx":2068 * * cdef create_CoalesceExpr(structs.CoalesceExpr* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CoalesceExpr(v_args, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2068, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2069 * cdef create_CoalesceExpr(structs.CoalesceExpr* data, offset_to_index): * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CoalesceExpr(v_args, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2070 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.CoalesceExpr(v_args, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CoalesceExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_args, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2067 * * * cdef create_CoalesceExpr(structs.CoalesceExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CoalesceExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2073 * * * cdef create_MinMaxExpr(structs.MinMaxExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'MinMaxOp')(data.op) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_MinMaxExpr(MinMaxExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_MinMaxExpr", 1); /* "pglast/ast.pyx":2074 * * cdef create_MinMaxExpr(structs.MinMaxExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'MinMaxOp')(data.op) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_MinMaxOp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_MinMaxOp(__pyx_v_data->op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2075 * cdef create_MinMaxExpr(structs.MinMaxExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'MinMaxOp')(data.op) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.MinMaxExpr(v_op, v_args, v_location) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2075, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2076 * cdef object v_op = getattr(enums, 'MinMaxOp')(data.op) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.MinMaxExpr(v_op, v_args, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2077 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_location = offset_to_index(data.location) * return ast.MinMaxExpr(v_op, v_args, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MinMaxExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_op, __pyx_v_v_args, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2073 * * * cdef create_MinMaxExpr(structs.MinMaxExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'MinMaxOp')(data.op) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_MinMaxExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2080 * * * cdef create_SQLValueFunction(structs.SQLValueFunction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'SQLValueFunctionOp')(data.op) * cdef object v_typmod = data.typmod */ static PyObject *__pyx_f_6pglast_6parser_create_SQLValueFunction(SQLValueFunction *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_typmod = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SQLValueFunction", 1); /* "pglast/ast.pyx":2081 * * cdef create_SQLValueFunction(structs.SQLValueFunction* data, offset_to_index): * cdef object v_op = getattr(enums, 'SQLValueFunctionOp')(data.op) # <<<<<<<<<<<<<< * cdef object v_typmod = data.typmod * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_SQLValueFunctionOp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_SQLValueFunctionOp(__pyx_v_data->op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2082 * cdef create_SQLValueFunction(structs.SQLValueFunction* data, offset_to_index): * cdef object v_op = getattr(enums, 'SQLValueFunctionOp')(data.op) * cdef object v_typmod = data.typmod # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.SQLValueFunction(v_op, v_typmod, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2083 * cdef object v_op = getattr(enums, 'SQLValueFunctionOp')(data.op) * cdef object v_typmod = data.typmod * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.SQLValueFunction(v_op, v_typmod, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2084 * cdef object v_typmod = data.typmod * cdef object v_location = offset_to_index(data.location) * return ast.SQLValueFunction(v_op, v_typmod, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SQLValueFunction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_v_op, __pyx_v_v_typmod, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2080 * * * cdef create_SQLValueFunction(structs.SQLValueFunction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'SQLValueFunctionOp')(data.op) * cdef object v_typmod = data.typmod */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SQLValueFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_typmod); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2087 * * * cdef create_XmlExpr(structs.XmlExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'XmlExprOp')(data.op) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_XmlExpr(XmlExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_name = 0; PyObject *__pyx_v_v_named_args = 0; PyObject *__pyx_v_v_arg_names = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_xmloption = 0; PyObject *__pyx_v_v_indent = 0; PyObject *__pyx_v_v_typmod = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_XmlExpr", 1); /* "pglast/ast.pyx":2088 * * cdef create_XmlExpr(structs.XmlExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'XmlExprOp')(data.op) # <<<<<<<<<<<<<< * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_named_args = _pg_list_to_tuple(data.named_args, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_XmlExprOp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_XmlExprOp(__pyx_v_data->op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2089 * cdef create_XmlExpr(structs.XmlExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'XmlExprOp')(data.op) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_named_args = _pg_list_to_tuple(data.named_args, offset_to_index) * cdef tuple v_arg_names = _pg_list_to_tuple(data.arg_names, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2089, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2090 * cdef object v_op = getattr(enums, 'XmlExprOp')(data.op) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_named_args = _pg_list_to_tuple(data.named_args, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_arg_names = _pg_list_to_tuple(data.arg_names, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->named_args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2090, __pyx_L1_error) __pyx_v_v_named_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2091 * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None * cdef tuple v_named_args = _pg_list_to_tuple(data.named_args, offset_to_index) * cdef tuple v_arg_names = _pg_list_to_tuple(data.arg_names, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->arg_names, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2091, __pyx_L1_error) __pyx_v_v_arg_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2092 * cdef tuple v_named_args = _pg_list_to_tuple(data.named_args, offset_to_index) * cdef tuple v_arg_names = _pg_list_to_tuple(data.arg_names, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_indent = bool(data.indent) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2092, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2093 * cdef tuple v_arg_names = _pg_list_to_tuple(data.arg_names, offset_to_index) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) # <<<<<<<<<<<<<< * cdef object v_indent = bool(data.indent) * cdef object v_typmod = data.typmod */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_XmlOptionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_XmlOptionType(__pyx_v_data->xmloption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2093, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_xmloption = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2094 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_indent = bool(data.indent) # <<<<<<<<<<<<<< * cdef object v_typmod = data.typmod * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->indent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_indent = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2095 * cdef object v_xmloption = getattr(enums, 'XmlOptionType')(data.xmloption) * cdef object v_indent = bool(data.indent) * cdef object v_typmod = data.typmod # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.XmlExpr(v_op, v_name, v_named_args, v_arg_names, v_args, v_xmloption, v_indent, v_typmod, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2096 * cdef object v_indent = bool(data.indent) * cdef object v_typmod = data.typmod * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.XmlExpr(v_op, v_name, v_named_args, v_arg_names, v_args, v_xmloption, v_indent, v_typmod, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2097 * cdef object v_typmod = data.typmod * cdef object v_location = offset_to_index(data.location) * return ast.XmlExpr(v_op, v_name, v_named_args, v_arg_names, v_args, v_xmloption, v_indent, v_typmod, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_XmlExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[10] = {__pyx_t_3, __pyx_v_v_op, __pyx_v_v_name, __pyx_v_v_named_args, __pyx_v_v_arg_names, __pyx_v_v_args, __pyx_v_v_xmloption, __pyx_v_v_indent, __pyx_v_v_typmod, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 9+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2087 * * * cdef create_XmlExpr(structs.XmlExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'XmlExprOp')(data.op) * cdef object v_name = data.name.decode("utf-8") if data.name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_XmlExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_name); __Pyx_XDECREF(__pyx_v_v_named_args); __Pyx_XDECREF(__pyx_v_v_arg_names); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_xmloption); __Pyx_XDECREF(__pyx_v_v_indent); __Pyx_XDECREF(__pyx_v_v_typmod); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2100 * * * cdef create_JsonFormat(structs.JsonFormat* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_format_type = getattr(enums, 'JsonFormatType')(data.format_type) * cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) */ static PyObject *__pyx_f_6pglast_6parser_create_JsonFormat(JsonFormat *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_format_type = 0; PyObject *__pyx_v_v_encoding = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonFormat", 1); /* "pglast/ast.pyx":2101 * * cdef create_JsonFormat(structs.JsonFormat* data, offset_to_index): * cdef object v_format_type = getattr(enums, 'JsonFormatType')(data.format_type) # <<<<<<<<<<<<<< * cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonFormatType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonFormatType(__pyx_v_data->format_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_format_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2102 * cdef create_JsonFormat(structs.JsonFormat* data, offset_to_index): * cdef object v_format_type = getattr(enums, 'JsonFormatType')(data.format_type) * cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonFormat(v_format_type, v_encoding, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_JsonEncoding); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_JsonEncoding(__pyx_v_data->encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_encoding = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2103 * cdef object v_format_type = getattr(enums, 'JsonFormatType')(data.format_type) * cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonFormat(v_format_type, v_encoding, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2104 * cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) * cdef object v_location = offset_to_index(data.location) * return ast.JsonFormat(v_format_type, v_encoding, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonFormat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_format_type, __pyx_v_v_encoding, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2100 * * * cdef create_JsonFormat(structs.JsonFormat* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_format_type = getattr(enums, 'JsonFormatType')(data.format_type) * cdef object v_encoding = getattr(enums, 'JsonEncoding')(data.encoding) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_format_type); __Pyx_XDECREF(__pyx_v_v_encoding); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2107 * * * cdef create_JsonReturning(structs.JsonReturning* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_typmod = data.typmod */ static PyObject *__pyx_f_6pglast_6parser_create_JsonReturning(JsonReturning *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_format = 0; PyObject *__pyx_v_v_typmod = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonReturning", 1); /* "pglast/ast.pyx":2108 * * cdef create_JsonReturning(structs.JsonReturning* data, offset_to_index): * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None # <<<<<<<<<<<<<< * cdef object v_typmod = data.typmod * return ast.JsonReturning(v_format, v_typmod) */ __pyx_t_2 = (__pyx_v_data->format != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->format, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2109 * cdef create_JsonReturning(structs.JsonReturning* data, offset_to_index): * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_typmod = data.typmod # <<<<<<<<<<<<<< * return ast.JsonReturning(v_format, v_typmod) * */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2110 * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_typmod = data.typmod * return ast.JsonReturning(v_format, v_typmod) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonReturning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_format, __pyx_v_v_typmod}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2107 * * * cdef create_JsonReturning(structs.JsonReturning* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_typmod = data.typmod */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonReturning", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_format); __Pyx_XDECREF(__pyx_v_v_typmod); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2113 * * * cdef create_JsonValueExpr(structs.JsonValueExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonValueExpr(JsonValueExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_raw_expr = 0; PyObject *__pyx_v_v_formatted_expr = 0; PyObject *__pyx_v_v_format = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonValueExpr", 1); /* "pglast/ast.pyx":2114 * * cdef create_JsonValueExpr(structs.JsonValueExpr* data, offset_to_index): * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None */ __pyx_t_2 = (__pyx_v_data->raw_expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->raw_expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_raw_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2115 * cdef create_JsonValueExpr(structs.JsonValueExpr* data, offset_to_index): * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * return ast.JsonValueExpr(v_raw_expr, v_formatted_expr, v_format) */ __pyx_t_2 = (__pyx_v_data->formatted_expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->formatted_expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_formatted_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2116 * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None # <<<<<<<<<<<<<< * return ast.JsonValueExpr(v_raw_expr, v_formatted_expr, v_format) * */ __pyx_t_2 = (__pyx_v_data->format != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->format, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2117 * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * return ast.JsonValueExpr(v_raw_expr, v_formatted_expr, v_format) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonValueExpr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_raw_expr, __pyx_v_v_formatted_expr, __pyx_v_v_format}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2113 * * * cdef create_JsonValueExpr(structs.JsonValueExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_raw_expr = create(data.raw_expr, offset_to_index) if data.raw_expr is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonValueExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_raw_expr); __Pyx_XDECREF(__pyx_v_v_formatted_expr); __Pyx_XDECREF(__pyx_v_v_format); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2120 * * * cdef create_JsonConstructorExpr(structs.JsonConstructorExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_type = getattr(enums, 'JsonConstructorType')(data.type) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_JsonConstructorExpr(JsonConstructorExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_type = 0; PyObject *__pyx_v_v_args = 0; PyObject *__pyx_v_v_func = 0; PyObject *__pyx_v_v_coercion = 0; PyObject *__pyx_v_v_returning = 0; PyObject *__pyx_v_v_absent_on_null = 0; PyObject *__pyx_v_v_unique = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonConstructorExpr", 1); /* "pglast/ast.pyx":2121 * * cdef create_JsonConstructorExpr(structs.JsonConstructorExpr* data, offset_to_index): * cdef object v_type = getattr(enums, 'JsonConstructorType')(data.type) # <<<<<<<<<<<<<< * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonConstructorType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonConstructorType(__pyx_v_data->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2122 * cdef create_JsonConstructorExpr(structs.JsonConstructorExpr* data, offset_to_index): * cdef object v_type = getattr(enums, 'JsonConstructorType')(data.type) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef object v_coercion = create(data.coercion, offset_to_index) if data.coercion is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->args, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2122, __pyx_L1_error) __pyx_v_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2123 * cdef object v_type = getattr(enums, 'JsonConstructorType')(data.type) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None # <<<<<<<<<<<<<< * cdef object v_coercion = create(data.coercion, offset_to_index) if data.coercion is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None */ __pyx_t_6 = (__pyx_v_data->func != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->func, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2124 * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef object v_coercion = create(data.coercion, offset_to_index) if data.coercion is not NULL else None # <<<<<<<<<<<<<< * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) */ __pyx_t_6 = (__pyx_v_data->coercion != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->coercion, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_coercion = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2125 * cdef object v_func = create(data.func, offset_to_index) if data.func is not NULL else None * cdef object v_coercion = create(data.coercion, offset_to_index) if data.coercion is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None # <<<<<<<<<<<<<< * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) */ __pyx_t_6 = (__pyx_v_data->returning != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->returning, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_returning = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2126 * cdef object v_coercion = create(data.coercion, offset_to_index) if data.coercion is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) # <<<<<<<<<<<<<< * cdef object v_unique = bool(data.unique) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->absent_on_null); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_absent_on_null = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2127 * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonConstructorExpr(v_type, v_args, v_func, v_coercion, v_returning, v_absent_on_null, v_unique, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unique); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unique = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2128 * cdef object v_absent_on_null = bool(data.absent_on_null) * cdef object v_unique = bool(data.unique) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonConstructorExpr(v_type, v_args, v_func, v_coercion, v_returning, v_absent_on_null, v_unique, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2129 * cdef object v_unique = bool(data.unique) * cdef object v_location = offset_to_index(data.location) * return ast.JsonConstructorExpr(v_type, v_args, v_func, v_coercion, v_returning, v_absent_on_null, v_unique, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_JsonConstructorExpr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[9] = {__pyx_t_2, __pyx_v_v_type, __pyx_v_v_args, __pyx_v_v_func, __pyx_v_v_coercion, __pyx_v_v_returning, __pyx_v_v_absent_on_null, __pyx_v_v_unique, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 8+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2120 * * * cdef create_JsonConstructorExpr(structs.JsonConstructorExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_type = getattr(enums, 'JsonConstructorType')(data.type) * cdef tuple v_args = _pg_list_to_tuple(data.args, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonConstructorExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_type); __Pyx_XDECREF(__pyx_v_v_args); __Pyx_XDECREF(__pyx_v_v_func); __Pyx_XDECREF(__pyx_v_v_coercion); __Pyx_XDECREF(__pyx_v_v_returning); __Pyx_XDECREF(__pyx_v_v_absent_on_null); __Pyx_XDECREF(__pyx_v_v_unique); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2132 * * * cdef create_JsonIsPredicate(structs.JsonIsPredicate* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonIsPredicate(JsonIsPredicate *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_format = 0; PyObject *__pyx_v_v_item_type = 0; PyObject *__pyx_v_v_unique_keys = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonIsPredicate", 1); /* "pglast/ast.pyx":2133 * * cdef create_JsonIsPredicate(structs.JsonIsPredicate* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_item_type = getattr(enums, 'JsonValueType')(data.item_type) */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2134 * cdef create_JsonIsPredicate(structs.JsonIsPredicate* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None # <<<<<<<<<<<<<< * cdef object v_item_type = getattr(enums, 'JsonValueType')(data.item_type) * cdef object v_unique_keys = bool(data.unique_keys) */ __pyx_t_2 = (__pyx_v_data->format != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->format, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2135 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_item_type = getattr(enums, 'JsonValueType')(data.item_type) # <<<<<<<<<<<<<< * cdef object v_unique_keys = bool(data.unique_keys) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_JsonValueType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_JsonValueType(__pyx_v_data->item_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_item_type = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2136 * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_item_type = getattr(enums, 'JsonValueType')(data.item_type) * cdef object v_unique_keys = bool(data.unique_keys) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonIsPredicate(v_expr, v_format, v_item_type, v_unique_keys, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->unique_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_unique_keys = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2137 * cdef object v_item_type = getattr(enums, 'JsonValueType')(data.item_type) * cdef object v_unique_keys = bool(data.unique_keys) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonIsPredicate(v_expr, v_format, v_item_type, v_unique_keys, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2138 * cdef object v_unique_keys = bool(data.unique_keys) * cdef object v_location = offset_to_index(data.location) * return ast.JsonIsPredicate(v_expr, v_format, v_item_type, v_unique_keys, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonIsPredicate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_3, __pyx_v_v_expr, __pyx_v_v_format, __pyx_v_v_item_type, __pyx_v_v_unique_keys, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 5+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2132 * * * cdef create_JsonIsPredicate(structs.JsonIsPredicate* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_JsonIsPredicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_format); __Pyx_XDECREF(__pyx_v_v_item_type); __Pyx_XDECREF(__pyx_v_v_unique_keys); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2141 * * * cdef create_JsonBehavior(structs.JsonBehavior* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_btype = getattr(enums, 'JsonBehaviorType')(data.btype) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonBehavior(JsonBehavior *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_btype = 0; PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_coerce = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonBehavior", 1); /* "pglast/ast.pyx":2142 * * cdef create_JsonBehavior(structs.JsonBehavior* data, offset_to_index): * cdef object v_btype = getattr(enums, 'JsonBehaviorType')(data.btype) # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_coerce = bool(data.coerce) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonBehaviorType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonBehaviorType(__pyx_v_data->btype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_btype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2143 * cdef create_JsonBehavior(structs.JsonBehavior* data, offset_to_index): * cdef object v_btype = getattr(enums, 'JsonBehaviorType')(data.btype) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_coerce = bool(data.coerce) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_6 = (__pyx_v_data->expr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2144 * cdef object v_btype = getattr(enums, 'JsonBehaviorType')(data.btype) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_coerce = bool(data.coerce) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonBehavior(v_btype, v_expr, v_coerce, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->coerce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_coerce = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2145 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_coerce = bool(data.coerce) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonBehavior(v_btype, v_expr, v_coerce, v_location) * */ __pyx_t_3 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_2 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2146 * cdef object v_coerce = bool(data.coerce) * cdef object v_location = offset_to_index(data.location) * return ast.JsonBehavior(v_btype, v_expr, v_coerce, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_JsonBehavior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_v_btype, __pyx_v_v_expr, __pyx_v_v_coerce, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 4+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2141 * * * cdef create_JsonBehavior(structs.JsonBehavior* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_btype = getattr(enums, 'JsonBehaviorType')(data.btype) * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonBehavior", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_btype); __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_coerce); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2149 * * * cdef create_JsonExpr(structs.JsonExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_JsonExpr(JsonExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_op = 0; PyObject *__pyx_v_v_column_name = 0; PyObject *__pyx_v_v_formatted_expr = 0; PyObject *__pyx_v_v_format = 0; PyObject *__pyx_v_v_path_spec = 0; PyObject *__pyx_v_v_returning = 0; PyObject *__pyx_v_v_passing_names = 0; PyObject *__pyx_v_v_passing_values = 0; PyObject *__pyx_v_v_on_empty = 0; PyObject *__pyx_v_v_on_error = 0; PyObject *__pyx_v_v_use_io_coercion = 0; PyObject *__pyx_v_v_use_json_coercion = 0; PyObject *__pyx_v_v_wrapper = 0; PyObject *__pyx_v_v_omit_quotes = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JsonExpr", 1); /* "pglast/ast.pyx":2150 * * cdef create_JsonExpr(structs.JsonExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) # <<<<<<<<<<<<<< * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JsonExprOp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JsonExprOp(__pyx_v_data->op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_op = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2151 * cdef create_JsonExpr(structs.JsonExpr* data, offset_to_index): * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None */ __pyx_t_6 = (__pyx_v_data->column_name != NULL); if (__pyx_t_6) { __pyx_t_7 = __pyx_v_data->column_name; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2151, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_column_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2152 * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_path_spec = create(data.path_spec, offset_to_index) if data.path_spec is not NULL else None */ __pyx_t_6 = (__pyx_v_data->formatted_expr != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->formatted_expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_formatted_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2153 * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None # <<<<<<<<<<<<<< * cdef object v_path_spec = create(data.path_spec, offset_to_index) if data.path_spec is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None */ __pyx_t_6 = (__pyx_v_data->format != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->format, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_format = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2154 * cdef object v_formatted_expr = create(data.formatted_expr, offset_to_index) if data.formatted_expr is not NULL else None * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_path_spec = create(data.path_spec, offset_to_index) if data.path_spec is not NULL else None # <<<<<<<<<<<<<< * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * cdef tuple v_passing_names = _pg_list_to_tuple(data.passing_names, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->path_spec != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->path_spec, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_path_spec = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2155 * cdef object v_format = create(data.format, offset_to_index) if data.format is not NULL else None * cdef object v_path_spec = create(data.path_spec, offset_to_index) if data.path_spec is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_passing_names = _pg_list_to_tuple(data.passing_names, offset_to_index) * cdef tuple v_passing_values = _pg_list_to_tuple(data.passing_values, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->returning != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->returning, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_returning = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2156 * cdef object v_path_spec = create(data.path_spec, offset_to_index) if data.path_spec is not NULL else None * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * cdef tuple v_passing_names = _pg_list_to_tuple(data.passing_names, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_passing_values = _pg_list_to_tuple(data.passing_values, offset_to_index) * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->passing_names, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2156, __pyx_L1_error) __pyx_v_v_passing_names = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2157 * cdef object v_returning = create(data.returning, offset_to_index) if data.returning is not NULL else None * cdef tuple v_passing_names = _pg_list_to_tuple(data.passing_names, offset_to_index) * cdef tuple v_passing_values = _pg_list_to_tuple(data.passing_values, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->passing_values, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2157, __pyx_L1_error) __pyx_v_v_passing_values = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2158 * cdef tuple v_passing_names = _pg_list_to_tuple(data.passing_names, offset_to_index) * cdef tuple v_passing_values = _pg_list_to_tuple(data.passing_values, offset_to_index) * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None # <<<<<<<<<<<<<< * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_use_io_coercion = bool(data.use_io_coercion) */ __pyx_t_6 = (__pyx_v_data->on_empty != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_empty, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_empty = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2159 * cdef tuple v_passing_values = _pg_list_to_tuple(data.passing_values, offset_to_index) * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None # <<<<<<<<<<<<<< * cdef object v_use_io_coercion = bool(data.use_io_coercion) * cdef object v_use_json_coercion = bool(data.use_json_coercion) */ __pyx_t_6 = (__pyx_v_data->on_error != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->on_error, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_on_error = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2160 * cdef object v_on_empty = create(data.on_empty, offset_to_index) if data.on_empty is not NULL else None * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_use_io_coercion = bool(data.use_io_coercion) # <<<<<<<<<<<<<< * cdef object v_use_json_coercion = bool(data.use_json_coercion) * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->use_io_coercion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_use_io_coercion = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2161 * cdef object v_on_error = create(data.on_error, offset_to_index) if data.on_error is not NULL else None * cdef object v_use_io_coercion = bool(data.use_io_coercion) * cdef object v_use_json_coercion = bool(data.use_json_coercion) # <<<<<<<<<<<<<< * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_omit_quotes = bool(data.omit_quotes) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->use_json_coercion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_use_json_coercion = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2162 * cdef object v_use_io_coercion = bool(data.use_io_coercion) * cdef object v_use_json_coercion = bool(data.use_json_coercion) * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) # <<<<<<<<<<<<<< * cdef object v_omit_quotes = bool(data.omit_quotes) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_JsonWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_JsonWrapper(__pyx_v_data->wrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_wrapper = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2163 * cdef object v_use_json_coercion = bool(data.use_json_coercion) * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_omit_quotes = bool(data.omit_quotes) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.JsonExpr(v_op, v_column_name, v_formatted_expr, v_format, v_path_spec, v_returning, v_passing_names, v_passing_values, v_on_empty, v_on_error, v_use_io_coercion, v_use_json_coercion, v_wrapper, v_omit_quotes, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->omit_quotes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_omit_quotes = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2164 * cdef object v_wrapper = getattr(enums, 'JsonWrapper')(data.wrapper) * cdef object v_omit_quotes = bool(data.omit_quotes) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.JsonExpr(v_op, v_column_name, v_formatted_expr, v_format, v_path_spec, v_returning, v_passing_names, v_passing_values, v_on_empty, v_on_error, v_use_io_coercion, v_use_json_coercion, v_wrapper, v_omit_quotes, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2165 * cdef object v_omit_quotes = bool(data.omit_quotes) * cdef object v_location = offset_to_index(data.location) * return ast.JsonExpr(v_op, v_column_name, v_formatted_expr, v_format, v_path_spec, v_returning, v_passing_names, v_passing_values, v_on_empty, v_on_error, v_use_io_coercion, v_use_json_coercion, v_wrapper, v_omit_quotes, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JsonExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[16] = {__pyx_t_3, __pyx_v_v_op, __pyx_v_v_column_name, __pyx_v_v_formatted_expr, __pyx_v_v_format, __pyx_v_v_path_spec, __pyx_v_v_returning, __pyx_v_v_passing_names, __pyx_v_v_passing_values, __pyx_v_v_on_empty, __pyx_v_v_on_error, __pyx_v_v_use_io_coercion, __pyx_v_v_use_json_coercion, __pyx_v_v_wrapper, __pyx_v_v_omit_quotes, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 15+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2149 * * * cdef create_JsonExpr(structs.JsonExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_op = getattr(enums, 'JsonExprOp')(data.op) * cdef object v_column_name = data.column_name.decode("utf-8") if data.column_name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JsonExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_op); __Pyx_XDECREF(__pyx_v_v_column_name); __Pyx_XDECREF(__pyx_v_v_formatted_expr); __Pyx_XDECREF(__pyx_v_v_format); __Pyx_XDECREF(__pyx_v_v_path_spec); __Pyx_XDECREF(__pyx_v_v_returning); __Pyx_XDECREF(__pyx_v_v_passing_names); __Pyx_XDECREF(__pyx_v_v_passing_values); __Pyx_XDECREF(__pyx_v_v_on_empty); __Pyx_XDECREF(__pyx_v_v_on_error); __Pyx_XDECREF(__pyx_v_v_use_io_coercion); __Pyx_XDECREF(__pyx_v_v_use_json_coercion); __Pyx_XDECREF(__pyx_v_v_wrapper); __Pyx_XDECREF(__pyx_v_v_omit_quotes); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2168 * * * cdef create_NullTest(structs.NullTest* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) */ static PyObject *__pyx_f_6pglast_6parser_create_NullTest(NullTest *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_nulltesttype = 0; PyObject *__pyx_v_v_argisrow = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_NullTest", 1); /* "pglast/ast.pyx":2169 * * cdef create_NullTest(structs.NullTest* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) * cdef object v_argisrow = bool(data.argisrow) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2170 * cdef create_NullTest(structs.NullTest* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) # <<<<<<<<<<<<<< * cdef object v_argisrow = bool(data.argisrow) * cdef object v_location = offset_to_index(data.location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_NullTestType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_NullTestType(__pyx_v_data->nulltesttype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_nulltesttype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2171 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) * cdef object v_argisrow = bool(data.argisrow) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.NullTest(v_arg, v_nulltesttype, v_argisrow, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->argisrow); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_argisrow = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2172 * cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) * cdef object v_argisrow = bool(data.argisrow) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.NullTest(v_arg, v_nulltesttype, v_argisrow, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2173 * cdef object v_argisrow = bool(data.argisrow) * cdef object v_location = offset_to_index(data.location) * return ast.NullTest(v_arg, v_nulltesttype, v_argisrow, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NullTest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_nulltesttype, __pyx_v_v_argisrow, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2168 * * * cdef create_NullTest(structs.NullTest* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_nulltesttype = getattr(enums, 'NullTestType')(data.nulltesttype) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_NullTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_nulltesttype); __Pyx_XDECREF(__pyx_v_v_argisrow); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2176 * * * cdef create_BooleanTest(structs.BooleanTest* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) */ static PyObject *__pyx_f_6pglast_6parser_create_BooleanTest(BooleanTest *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_booltesttype = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_BooleanTest", 1); /* "pglast/ast.pyx":2177 * * cdef create_BooleanTest(structs.BooleanTest* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2178 * cdef create_BooleanTest(structs.BooleanTest* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.BooleanTest(v_arg, v_booltesttype, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_BoolTestType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_BoolTestType(__pyx_v_data->booltesttype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_booltesttype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2179 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.BooleanTest(v_arg, v_booltesttype, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2180 * cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) * cdef object v_location = offset_to_index(data.location) * return ast.BooleanTest(v_arg, v_booltesttype, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_BooleanTest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_booltesttype, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2176 * * * cdef create_BooleanTest(structs.BooleanTest* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_booltesttype = getattr(enums, 'BoolTestType')(data.booltesttype) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_BooleanTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_booltesttype); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2183 * * * cdef create_MergeAction(structs.MergeAction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) */ static PyObject *__pyx_f_6pglast_6parser_create_MergeAction(MergeAction *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_matchKind = 0; PyObject *__pyx_v_v_commandType = 0; PyObject *__pyx_v_v_override = 0; PyObject *__pyx_v_v_qual = 0; PyObject *__pyx_v_v_targetList = 0; PyObject *__pyx_v_v_updateColnos = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_MergeAction", 1); /* "pglast/ast.pyx":2184 * * cdef create_MergeAction(structs.MergeAction* data, offset_to_index): * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) # <<<<<<<<<<<<<< * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_MergeMatchKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_MergeMatchKind(__pyx_v_data->matchKind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_matchKind = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2185 * cdef create_MergeAction(structs.MergeAction* data, offset_to_index): * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) # <<<<<<<<<<<<<< * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CmdType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CmdType(__pyx_v_data->commandType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_v_commandType = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2186 * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) # <<<<<<<<<<<<<< * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_OverridingKind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_OverridingKind(__pyx_v_data->override); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_override = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2187 * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_updateColnos = _pg_list_to_tuple(data.updateColnos, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->qual != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->qual, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_qual = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2188 * cdef object v_override = getattr(enums, 'OverridingKind')(data.override) * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) # <<<<<<<<<<<<<< * cdef tuple v_updateColnos = _pg_list_to_tuple(data.updateColnos, offset_to_index) * return ast.MergeAction(v_matchKind, v_commandType, v_override, v_qual, v_targetList, v_updateColnos) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->targetList, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2188, __pyx_L1_error) __pyx_v_v_targetList = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2189 * cdef object v_qual = create(data.qual, offset_to_index) if data.qual is not NULL else None * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_updateColnos = _pg_list_to_tuple(data.updateColnos, offset_to_index) # <<<<<<<<<<<<<< * return ast.MergeAction(v_matchKind, v_commandType, v_override, v_qual, v_targetList, v_updateColnos) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->updateColnos, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2189, __pyx_L1_error) __pyx_v_v_updateColnos = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2190 * cdef tuple v_targetList = _pg_list_to_tuple(data.targetList, offset_to_index) * cdef tuple v_updateColnos = _pg_list_to_tuple(data.updateColnos, offset_to_index) * return ast.MergeAction(v_matchKind, v_commandType, v_override, v_qual, v_targetList, v_updateColnos) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_MergeAction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_matchKind, __pyx_v_v_commandType, __pyx_v_v_override, __pyx_v_v_qual, __pyx_v_v_targetList, __pyx_v_v_updateColnos}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 6+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2183 * * * cdef create_MergeAction(structs.MergeAction* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_matchKind = getattr(enums, 'MergeMatchKind')(data.matchKind) * cdef object v_commandType = getattr(enums, 'CmdType')(data.commandType) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_MergeAction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_matchKind); __Pyx_XDECREF(__pyx_v_v_commandType); __Pyx_XDECREF(__pyx_v_v_override); __Pyx_XDECREF(__pyx_v_v_qual); __Pyx_XDECREF(__pyx_v_v_targetList); __Pyx_XDECREF(__pyx_v_v_updateColnos); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2193 * * * cdef create_CoerceToDomain(structs.CoerceToDomain* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod */ static PyObject *__pyx_f_6pglast_6parser_create_CoerceToDomain(CoerceToDomain *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_arg = 0; PyObject *__pyx_v_v_resulttypmod = 0; PyObject *__pyx_v_v_coercionformat = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CoerceToDomain", 1); /* "pglast/ast.pyx":2194 * * cdef create_CoerceToDomain(structs.CoerceToDomain* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_resulttypmod = data.resulttypmod * cdef object v_coercionformat = getattr(enums, 'CoercionForm')(data.coercionformat) */ __pyx_t_2 = (__pyx_v_data->arg != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2195 * cdef create_CoerceToDomain(structs.CoerceToDomain* data, offset_to_index): * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod # <<<<<<<<<<<<<< * cdef object v_coercionformat = getattr(enums, 'CoercionForm')(data.coercionformat) * cdef object v_location = offset_to_index(data.location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->resulttypmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resulttypmod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2196 * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod * cdef object v_coercionformat = getattr(enums, 'CoercionForm')(data.coercionformat) # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CoerceToDomain(v_arg, v_resulttypmod, v_coercionformat, v_location) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_GetAttr(__pyx_t_3, __pyx_n_u_CoercionForm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_CoercionForm(__pyx_v_data->coercionformat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_coercionformat = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2197 * cdef object v_resulttypmod = data.resulttypmod * cdef object v_coercionformat = getattr(enums, 'CoercionForm')(data.coercionformat) * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CoerceToDomain(v_arg, v_resulttypmod, v_coercionformat, v_location) * */ __pyx_t_4 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2198 * cdef object v_coercionformat = getattr(enums, 'CoercionForm')(data.coercionformat) * cdef object v_location = offset_to_index(data.location) * return ast.CoerceToDomain(v_arg, v_resulttypmod, v_coercionformat, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CoerceToDomain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_v_arg, __pyx_v_v_resulttypmod, __pyx_v_v_coercionformat, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2193 * * * cdef create_CoerceToDomain(structs.CoerceToDomain* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_arg = create(data.arg, offset_to_index) if data.arg is not NULL else None * cdef object v_resulttypmod = data.resulttypmod */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_CoerceToDomain", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_arg); __Pyx_XDECREF(__pyx_v_v_resulttypmod); __Pyx_XDECREF(__pyx_v_v_coercionformat); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2201 * * * cdef create_CoerceToDomainValue(structs.CoerceToDomainValue* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_CoerceToDomainValue(CoerceToDomainValue *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeMod = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CoerceToDomainValue", 1); /* "pglast/ast.pyx":2202 * * cdef create_CoerceToDomainValue(structs.CoerceToDomainValue* data, offset_to_index): * cdef object v_typeMod = data.typeMod # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.CoerceToDomainValue(v_typeMod, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typeMod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typeMod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2203 * cdef create_CoerceToDomainValue(structs.CoerceToDomainValue* data, offset_to_index): * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.CoerceToDomainValue(v_typeMod, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2204 * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) * return ast.CoerceToDomainValue(v_typeMod, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CoerceToDomainValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_typeMod, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2201 * * * cdef create_CoerceToDomainValue(structs.CoerceToDomainValue* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_CoerceToDomainValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeMod); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2207 * * * cdef create_SetToDefault(structs.SetToDefault* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) */ static PyObject *__pyx_f_6pglast_6parser_create_SetToDefault(SetToDefault *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_typeMod = 0; PyObject *__pyx_v_v_location = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_SetToDefault", 1); /* "pglast/ast.pyx":2208 * * cdef create_SetToDefault(structs.SetToDefault* data, offset_to_index): * cdef object v_typeMod = data.typeMod # <<<<<<<<<<<<<< * cdef object v_location = offset_to_index(data.location) * return ast.SetToDefault(v_typeMod, v_location) */ __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_data->typeMod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_typeMod = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2209 * cdef create_SetToDefault(structs.SetToDefault* data, offset_to_index): * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) # <<<<<<<<<<<<<< * return ast.SetToDefault(v_typeMod, v_location) * */ __pyx_t_2 = __Pyx_PyInt_From_ParseLoc(__pyx_v_data->location); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_offset_to_index); __pyx_t_3 = __pyx_v_offset_to_index; __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2210 * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) * return ast.SetToDefault(v_typeMod, v_location) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SetToDefault); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_typeMod, __pyx_v_v_location}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2207 * * * cdef create_SetToDefault(structs.SetToDefault* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_typeMod = data.typeMod * cdef object v_location = offset_to_index(data.location) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_SetToDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_typeMod); __Pyx_XDECREF(__pyx_v_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2213 * * * cdef create_CurrentOfExpr(structs.CurrentOfExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_cvarno = data.cvarno * cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_CurrentOfExpr(CurrentOfExpr *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_cvarno = 0; PyObject *__pyx_v_v_cursor_name = 0; PyObject *__pyx_v_v_cursor_param = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char const *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_CurrentOfExpr", 1); /* "pglast/ast.pyx":2214 * * cdef create_CurrentOfExpr(structs.CurrentOfExpr* data, offset_to_index): * cdef object v_cvarno = data.cvarno # <<<<<<<<<<<<<< * cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None * cdef object v_cursor_param = data.cursor_param */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->cvarno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_cvarno = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2215 * cdef create_CurrentOfExpr(structs.CurrentOfExpr* data, offset_to_index): * cdef object v_cvarno = data.cvarno * cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None # <<<<<<<<<<<<<< * cdef object v_cursor_param = data.cursor_param * return ast.CurrentOfExpr(v_cvarno, v_cursor_name, v_cursor_param) */ __pyx_t_2 = (__pyx_v_data->cursor_name != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->cursor_name; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2215, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_cursor_name = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2216 * cdef object v_cvarno = data.cvarno * cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None * cdef object v_cursor_param = data.cursor_param # <<<<<<<<<<<<<< * return ast.CurrentOfExpr(v_cvarno, v_cursor_name, v_cursor_param) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->cursor_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_cursor_param = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2217 * cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None * cdef object v_cursor_param = data.cursor_param * return ast.CurrentOfExpr(v_cvarno, v_cursor_name, v_cursor_param) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_CurrentOfExpr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_v_cvarno, __pyx_v_v_cursor_name, __pyx_v_v_cursor_param}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2213 * * * cdef create_CurrentOfExpr(structs.CurrentOfExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_cvarno = data.cvarno * cdef object v_cursor_name = data.cursor_name.decode("utf-8") if data.cursor_name is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_CurrentOfExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_cvarno); __Pyx_XDECREF(__pyx_v_v_cursor_name); __Pyx_XDECREF(__pyx_v_v_cursor_param); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2220 * * * cdef create_InferenceElem(structs.InferenceElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * return ast.InferenceElem(v_expr) */ static PyObject *__pyx_f_6pglast_6parser_create_InferenceElem(InferenceElem *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_InferenceElem", 1); /* "pglast/ast.pyx":2221 * * cdef create_InferenceElem(structs.InferenceElem* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * return ast.InferenceElem(v_expr) * */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2222 * cdef create_InferenceElem(structs.InferenceElem* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * return ast.InferenceElem(v_expr) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InferenceElem); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_expr}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2220 * * * cdef create_InferenceElem(structs.InferenceElem* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * return ast.InferenceElem(v_expr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_InferenceElem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2225 * * * cdef create_TargetEntry(structs.TargetEntry* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_resno = data.resno */ static PyObject *__pyx_f_6pglast_6parser_create_TargetEntry(TargetEntry *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_expr = 0; PyObject *__pyx_v_v_resno = 0; PyObject *__pyx_v_v_resname = 0; PyObject *__pyx_v_v_ressortgroupref = 0; PyObject *__pyx_v_v_resorigcol = 0; PyObject *__pyx_v_v_resjunk = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char const *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_TargetEntry", 1); /* "pglast/ast.pyx":2226 * * cdef create_TargetEntry(structs.TargetEntry* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None # <<<<<<<<<<<<<< * cdef object v_resno = data.resno * cdef object v_resname = data.resname.decode("utf-8") if data.resname is not NULL else None */ __pyx_t_2 = (__pyx_v_data->expr != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->expr, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_expr = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2227 * cdef create_TargetEntry(structs.TargetEntry* data, offset_to_index): * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_resno = data.resno # <<<<<<<<<<<<<< * cdef object v_resname = data.resname.decode("utf-8") if data.resname is not NULL else None * cdef object v_ressortgroupref = data.ressortgroupref */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->resno); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resno = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2228 * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_resno = data.resno * cdef object v_resname = data.resname.decode("utf-8") if data.resname is not NULL else None # <<<<<<<<<<<<<< * cdef object v_ressortgroupref = data.ressortgroupref * cdef object v_resorigcol = data.resorigcol */ __pyx_t_2 = (__pyx_v_data->resname != NULL); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_data->resname; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2228, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_resname = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2229 * cdef object v_resno = data.resno * cdef object v_resname = data.resname.decode("utf-8") if data.resname is not NULL else None * cdef object v_ressortgroupref = data.ressortgroupref # <<<<<<<<<<<<<< * cdef object v_resorigcol = data.resorigcol * cdef object v_resjunk = bool(data.resjunk) */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_data->ressortgroupref); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_ressortgroupref = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2230 * cdef object v_resname = data.resname.decode("utf-8") if data.resname is not NULL else None * cdef object v_ressortgroupref = data.ressortgroupref * cdef object v_resorigcol = data.resorigcol # <<<<<<<<<<<<<< * cdef object v_resjunk = bool(data.resjunk) * return ast.TargetEntry(v_expr, v_resno, v_resname, v_ressortgroupref, v_resorigcol, v_resjunk) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->resorigcol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resorigcol = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2231 * cdef object v_ressortgroupref = data.ressortgroupref * cdef object v_resorigcol = data.resorigcol * cdef object v_resjunk = bool(data.resjunk) # <<<<<<<<<<<<<< * return ast.TargetEntry(v_expr, v_resno, v_resname, v_ressortgroupref, v_resorigcol, v_resjunk) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->resjunk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_resjunk = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2232 * cdef object v_resorigcol = data.resorigcol * cdef object v_resjunk = bool(data.resjunk) * return ast.TargetEntry(v_expr, v_resno, v_resname, v_ressortgroupref, v_resorigcol, v_resjunk) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TargetEntry); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[7] = {__pyx_t_3, __pyx_v_v_expr, __pyx_v_v_resno, __pyx_v_v_resname, __pyx_v_v_ressortgroupref, __pyx_v_v_resorigcol, __pyx_v_v_resjunk}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 6+__pyx_t_7); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2225 * * * cdef create_TargetEntry(structs.TargetEntry* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_expr = create(data.expr, offset_to_index) if data.expr is not NULL else None * cdef object v_resno = data.resno */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_TargetEntry", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_expr); __Pyx_XDECREF(__pyx_v_v_resno); __Pyx_XDECREF(__pyx_v_v_resname); __Pyx_XDECREF(__pyx_v_v_ressortgroupref); __Pyx_XDECREF(__pyx_v_v_resorigcol); __Pyx_XDECREF(__pyx_v_v_resjunk); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2235 * * * cdef create_RangeTblRef(structs.RangeTblRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rtindex = data.rtindex * return ast.RangeTblRef(v_rtindex) */ static PyObject *__pyx_f_6pglast_6parser_create_RangeTblRef(RangeTblRef *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_rtindex = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_RangeTblRef", 1); /* "pglast/ast.pyx":2236 * * cdef create_RangeTblRef(structs.RangeTblRef* data, offset_to_index): * cdef object v_rtindex = data.rtindex # <<<<<<<<<<<<<< * return ast.RangeTblRef(v_rtindex) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->rtindex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_rtindex = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2237 * cdef create_RangeTblRef(structs.RangeTblRef* data, offset_to_index): * cdef object v_rtindex = data.rtindex * return ast.RangeTblRef(v_rtindex) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_RangeTblRef); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v_rtindex}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2235 * * * cdef create_RangeTblRef(structs.RangeTblRef* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_rtindex = data.rtindex * return ast.RangeTblRef(v_rtindex) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_RangeTblRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_rtindex); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2240 * * * cdef create_JoinExpr(structs.JoinExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_isNatural = bool(data.isNatural) */ static PyObject *__pyx_f_6pglast_6parser_create_JoinExpr(JoinExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_jointype = 0; PyObject *__pyx_v_v_isNatural = 0; PyObject *__pyx_v_v_larg = 0; PyObject *__pyx_v_v_rarg = 0; PyObject *__pyx_v_v_usingClause = 0; PyObject *__pyx_v_v_join_using_alias = 0; PyObject *__pyx_v_v_quals = 0; PyObject *__pyx_v_v_alias = 0; PyObject *__pyx_v_v_rtindex = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_JoinExpr", 1); /* "pglast/ast.pyx":2241 * * cdef create_JoinExpr(structs.JoinExpr* data, offset_to_index): * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) # <<<<<<<<<<<<<< * cdef object v_isNatural = bool(data.isNatural) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_JoinType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_JoinType(__pyx_v_data->jointype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_jointype = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2242 * cdef create_JoinExpr(structs.JoinExpr* data, offset_to_index): * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_isNatural = bool(data.isNatural) # <<<<<<<<<<<<<< * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isNatural); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_6))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isNatural = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2243 * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_isNatural = bool(data.isNatural) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->larg != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->larg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_larg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2244 * cdef object v_isNatural = bool(data.isNatural) * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None */ __pyx_t_6 = (__pyx_v_data->rarg != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->rarg, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_rarg = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2245 * cdef object v_larg = create(data.larg, offset_to_index) if data.larg is not NULL else None * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->usingClause, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2245, __pyx_L1_error) __pyx_v_v_usingClause = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2246 * cdef object v_rarg = create(data.rarg, offset_to_index) if data.rarg is not NULL else None * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None # <<<<<<<<<<<<<< * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None */ __pyx_t_6 = (__pyx_v_data->join_using_alias != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->join_using_alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_join_using_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2247 * cdef tuple v_usingClause = _pg_list_to_tuple(data.usingClause, offset_to_index) * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None # <<<<<<<<<<<<<< * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_rtindex = data.rtindex */ __pyx_t_6 = (__pyx_v_data->quals != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->quals, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_quals = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2248 * cdef object v_join_using_alias = create(data.join_using_alias, offset_to_index) if data.join_using_alias is not NULL else None * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None # <<<<<<<<<<<<<< * cdef object v_rtindex = data.rtindex * return ast.JoinExpr(v_jointype, v_isNatural, v_larg, v_rarg, v_usingClause, v_join_using_alias, v_quals, v_alias, v_rtindex) */ __pyx_t_6 = (__pyx_v_data->alias != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->alias, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_alias = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2249 * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_rtindex = data.rtindex # <<<<<<<<<<<<<< * return ast.JoinExpr(v_jointype, v_isNatural, v_larg, v_rarg, v_usingClause, v_join_using_alias, v_quals, v_alias, v_rtindex) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->rtindex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_rtindex = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2250 * cdef object v_alias = create(data.alias, offset_to_index) if data.alias is not NULL else None * cdef object v_rtindex = data.rtindex * return ast.JoinExpr(v_jointype, v_isNatural, v_larg, v_rarg, v_usingClause, v_join_using_alias, v_quals, v_alias, v_rtindex) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_JoinExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[10] = {__pyx_t_3, __pyx_v_v_jointype, __pyx_v_v_isNatural, __pyx_v_v_larg, __pyx_v_v_rarg, __pyx_v_v_usingClause, __pyx_v_v_join_using_alias, __pyx_v_v_quals, __pyx_v_v_alias, __pyx_v_v_rtindex}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 9+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2240 * * * cdef create_JoinExpr(structs.JoinExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_jointype = getattr(enums, 'JoinType')(data.jointype) * cdef object v_isNatural = bool(data.isNatural) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_JoinExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_jointype); __Pyx_XDECREF(__pyx_v_v_isNatural); __Pyx_XDECREF(__pyx_v_v_larg); __Pyx_XDECREF(__pyx_v_v_rarg); __Pyx_XDECREF(__pyx_v_v_usingClause); __Pyx_XDECREF(__pyx_v_v_join_using_alias); __Pyx_XDECREF(__pyx_v_v_quals); __Pyx_XDECREF(__pyx_v_v_alias); __Pyx_XDECREF(__pyx_v_v_rtindex); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2253 * * * cdef create_FromExpr(structs.FromExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_fromlist = _pg_list_to_tuple(data.fromlist, offset_to_index) * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None */ static PyObject *__pyx_f_6pglast_6parser_create_FromExpr(FromExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_fromlist = 0; PyObject *__pyx_v_v_quals = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_FromExpr", 1); /* "pglast/ast.pyx":2254 * * cdef create_FromExpr(structs.FromExpr* data, offset_to_index): * cdef tuple v_fromlist = _pg_list_to_tuple(data.fromlist, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None * return ast.FromExpr(v_fromlist, v_quals) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->fromlist, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2254, __pyx_L1_error) __pyx_v_v_fromlist = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2255 * cdef create_FromExpr(structs.FromExpr* data, offset_to_index): * cdef tuple v_fromlist = _pg_list_to_tuple(data.fromlist, offset_to_index) * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None # <<<<<<<<<<<<<< * return ast.FromExpr(v_fromlist, v_quals) * */ __pyx_t_2 = (__pyx_v_data->quals != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->quals, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_quals = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2256 * cdef tuple v_fromlist = _pg_list_to_tuple(data.fromlist, offset_to_index) * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None * return ast.FromExpr(v_fromlist, v_quals) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_FromExpr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_v_fromlist, __pyx_v_v_quals}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2253 * * * cdef create_FromExpr(structs.FromExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef tuple v_fromlist = _pg_list_to_tuple(data.fromlist, offset_to_index) * cdef object v_quals = create(data.quals, offset_to_index) if data.quals is not NULL else None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_FromExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_fromlist); __Pyx_XDECREF(__pyx_v_v_quals); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2259 * * * cdef create_OnConflictExpr(structs.OnConflictExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) */ static PyObject *__pyx_f_6pglast_6parser_create_OnConflictExpr(OnConflictExpr *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_action = 0; PyObject *__pyx_v_v_arbiterElems = 0; PyObject *__pyx_v_v_arbiterWhere = 0; PyObject *__pyx_v_v_onConflictSet = 0; PyObject *__pyx_v_v_onConflictWhere = 0; PyObject *__pyx_v_v_exclRelIndex = 0; PyObject *__pyx_v_v_exclRelTlist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_OnConflictExpr", 1); /* "pglast/ast.pyx":2260 * * cdef create_OnConflictExpr(structs.OnConflictExpr* data, offset_to_index): * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) # <<<<<<<<<<<<<< * cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) * cdef object v_arbiterWhere = create(data.arbiterWhere, offset_to_index) if data.arbiterWhere is not NULL else None */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_GetAttr(__pyx_t_2, __pyx_n_u_OnConflictAction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_OnConflictAction(__pyx_v_data->action); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_action = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2261 * cdef create_OnConflictExpr(structs.OnConflictExpr* data, offset_to_index): * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_arbiterWhere = create(data.arbiterWhere, offset_to_index) if data.arbiterWhere is not NULL else None * cdef tuple v_onConflictSet = _pg_list_to_tuple(data.onConflictSet, offset_to_index) */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->arbiterElems, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2261, __pyx_L1_error) __pyx_v_v_arbiterElems = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2262 * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) * cdef object v_arbiterWhere = create(data.arbiterWhere, offset_to_index) if data.arbiterWhere is not NULL else None # <<<<<<<<<<<<<< * cdef tuple v_onConflictSet = _pg_list_to_tuple(data.onConflictSet, offset_to_index) * cdef object v_onConflictWhere = create(data.onConflictWhere, offset_to_index) if data.onConflictWhere is not NULL else None */ __pyx_t_6 = (__pyx_v_data->arbiterWhere != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->arbiterWhere, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_arbiterWhere = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2263 * cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) * cdef object v_arbiterWhere = create(data.arbiterWhere, offset_to_index) if data.arbiterWhere is not NULL else None * cdef tuple v_onConflictSet = _pg_list_to_tuple(data.onConflictSet, offset_to_index) # <<<<<<<<<<<<<< * cdef object v_onConflictWhere = create(data.onConflictWhere, offset_to_index) if data.onConflictWhere is not NULL else None * cdef object v_exclRelIndex = data.exclRelIndex */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->onConflictSet, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2263, __pyx_L1_error) __pyx_v_v_onConflictSet = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2264 * cdef object v_arbiterWhere = create(data.arbiterWhere, offset_to_index) if data.arbiterWhere is not NULL else None * cdef tuple v_onConflictSet = _pg_list_to_tuple(data.onConflictSet, offset_to_index) * cdef object v_onConflictWhere = create(data.onConflictWhere, offset_to_index) if data.onConflictWhere is not NULL else None # <<<<<<<<<<<<<< * cdef object v_exclRelIndex = data.exclRelIndex * cdef tuple v_exclRelTlist = _pg_list_to_tuple(data.exclRelTlist, offset_to_index) */ __pyx_t_6 = (__pyx_v_data->onConflictWhere != NULL); if (__pyx_t_6) { __pyx_t_3 = __pyx_f_6pglast_6parser_create(__pyx_v_data->onConflictWhere, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_onConflictWhere = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2265 * cdef tuple v_onConflictSet = _pg_list_to_tuple(data.onConflictSet, offset_to_index) * cdef object v_onConflictWhere = create(data.onConflictWhere, offset_to_index) if data.onConflictWhere is not NULL else None * cdef object v_exclRelIndex = data.exclRelIndex # <<<<<<<<<<<<<< * cdef tuple v_exclRelTlist = _pg_list_to_tuple(data.exclRelTlist, offset_to_index) * return ast.OnConflictExpr(v_action, v_arbiterElems, v_arbiterWhere, v_onConflictSet, v_onConflictWhere, v_exclRelIndex, v_exclRelTlist) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->exclRelIndex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_exclRelIndex = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2266 * cdef object v_onConflictWhere = create(data.onConflictWhere, offset_to_index) if data.onConflictWhere is not NULL else None * cdef object v_exclRelIndex = data.exclRelIndex * cdef tuple v_exclRelTlist = _pg_list_to_tuple(data.exclRelTlist, offset_to_index) # <<<<<<<<<<<<<< * return ast.OnConflictExpr(v_action, v_arbiterElems, v_arbiterWhere, v_onConflictSet, v_onConflictWhere, v_exclRelIndex, v_exclRelTlist) * */ __pyx_t_1 = __pyx_f_6pglast_6parser__pg_list_to_tuple(__pyx_v_data->exclRelTlist, __pyx_v_offset_to_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(0, 2266, __pyx_L1_error) __pyx_v_v_exclRelTlist = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/ast.pyx":2267 * cdef object v_exclRelIndex = data.exclRelIndex * cdef tuple v_exclRelTlist = _pg_list_to_tuple(data.exclRelTlist, offset_to_index) * return ast.OnConflictExpr(v_action, v_arbiterElems, v_arbiterWhere, v_onConflictSet, v_onConflictWhere, v_exclRelIndex, v_exclRelTlist) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OnConflictExpr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[8] = {__pyx_t_3, __pyx_v_v_action, __pyx_v_v_arbiterElems, __pyx_v_v_arbiterWhere, __pyx_v_v_onConflictSet, __pyx_v_v_onConflictWhere, __pyx_v_v_exclRelIndex, __pyx_v_v_exclRelTlist}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 7+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2259 * * * cdef create_OnConflictExpr(structs.OnConflictExpr* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_action = getattr(enums, 'OnConflictAction')(data.action) * cdef tuple v_arbiterElems = _pg_list_to_tuple(data.arbiterElems, offset_to_index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_OnConflictExpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_action); __Pyx_XDECREF(__pyx_v_v_arbiterElems); __Pyx_XDECREF(__pyx_v_v_arbiterWhere); __Pyx_XDECREF(__pyx_v_v_onConflictSet); __Pyx_XDECREF(__pyx_v_v_onConflictWhere); __Pyx_XDECREF(__pyx_v_v_exclRelIndex); __Pyx_XDECREF(__pyx_v_v_exclRelTlist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2270 * * * cdef create_Integer(structs.Integer* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_ival = data.ival * return ast.Integer(v_ival) */ static PyObject *__pyx_f_6pglast_6parser_create_Integer(Integer *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_ival = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Integer", 1); /* "pglast/ast.pyx":2271 * * cdef create_Integer(structs.Integer* data, offset_to_index): * cdef object v_ival = data.ival # <<<<<<<<<<<<<< * return ast.Integer(v_ival) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_data->ival); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_ival = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2272 * cdef create_Integer(structs.Integer* data, offset_to_index): * cdef object v_ival = data.ival * return ast.Integer(v_ival) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Integer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_4 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_v_ival}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2270 * * * cdef create_Integer(structs.Integer* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_ival = data.ival * return ast.Integer(v_ival) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create_Integer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_ival); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2275 * * * cdef create_Float(structs.Float* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_fval = data.fval.decode("utf-8") if data.fval is not NULL else None * return ast.Float(v_fval) */ static PyObject *__pyx_f_6pglast_6parser_create_Float(Float *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_fval = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Float", 1); /* "pglast/ast.pyx":2276 * * cdef create_Float(structs.Float* data, offset_to_index): * cdef object v_fval = data.fval.decode("utf-8") if data.fval is not NULL else None # <<<<<<<<<<<<<< * return ast.Float(v_fval) * */ __pyx_t_2 = (__pyx_v_data->fval != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->fval; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2276, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_fval = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2277 * cdef create_Float(structs.Float* data, offset_to_index): * cdef object v_fval = data.fval.decode("utf-8") if data.fval is not NULL else None * return ast.Float(v_fval) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Float); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_fval}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2275 * * * cdef create_Float(structs.Float* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_fval = data.fval.decode("utf-8") if data.fval is not NULL else None * return ast.Float(v_fval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_Float", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_fval); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2280 * * * cdef create_Boolean(structs.Boolean* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_boolval = bool(data.boolval) * return ast.Boolean(v_boolval) */ static PyObject *__pyx_f_6pglast_6parser_create_Boolean(Boolean *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_boolval = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_Boolean", 1); /* "pglast/ast.pyx":2281 * * cdef create_Boolean(structs.Boolean* data, offset_to_index): * cdef object v_boolval = bool(data.boolval) # <<<<<<<<<<<<<< * return ast.Boolean(v_boolval) * */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->boolval); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_boolval = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2282 * cdef create_Boolean(structs.Boolean* data, offset_to_index): * cdef object v_boolval = bool(data.boolval) * return ast.Boolean(v_boolval) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Boolean); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_v_boolval}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2280 * * * cdef create_Boolean(structs.Boolean* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_boolval = bool(data.boolval) * return ast.Boolean(v_boolval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.create_Boolean", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_boolval); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2285 * * * cdef create_String(structs.String* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sval = data.sval.decode("utf-8") if data.sval is not NULL else None * return ast.String(v_sval) */ static PyObject *__pyx_f_6pglast_6parser_create_String(String *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_sval = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_String", 1); /* "pglast/ast.pyx":2286 * * cdef create_String(structs.String* data, offset_to_index): * cdef object v_sval = data.sval.decode("utf-8") if data.sval is not NULL else None # <<<<<<<<<<<<<< * return ast.String(v_sval) * */ __pyx_t_2 = (__pyx_v_data->sval != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->sval; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2286, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_sval = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2287 * cdef create_String(structs.String* data, offset_to_index): * cdef object v_sval = data.sval.decode("utf-8") if data.sval is not NULL else None * return ast.String(v_sval) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_String); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_sval}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2285 * * * cdef create_String(structs.String* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_sval = data.sval.decode("utf-8") if data.sval is not NULL else None * return ast.String(v_sval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_String", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_sval); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2290 * * * cdef create_BitString(structs.BitString* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_bsval = data.bsval.decode("utf-8") if data.bsval is not NULL else None * return ast.BitString(v_bsval) */ static PyObject *__pyx_f_6pglast_6parser_create_BitString(BitString *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_bsval = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; char *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_BitString", 1); /* "pglast/ast.pyx":2291 * * cdef create_BitString(structs.BitString* data, offset_to_index): * cdef object v_bsval = data.bsval.decode("utf-8") if data.bsval is not NULL else None # <<<<<<<<<<<<<< * return ast.BitString(v_bsval) * */ __pyx_t_2 = (__pyx_v_data->bsval != NULL); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_data->bsval; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2291, __pyx_L1_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_v_bsval = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2292 * cdef create_BitString(structs.BitString* data, offset_to_index): * cdef object v_bsval = data.bsval.decode("utf-8") if data.bsval is not NULL else None * return ast.BitString(v_bsval) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ast); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_BitString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_v_bsval}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2290 * * * cdef create_BitString(structs.BitString* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_bsval = data.bsval.decode("utf-8") if data.bsval is not NULL else None * return ast.BitString(v_bsval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pglast.parser.create_BitString", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_bsval); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2295 * * * cdef create_A_Const(structs.A_Const* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_isnull = bool(data.isnull) * cdef object v_val */ static PyObject *__pyx_f_6pglast_6parser_create_A_Const(A_Const *__pyx_v_data, CYTHON_UNUSED PyObject *__pyx_v_offset_to_index) { PyObject *__pyx_v_v_isnull = 0; PyObject *__pyx_v_v_val = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; unsigned int __pyx_t_6; char *__pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_A_Const", 1); /* "pglast/ast.pyx":2296 * * cdef create_A_Const(structs.A_Const* data, offset_to_index): * cdef object v_isnull = bool(data.isnull) # <<<<<<<<<<<<<< * cdef object v_val * if data.isnull: */ __pyx_t_1 = __Pyx_PyInt_From_bool(__pyx_v_data->isnull); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2296, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_isnull = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2298 * cdef object v_isnull = bool(data.isnull) * cdef object v_val * if data.isnull: # <<<<<<<<<<<<<< * v_val = None * elif data.val.boolval.type == structs.T_Boolean: */ __pyx_t_2 = (__pyx_v_data->isnull != 0); if (__pyx_t_2) { /* "pglast/ast.pyx":2299 * cdef object v_val * if data.isnull: * v_val = None # <<<<<<<<<<<<<< * elif data.val.boolval.type == structs.T_Boolean: * v_val = ast.Boolean(data.val.boolval.boolval) */ __Pyx_INCREF(Py_None); __pyx_v_v_val = Py_None; /* "pglast/ast.pyx":2298 * cdef object v_isnull = bool(data.isnull) * cdef object v_val * if data.isnull: # <<<<<<<<<<<<<< * v_val = None * elif data.val.boolval.type == structs.T_Boolean: */ goto __pyx_L3; } /* "pglast/ast.pyx":2300 * if data.isnull: * v_val = None * elif data.val.boolval.type == structs.T_Boolean: # <<<<<<<<<<<<<< * v_val = ast.Boolean(data.val.boolval.boolval) * elif data.val.ival.type == structs.T_Integer: */ __pyx_t_2 = (__pyx_v_data->val.boolval.type == T_Boolean); if (__pyx_t_2) { /* "pglast/ast.pyx":2301 * v_val = None * elif data.val.boolval.type == structs.T_Boolean: * v_val = ast.Boolean(data.val.boolval.boolval) # <<<<<<<<<<<<<< * elif data.val.ival.type == structs.T_Integer: * v_val = ast.Integer(data.val.ival.ival) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Boolean); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_bool(__pyx_v_data->val.boolval.boolval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2300 * if data.isnull: * v_val = None * elif data.val.boolval.type == structs.T_Boolean: # <<<<<<<<<<<<<< * v_val = ast.Boolean(data.val.boolval.boolval) * elif data.val.ival.type == structs.T_Integer: */ goto __pyx_L3; } /* "pglast/ast.pyx":2302 * elif data.val.boolval.type == structs.T_Boolean: * v_val = ast.Boolean(data.val.boolval.boolval) * elif data.val.ival.type == structs.T_Integer: # <<<<<<<<<<<<<< * v_val = ast.Integer(data.val.ival.ival) * elif data.val.fval.type == structs.T_Float: */ __pyx_t_2 = (__pyx_v_data->val.ival.type == T_Integer); if (__pyx_t_2) { /* "pglast/ast.pyx":2303 * v_val = ast.Boolean(data.val.boolval.boolval) * elif data.val.ival.type == structs.T_Integer: * v_val = ast.Integer(data.val.ival.ival) # <<<<<<<<<<<<<< * elif data.val.fval.type == structs.T_Float: * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Integer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_data->val.ival.ival); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2302 * elif data.val.boolval.type == structs.T_Boolean: * v_val = ast.Boolean(data.val.boolval.boolval) * elif data.val.ival.type == structs.T_Integer: # <<<<<<<<<<<<<< * v_val = ast.Integer(data.val.ival.ival) * elif data.val.fval.type == structs.T_Float: */ goto __pyx_L3; } /* "pglast/ast.pyx":2304 * elif data.val.ival.type == structs.T_Integer: * v_val = ast.Integer(data.val.ival.ival) * elif data.val.fval.type == structs.T_Float: # <<<<<<<<<<<<<< * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) * elif data.val.bsval.type == structs.T_BitString: */ __pyx_t_2 = (__pyx_v_data->val.fval.type == T_Float); if (__pyx_t_2) { /* "pglast/ast.pyx":2305 * v_val = ast.Integer(data.val.ival.ival) * elif data.val.fval.type == structs.T_Float: * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) # <<<<<<<<<<<<<< * elif data.val.bsval.type == structs.T_BitString: * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Float); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_v_data->val.fval.fval; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2305, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2304 * elif data.val.ival.type == structs.T_Integer: * v_val = ast.Integer(data.val.ival.ival) * elif data.val.fval.type == structs.T_Float: # <<<<<<<<<<<<<< * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) * elif data.val.bsval.type == structs.T_BitString: */ goto __pyx_L3; } /* "pglast/ast.pyx":2306 * elif data.val.fval.type == structs.T_Float: * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) * elif data.val.bsval.type == structs.T_BitString: # <<<<<<<<<<<<<< * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) * elif data.val.sval.type == structs.T_String: */ __pyx_t_2 = (__pyx_v_data->val.bsval.type == T_BitString); if (__pyx_t_2) { /* "pglast/ast.pyx":2307 * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) * elif data.val.bsval.type == structs.T_BitString: * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) # <<<<<<<<<<<<<< * elif data.val.sval.type == structs.T_String: * v_val = ast.String(data.val.sval.sval.decode("utf-8")) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_BitString); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __pyx_v_data->val.bsval.bsval; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2307, __pyx_L1_error) __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2306 * elif data.val.fval.type == structs.T_Float: * v_val = ast.Float(data.val.fval.fval.decode("utf-8")) * elif data.val.bsval.type == structs.T_BitString: # <<<<<<<<<<<<<< * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) * elif data.val.sval.type == structs.T_String: */ goto __pyx_L3; } /* "pglast/ast.pyx":2308 * elif data.val.bsval.type == structs.T_BitString: * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) * elif data.val.sval.type == structs.T_String: # <<<<<<<<<<<<<< * v_val = ast.String(data.val.sval.sval.decode("utf-8")) * else: */ __pyx_t_2 = (__pyx_v_data->val.sval.type == T_String); if (__pyx_t_2) { /* "pglast/ast.pyx":2309 * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) * elif data.val.sval.type == structs.T_String: * v_val = ast.String(data.val.sval.sval.decode("utf-8")) # <<<<<<<<<<<<<< * else: * v_val = data.val.node */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_String); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_v_data->val.sval.sval; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2309, __pyx_L1_error) __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/ast.pyx":2308 * elif data.val.bsval.type == structs.T_BitString: * v_val = ast.BitString(data.val.bsval.bsval.decode("utf-8")) * elif data.val.sval.type == structs.T_String: # <<<<<<<<<<<<<< * v_val = ast.String(data.val.sval.sval.decode("utf-8")) * else: */ goto __pyx_L3; } /* "pglast/ast.pyx":2311 * v_val = ast.String(data.val.sval.sval.decode("utf-8")) * else: * v_val = data.val.node # <<<<<<<<<<<<<< * return ast.A_Const(v_isnull, v_val) * */ /*else*/ { __pyx_t_1 = __pyx_convert__to_py_Node(__pyx_v_data->val.node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v_val = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "pglast/ast.pyx":2312 * else: * v_val = data.val.node * return ast.A_Const(v_isnull, v_val) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_A_Const); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_v_isnull, __pyx_v_v_val}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2295 * * * cdef create_A_Const(structs.A_Const* data, offset_to_index): # <<<<<<<<<<<<<< * cdef object v_isnull = bool(data.isnull) * cdef object v_val */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pglast.parser.create_A_Const", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_v_isnull); __Pyx_XDECREF(__pyx_v_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/ast.pyx":2315 * * * cdef create(void* data, offset_to_index): # <<<<<<<<<<<<<< * if data is NULL: * return None */ static PyObject *__pyx_f_6pglast_6parser_create(void *__pyx_v_data, PyObject *__pyx_v_offset_to_index) { int __pyx_v_tag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 1); /* "pglast/ast.pyx":2316 * * cdef create(void* data, offset_to_index): * if data is NULL: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = (__pyx_v_data == NULL); if (__pyx_t_1) { /* "pglast/ast.pyx":2317 * cdef create(void* data, offset_to_index): * if data is NULL: * return None # <<<<<<<<<<<<<< * * cdef tuple t */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pglast/ast.pyx":2316 * * cdef create(void* data, offset_to_index): * if data is NULL: # <<<<<<<<<<<<<< * return None * */ } /* "pglast/ast.pyx":2322 * cdef int i * cdef str s * cdef int tag = structs.nodeTag(data) # <<<<<<<<<<<<<< * * if tag == structs.T_List: */ __pyx_v_tag = nodeTag(__pyx_v_data); /* "pglast/ast.pyx":2324 * cdef int tag = structs.nodeTag(data) * * if tag == structs.T_List: # <<<<<<<<<<<<<< * return _pg_list_to_tuple( data, offset_to_index) * elif tag == structs.T_Alias: */ switch (__pyx_v_tag) { case T_List: /* "pglast/ast.pyx":2325 * * if tag == structs.T_List: * return _pg_list_to_tuple( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Alias: * return create_Alias( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser__pg_list_to_tuple(((List *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2324 * cdef int tag = structs.nodeTag(data) * * if tag == structs.T_List: # <<<<<<<<<<<<<< * return _pg_list_to_tuple( data, offset_to_index) * elif tag == structs.T_Alias: */ break; case T_Alias: /* "pglast/ast.pyx":2327 * return _pg_list_to_tuple( data, offset_to_index) * elif tag == structs.T_Alias: * return create_Alias( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeVar: * return create_RangeVar( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Alias(((Alias *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2326 * if tag == structs.T_List: * return _pg_list_to_tuple( data, offset_to_index) * elif tag == structs.T_Alias: # <<<<<<<<<<<<<< * return create_Alias( data, offset_to_index) * elif tag == structs.T_RangeVar: */ break; case T_RangeVar: /* "pglast/ast.pyx":2329 * return create_Alias( data, offset_to_index) * elif tag == structs.T_RangeVar: * return create_RangeVar( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TableFunc: * return create_TableFunc( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeVar(((RangeVar *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2328 * elif tag == structs.T_Alias: * return create_Alias( data, offset_to_index) * elif tag == structs.T_RangeVar: # <<<<<<<<<<<<<< * return create_RangeVar( data, offset_to_index) * elif tag == structs.T_TableFunc: */ break; case T_TableFunc: /* "pglast/ast.pyx":2331 * return create_RangeVar( data, offset_to_index) * elif tag == structs.T_TableFunc: * return create_TableFunc( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_IntoClause: * return create_IntoClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TableFunc(((TableFunc *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2330 * elif tag == structs.T_RangeVar: * return create_RangeVar( data, offset_to_index) * elif tag == structs.T_TableFunc: # <<<<<<<<<<<<<< * return create_TableFunc( data, offset_to_index) * elif tag == structs.T_IntoClause: */ break; case T_IntoClause: /* "pglast/ast.pyx":2333 * return create_TableFunc( data, offset_to_index) * elif tag == structs.T_IntoClause: * return create_IntoClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Var: * return create_Var( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_IntoClause(((IntoClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2332 * elif tag == structs.T_TableFunc: * return create_TableFunc( data, offset_to_index) * elif tag == structs.T_IntoClause: # <<<<<<<<<<<<<< * return create_IntoClause( data, offset_to_index) * elif tag == structs.T_Var: */ break; case T_Var: /* "pglast/ast.pyx":2335 * return create_IntoClause( data, offset_to_index) * elif tag == structs.T_Var: * return create_Var( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Param: * return create_Param( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Var(((Var *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2334 * elif tag == structs.T_IntoClause: * return create_IntoClause( data, offset_to_index) * elif tag == structs.T_Var: # <<<<<<<<<<<<<< * return create_Var( data, offset_to_index) * elif tag == structs.T_Param: */ break; case T_Param: /* "pglast/ast.pyx":2337 * return create_Var( data, offset_to_index) * elif tag == structs.T_Param: * return create_Param( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Aggref: * return create_Aggref( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Param(((Param *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2336 * elif tag == structs.T_Var: * return create_Var( data, offset_to_index) * elif tag == structs.T_Param: # <<<<<<<<<<<<<< * return create_Param( data, offset_to_index) * elif tag == structs.T_Aggref: */ break; case T_Aggref: /* "pglast/ast.pyx":2339 * return create_Param( data, offset_to_index) * elif tag == structs.T_Aggref: * return create_Aggref( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_GroupingFunc: * return create_GroupingFunc( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Aggref(((Aggref *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2338 * elif tag == structs.T_Param: * return create_Param( data, offset_to_index) * elif tag == structs.T_Aggref: # <<<<<<<<<<<<<< * return create_Aggref( data, offset_to_index) * elif tag == structs.T_GroupingFunc: */ break; case T_GroupingFunc: /* "pglast/ast.pyx":2341 * return create_Aggref( data, offset_to_index) * elif tag == structs.T_GroupingFunc: * return create_GroupingFunc( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_WindowFunc: * return create_WindowFunc( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_GroupingFunc(((GroupingFunc *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2340 * elif tag == structs.T_Aggref: * return create_Aggref( data, offset_to_index) * elif tag == structs.T_GroupingFunc: # <<<<<<<<<<<<<< * return create_GroupingFunc( data, offset_to_index) * elif tag == structs.T_WindowFunc: */ break; case T_WindowFunc: /* "pglast/ast.pyx":2343 * return create_GroupingFunc( data, offset_to_index) * elif tag == structs.T_WindowFunc: * return create_WindowFunc( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_WindowFuncRunCondition: * return create_WindowFuncRunCondition( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_WindowFunc(((WindowFunc *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2342 * elif tag == structs.T_GroupingFunc: * return create_GroupingFunc( data, offset_to_index) * elif tag == structs.T_WindowFunc: # <<<<<<<<<<<<<< * return create_WindowFunc( data, offset_to_index) * elif tag == structs.T_WindowFuncRunCondition: */ break; case T_WindowFuncRunCondition: /* "pglast/ast.pyx":2345 * return create_WindowFunc( data, offset_to_index) * elif tag == structs.T_WindowFuncRunCondition: * return create_WindowFuncRunCondition( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_MergeSupportFunc: * return create_MergeSupportFunc( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_WindowFuncRunCondition(((WindowFuncRunCondition *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2344 * elif tag == structs.T_WindowFunc: * return create_WindowFunc( data, offset_to_index) * elif tag == structs.T_WindowFuncRunCondition: # <<<<<<<<<<<<<< * return create_WindowFuncRunCondition( data, offset_to_index) * elif tag == structs.T_MergeSupportFunc: */ break; case T_MergeSupportFunc: /* "pglast/ast.pyx":2347 * return create_WindowFuncRunCondition( data, offset_to_index) * elif tag == structs.T_MergeSupportFunc: * return create_MergeSupportFunc( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SubscriptingRef: * return create_SubscriptingRef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_MergeSupportFunc(((MergeSupportFunc *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2346 * elif tag == structs.T_WindowFuncRunCondition: * return create_WindowFuncRunCondition( data, offset_to_index) * elif tag == structs.T_MergeSupportFunc: # <<<<<<<<<<<<<< * return create_MergeSupportFunc( data, offset_to_index) * elif tag == structs.T_SubscriptingRef: */ break; case T_SubscriptingRef: /* "pglast/ast.pyx":2349 * return create_MergeSupportFunc( data, offset_to_index) * elif tag == structs.T_SubscriptingRef: * return create_SubscriptingRef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FuncExpr: * return create_FuncExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SubscriptingRef(((SubscriptingRef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2348 * elif tag == structs.T_MergeSupportFunc: * return create_MergeSupportFunc( data, offset_to_index) * elif tag == structs.T_SubscriptingRef: # <<<<<<<<<<<<<< * return create_SubscriptingRef( data, offset_to_index) * elif tag == structs.T_FuncExpr: */ break; case T_FuncExpr: /* "pglast/ast.pyx":2351 * return create_SubscriptingRef( data, offset_to_index) * elif tag == structs.T_FuncExpr: * return create_FuncExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_NamedArgExpr: * return create_NamedArgExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FuncExpr(((FuncExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2350 * elif tag == structs.T_SubscriptingRef: * return create_SubscriptingRef( data, offset_to_index) * elif tag == structs.T_FuncExpr: # <<<<<<<<<<<<<< * return create_FuncExpr( data, offset_to_index) * elif tag == structs.T_NamedArgExpr: */ break; case T_NamedArgExpr: /* "pglast/ast.pyx":2353 * return create_FuncExpr( data, offset_to_index) * elif tag == structs.T_NamedArgExpr: * return create_NamedArgExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_OpExpr: * return create_OpExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_NamedArgExpr(((NamedArgExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2352 * elif tag == structs.T_FuncExpr: * return create_FuncExpr( data, offset_to_index) * elif tag == structs.T_NamedArgExpr: # <<<<<<<<<<<<<< * return create_NamedArgExpr( data, offset_to_index) * elif tag == structs.T_OpExpr: */ break; case T_OpExpr: /* "pglast/ast.pyx":2355 * return create_NamedArgExpr( data, offset_to_index) * elif tag == structs.T_OpExpr: * return create_OpExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ScalarArrayOpExpr: * return create_ScalarArrayOpExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_OpExpr(((OpExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2354 * elif tag == structs.T_NamedArgExpr: * return create_NamedArgExpr( data, offset_to_index) * elif tag == structs.T_OpExpr: # <<<<<<<<<<<<<< * return create_OpExpr( data, offset_to_index) * elif tag == structs.T_ScalarArrayOpExpr: */ break; case T_ScalarArrayOpExpr: /* "pglast/ast.pyx":2357 * return create_OpExpr( data, offset_to_index) * elif tag == structs.T_ScalarArrayOpExpr: * return create_ScalarArrayOpExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_BoolExpr: * return create_BoolExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ScalarArrayOpExpr(((ScalarArrayOpExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2356 * elif tag == structs.T_OpExpr: * return create_OpExpr( data, offset_to_index) * elif tag == structs.T_ScalarArrayOpExpr: # <<<<<<<<<<<<<< * return create_ScalarArrayOpExpr( data, offset_to_index) * elif tag == structs.T_BoolExpr: */ break; case T_BoolExpr: /* "pglast/ast.pyx":2359 * return create_ScalarArrayOpExpr( data, offset_to_index) * elif tag == structs.T_BoolExpr: * return create_BoolExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SubLink: * return create_SubLink( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_BoolExpr(((BoolExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2358 * elif tag == structs.T_ScalarArrayOpExpr: * return create_ScalarArrayOpExpr( data, offset_to_index) * elif tag == structs.T_BoolExpr: # <<<<<<<<<<<<<< * return create_BoolExpr( data, offset_to_index) * elif tag == structs.T_SubLink: */ break; case T_SubLink: /* "pglast/ast.pyx":2361 * return create_BoolExpr( data, offset_to_index) * elif tag == structs.T_SubLink: * return create_SubLink( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SubPlan: * return create_SubPlan( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SubLink(((SubLink *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2360 * elif tag == structs.T_BoolExpr: * return create_BoolExpr( data, offset_to_index) * elif tag == structs.T_SubLink: # <<<<<<<<<<<<<< * return create_SubLink( data, offset_to_index) * elif tag == structs.T_SubPlan: */ break; case T_SubPlan: /* "pglast/ast.pyx":2363 * return create_SubLink( data, offset_to_index) * elif tag == structs.T_SubPlan: * return create_SubPlan( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlternativeSubPlan: * return create_AlternativeSubPlan( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SubPlan(((SubPlan *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2362 * elif tag == structs.T_SubLink: * return create_SubLink( data, offset_to_index) * elif tag == structs.T_SubPlan: # <<<<<<<<<<<<<< * return create_SubPlan( data, offset_to_index) * elif tag == structs.T_AlternativeSubPlan: */ break; case T_AlternativeSubPlan: /* "pglast/ast.pyx":2365 * return create_SubPlan( data, offset_to_index) * elif tag == structs.T_AlternativeSubPlan: * return create_AlternativeSubPlan( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FieldSelect: * return create_FieldSelect( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlternativeSubPlan(((AlternativeSubPlan *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2364 * elif tag == structs.T_SubPlan: * return create_SubPlan( data, offset_to_index) * elif tag == structs.T_AlternativeSubPlan: # <<<<<<<<<<<<<< * return create_AlternativeSubPlan( data, offset_to_index) * elif tag == structs.T_FieldSelect: */ break; case T_FieldSelect: /* "pglast/ast.pyx":2367 * return create_AlternativeSubPlan( data, offset_to_index) * elif tag == structs.T_FieldSelect: * return create_FieldSelect( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FieldStore: * return create_FieldStore( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FieldSelect(((FieldSelect *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2366 * elif tag == structs.T_AlternativeSubPlan: * return create_AlternativeSubPlan( data, offset_to_index) * elif tag == structs.T_FieldSelect: # <<<<<<<<<<<<<< * return create_FieldSelect( data, offset_to_index) * elif tag == structs.T_FieldStore: */ break; case T_FieldStore: /* "pglast/ast.pyx":2369 * return create_FieldSelect( data, offset_to_index) * elif tag == structs.T_FieldStore: * return create_FieldStore( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RelabelType: * return create_RelabelType( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FieldStore(((FieldStore *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2368 * elif tag == structs.T_FieldSelect: * return create_FieldSelect( data, offset_to_index) * elif tag == structs.T_FieldStore: # <<<<<<<<<<<<<< * return create_FieldStore( data, offset_to_index) * elif tag == structs.T_RelabelType: */ break; case T_RelabelType: /* "pglast/ast.pyx":2371 * return create_FieldStore( data, offset_to_index) * elif tag == structs.T_RelabelType: * return create_RelabelType( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CoerceViaIO: * return create_CoerceViaIO( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RelabelType(((RelabelType *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2370 * elif tag == structs.T_FieldStore: * return create_FieldStore( data, offset_to_index) * elif tag == structs.T_RelabelType: # <<<<<<<<<<<<<< * return create_RelabelType( data, offset_to_index) * elif tag == structs.T_CoerceViaIO: */ break; case T_CoerceViaIO: /* "pglast/ast.pyx":2373 * return create_RelabelType( data, offset_to_index) * elif tag == structs.T_CoerceViaIO: * return create_CoerceViaIO( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ArrayCoerceExpr: * return create_ArrayCoerceExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CoerceViaIO(((CoerceViaIO *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2372 * elif tag == structs.T_RelabelType: * return create_RelabelType( data, offset_to_index) * elif tag == structs.T_CoerceViaIO: # <<<<<<<<<<<<<< * return create_CoerceViaIO( data, offset_to_index) * elif tag == structs.T_ArrayCoerceExpr: */ break; case T_ArrayCoerceExpr: /* "pglast/ast.pyx":2375 * return create_CoerceViaIO( data, offset_to_index) * elif tag == structs.T_ArrayCoerceExpr: * return create_ArrayCoerceExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ConvertRowtypeExpr: * return create_ConvertRowtypeExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ArrayCoerceExpr(((ArrayCoerceExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2374 * elif tag == structs.T_CoerceViaIO: * return create_CoerceViaIO( data, offset_to_index) * elif tag == structs.T_ArrayCoerceExpr: # <<<<<<<<<<<<<< * return create_ArrayCoerceExpr( data, offset_to_index) * elif tag == structs.T_ConvertRowtypeExpr: */ break; case T_ConvertRowtypeExpr: /* "pglast/ast.pyx":2377 * return create_ArrayCoerceExpr( data, offset_to_index) * elif tag == structs.T_ConvertRowtypeExpr: * return create_ConvertRowtypeExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CollateExpr: * return create_CollateExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ConvertRowtypeExpr(((ConvertRowtypeExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2376 * elif tag == structs.T_ArrayCoerceExpr: * return create_ArrayCoerceExpr( data, offset_to_index) * elif tag == structs.T_ConvertRowtypeExpr: # <<<<<<<<<<<<<< * return create_ConvertRowtypeExpr( data, offset_to_index) * elif tag == structs.T_CollateExpr: */ break; case T_CollateExpr: /* "pglast/ast.pyx":2379 * return create_ConvertRowtypeExpr( data, offset_to_index) * elif tag == structs.T_CollateExpr: * return create_CollateExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CaseExpr: * return create_CaseExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CollateExpr(((CollateExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2378 * elif tag == structs.T_ConvertRowtypeExpr: * return create_ConvertRowtypeExpr( data, offset_to_index) * elif tag == structs.T_CollateExpr: # <<<<<<<<<<<<<< * return create_CollateExpr( data, offset_to_index) * elif tag == structs.T_CaseExpr: */ break; case T_CaseExpr: /* "pglast/ast.pyx":2381 * return create_CollateExpr( data, offset_to_index) * elif tag == structs.T_CaseExpr: * return create_CaseExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CaseWhen: * return create_CaseWhen( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CaseExpr(((CaseExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2380 * elif tag == structs.T_CollateExpr: * return create_CollateExpr( data, offset_to_index) * elif tag == structs.T_CaseExpr: # <<<<<<<<<<<<<< * return create_CaseExpr( data, offset_to_index) * elif tag == structs.T_CaseWhen: */ break; case T_CaseWhen: /* "pglast/ast.pyx":2383 * return create_CaseExpr( data, offset_to_index) * elif tag == structs.T_CaseWhen: * return create_CaseWhen( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CaseTestExpr: * return create_CaseTestExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CaseWhen(((CaseWhen *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2382 * elif tag == structs.T_CaseExpr: * return create_CaseExpr( data, offset_to_index) * elif tag == structs.T_CaseWhen: # <<<<<<<<<<<<<< * return create_CaseWhen( data, offset_to_index) * elif tag == structs.T_CaseTestExpr: */ break; case T_CaseTestExpr: /* "pglast/ast.pyx":2385 * return create_CaseWhen( data, offset_to_index) * elif tag == structs.T_CaseTestExpr: * return create_CaseTestExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ArrayExpr: * return create_ArrayExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CaseTestExpr(((CaseTestExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2384 * elif tag == structs.T_CaseWhen: * return create_CaseWhen( data, offset_to_index) * elif tag == structs.T_CaseTestExpr: # <<<<<<<<<<<<<< * return create_CaseTestExpr( data, offset_to_index) * elif tag == structs.T_ArrayExpr: */ break; case T_ArrayExpr: /* "pglast/ast.pyx":2387 * return create_CaseTestExpr( data, offset_to_index) * elif tag == structs.T_ArrayExpr: * return create_ArrayExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RowExpr: * return create_RowExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ArrayExpr(((ArrayExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2386 * elif tag == structs.T_CaseTestExpr: * return create_CaseTestExpr( data, offset_to_index) * elif tag == structs.T_ArrayExpr: # <<<<<<<<<<<<<< * return create_ArrayExpr( data, offset_to_index) * elif tag == structs.T_RowExpr: */ break; case T_RowExpr: /* "pglast/ast.pyx":2389 * return create_ArrayExpr( data, offset_to_index) * elif tag == structs.T_RowExpr: * return create_RowExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RowCompareExpr: * return create_RowCompareExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RowExpr(((RowExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2388 * elif tag == structs.T_ArrayExpr: * return create_ArrayExpr( data, offset_to_index) * elif tag == structs.T_RowExpr: # <<<<<<<<<<<<<< * return create_RowExpr( data, offset_to_index) * elif tag == structs.T_RowCompareExpr: */ break; case T_RowCompareExpr: /* "pglast/ast.pyx":2391 * return create_RowExpr( data, offset_to_index) * elif tag == structs.T_RowCompareExpr: * return create_RowCompareExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CoalesceExpr: * return create_CoalesceExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RowCompareExpr(((RowCompareExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2390 * elif tag == structs.T_RowExpr: * return create_RowExpr( data, offset_to_index) * elif tag == structs.T_RowCompareExpr: # <<<<<<<<<<<<<< * return create_RowCompareExpr( data, offset_to_index) * elif tag == structs.T_CoalesceExpr: */ break; case T_CoalesceExpr: /* "pglast/ast.pyx":2393 * return create_RowCompareExpr( data, offset_to_index) * elif tag == structs.T_CoalesceExpr: * return create_CoalesceExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_MinMaxExpr: * return create_MinMaxExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CoalesceExpr(((CoalesceExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2392 * elif tag == structs.T_RowCompareExpr: * return create_RowCompareExpr( data, offset_to_index) * elif tag == structs.T_CoalesceExpr: # <<<<<<<<<<<<<< * return create_CoalesceExpr( data, offset_to_index) * elif tag == structs.T_MinMaxExpr: */ break; case T_MinMaxExpr: /* "pglast/ast.pyx":2395 * return create_CoalesceExpr( data, offset_to_index) * elif tag == structs.T_MinMaxExpr: * return create_MinMaxExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SQLValueFunction: * return create_SQLValueFunction( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_MinMaxExpr(((MinMaxExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2394 * elif tag == structs.T_CoalesceExpr: * return create_CoalesceExpr( data, offset_to_index) * elif tag == structs.T_MinMaxExpr: # <<<<<<<<<<<<<< * return create_MinMaxExpr( data, offset_to_index) * elif tag == structs.T_SQLValueFunction: */ break; case T_SQLValueFunction: /* "pglast/ast.pyx":2397 * return create_MinMaxExpr( data, offset_to_index) * elif tag == structs.T_SQLValueFunction: * return create_SQLValueFunction( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_XmlExpr: * return create_XmlExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SQLValueFunction(((SQLValueFunction *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2396 * elif tag == structs.T_MinMaxExpr: * return create_MinMaxExpr( data, offset_to_index) * elif tag == structs.T_SQLValueFunction: # <<<<<<<<<<<<<< * return create_SQLValueFunction( data, offset_to_index) * elif tag == structs.T_XmlExpr: */ break; case T_XmlExpr: /* "pglast/ast.pyx":2399 * return create_SQLValueFunction( data, offset_to_index) * elif tag == structs.T_XmlExpr: * return create_XmlExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonFormat: * return create_JsonFormat( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_XmlExpr(((XmlExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2398 * elif tag == structs.T_SQLValueFunction: * return create_SQLValueFunction( data, offset_to_index) * elif tag == structs.T_XmlExpr: # <<<<<<<<<<<<<< * return create_XmlExpr( data, offset_to_index) * elif tag == structs.T_JsonFormat: */ break; case T_JsonFormat: /* "pglast/ast.pyx":2401 * return create_XmlExpr( data, offset_to_index) * elif tag == structs.T_JsonFormat: * return create_JsonFormat( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonReturning: * return create_JsonReturning( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonFormat(((JsonFormat *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2400 * elif tag == structs.T_XmlExpr: * return create_XmlExpr( data, offset_to_index) * elif tag == structs.T_JsonFormat: # <<<<<<<<<<<<<< * return create_JsonFormat( data, offset_to_index) * elif tag == structs.T_JsonReturning: */ break; case T_JsonReturning: /* "pglast/ast.pyx":2403 * return create_JsonFormat( data, offset_to_index) * elif tag == structs.T_JsonReturning: * return create_JsonReturning( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonValueExpr: * return create_JsonValueExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonReturning(((JsonReturning *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2402 * elif tag == structs.T_JsonFormat: * return create_JsonFormat( data, offset_to_index) * elif tag == structs.T_JsonReturning: # <<<<<<<<<<<<<< * return create_JsonReturning( data, offset_to_index) * elif tag == structs.T_JsonValueExpr: */ break; case T_JsonValueExpr: /* "pglast/ast.pyx":2405 * return create_JsonReturning( data, offset_to_index) * elif tag == structs.T_JsonValueExpr: * return create_JsonValueExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonConstructorExpr: * return create_JsonConstructorExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonValueExpr(((JsonValueExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2404 * elif tag == structs.T_JsonReturning: * return create_JsonReturning( data, offset_to_index) * elif tag == structs.T_JsonValueExpr: # <<<<<<<<<<<<<< * return create_JsonValueExpr( data, offset_to_index) * elif tag == structs.T_JsonConstructorExpr: */ break; case T_JsonConstructorExpr: /* "pglast/ast.pyx":2407 * return create_JsonValueExpr( data, offset_to_index) * elif tag == structs.T_JsonConstructorExpr: * return create_JsonConstructorExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonIsPredicate: * return create_JsonIsPredicate( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonConstructorExpr(((JsonConstructorExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2406 * elif tag == structs.T_JsonValueExpr: * return create_JsonValueExpr( data, offset_to_index) * elif tag == structs.T_JsonConstructorExpr: # <<<<<<<<<<<<<< * return create_JsonConstructorExpr( data, offset_to_index) * elif tag == structs.T_JsonIsPredicate: */ break; case T_JsonIsPredicate: /* "pglast/ast.pyx":2409 * return create_JsonConstructorExpr( data, offset_to_index) * elif tag == structs.T_JsonIsPredicate: * return create_JsonIsPredicate( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonBehavior: * return create_JsonBehavior( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonIsPredicate(((JsonIsPredicate *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2408 * elif tag == structs.T_JsonConstructorExpr: * return create_JsonConstructorExpr( data, offset_to_index) * elif tag == structs.T_JsonIsPredicate: # <<<<<<<<<<<<<< * return create_JsonIsPredicate( data, offset_to_index) * elif tag == structs.T_JsonBehavior: */ break; case T_JsonBehavior: /* "pglast/ast.pyx":2411 * return create_JsonIsPredicate( data, offset_to_index) * elif tag == structs.T_JsonBehavior: * return create_JsonBehavior( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonExpr: * return create_JsonExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonBehavior(((JsonBehavior *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2410 * elif tag == structs.T_JsonIsPredicate: * return create_JsonIsPredicate( data, offset_to_index) * elif tag == structs.T_JsonBehavior: # <<<<<<<<<<<<<< * return create_JsonBehavior( data, offset_to_index) * elif tag == structs.T_JsonExpr: */ break; case T_JsonExpr: /* "pglast/ast.pyx":2413 * return create_JsonBehavior( data, offset_to_index) * elif tag == structs.T_JsonExpr: * return create_JsonExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_NullTest: * return create_NullTest( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonExpr(((JsonExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2412 * elif tag == structs.T_JsonBehavior: * return create_JsonBehavior( data, offset_to_index) * elif tag == structs.T_JsonExpr: # <<<<<<<<<<<<<< * return create_JsonExpr( data, offset_to_index) * elif tag == structs.T_NullTest: */ break; case T_NullTest: /* "pglast/ast.pyx":2415 * return create_JsonExpr( data, offset_to_index) * elif tag == structs.T_NullTest: * return create_NullTest( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_BooleanTest: * return create_BooleanTest( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_NullTest(((NullTest *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2414 * elif tag == structs.T_JsonExpr: * return create_JsonExpr( data, offset_to_index) * elif tag == structs.T_NullTest: # <<<<<<<<<<<<<< * return create_NullTest( data, offset_to_index) * elif tag == structs.T_BooleanTest: */ break; case T_BooleanTest: /* "pglast/ast.pyx":2417 * return create_NullTest( data, offset_to_index) * elif tag == structs.T_BooleanTest: * return create_BooleanTest( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_MergeAction: * return create_MergeAction( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_BooleanTest(((BooleanTest *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2416 * elif tag == structs.T_NullTest: * return create_NullTest( data, offset_to_index) * elif tag == structs.T_BooleanTest: # <<<<<<<<<<<<<< * return create_BooleanTest( data, offset_to_index) * elif tag == structs.T_MergeAction: */ break; case T_MergeAction: /* "pglast/ast.pyx":2419 * return create_BooleanTest( data, offset_to_index) * elif tag == structs.T_MergeAction: * return create_MergeAction( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CoerceToDomain: * return create_CoerceToDomain( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_MergeAction(((MergeAction *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2418 * elif tag == structs.T_BooleanTest: * return create_BooleanTest( data, offset_to_index) * elif tag == structs.T_MergeAction: # <<<<<<<<<<<<<< * return create_MergeAction( data, offset_to_index) * elif tag == structs.T_CoerceToDomain: */ break; case T_CoerceToDomain: /* "pglast/ast.pyx":2421 * return create_MergeAction( data, offset_to_index) * elif tag == structs.T_CoerceToDomain: * return create_CoerceToDomain( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CoerceToDomainValue: * return create_CoerceToDomainValue( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CoerceToDomain(((CoerceToDomain *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2420 * elif tag == structs.T_MergeAction: * return create_MergeAction( data, offset_to_index) * elif tag == structs.T_CoerceToDomain: # <<<<<<<<<<<<<< * return create_CoerceToDomain( data, offset_to_index) * elif tag == structs.T_CoerceToDomainValue: */ break; case T_CoerceToDomainValue: /* "pglast/ast.pyx":2423 * return create_CoerceToDomain( data, offset_to_index) * elif tag == structs.T_CoerceToDomainValue: * return create_CoerceToDomainValue( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SetToDefault: * return create_SetToDefault( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CoerceToDomainValue(((CoerceToDomainValue *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2422 * elif tag == structs.T_CoerceToDomain: * return create_CoerceToDomain( data, offset_to_index) * elif tag == structs.T_CoerceToDomainValue: # <<<<<<<<<<<<<< * return create_CoerceToDomainValue( data, offset_to_index) * elif tag == structs.T_SetToDefault: */ break; case T_SetToDefault: /* "pglast/ast.pyx":2425 * return create_CoerceToDomainValue( data, offset_to_index) * elif tag == structs.T_SetToDefault: * return create_SetToDefault( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CurrentOfExpr: * return create_CurrentOfExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SetToDefault(((SetToDefault *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2424 * elif tag == structs.T_CoerceToDomainValue: * return create_CoerceToDomainValue( data, offset_to_index) * elif tag == structs.T_SetToDefault: # <<<<<<<<<<<<<< * return create_SetToDefault( data, offset_to_index) * elif tag == structs.T_CurrentOfExpr: */ break; case T_CurrentOfExpr: /* "pglast/ast.pyx":2427 * return create_SetToDefault( data, offset_to_index) * elif tag == structs.T_CurrentOfExpr: * return create_CurrentOfExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_InferenceElem: * return create_InferenceElem( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CurrentOfExpr(((CurrentOfExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2426 * elif tag == structs.T_SetToDefault: * return create_SetToDefault( data, offset_to_index) * elif tag == structs.T_CurrentOfExpr: # <<<<<<<<<<<<<< * return create_CurrentOfExpr( data, offset_to_index) * elif tag == structs.T_InferenceElem: */ break; case T_InferenceElem: /* "pglast/ast.pyx":2429 * return create_CurrentOfExpr( data, offset_to_index) * elif tag == structs.T_InferenceElem: * return create_InferenceElem( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TargetEntry: * return create_TargetEntry( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_InferenceElem(((InferenceElem *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2428 * elif tag == structs.T_CurrentOfExpr: * return create_CurrentOfExpr( data, offset_to_index) * elif tag == structs.T_InferenceElem: # <<<<<<<<<<<<<< * return create_InferenceElem( data, offset_to_index) * elif tag == structs.T_TargetEntry: */ break; case T_TargetEntry: /* "pglast/ast.pyx":2431 * return create_InferenceElem( data, offset_to_index) * elif tag == structs.T_TargetEntry: * return create_TargetEntry( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeTblRef: * return create_RangeTblRef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TargetEntry(((TargetEntry *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2430 * elif tag == structs.T_InferenceElem: * return create_InferenceElem( data, offset_to_index) * elif tag == structs.T_TargetEntry: # <<<<<<<<<<<<<< * return create_TargetEntry( data, offset_to_index) * elif tag == structs.T_RangeTblRef: */ break; case T_RangeTblRef: /* "pglast/ast.pyx":2433 * return create_TargetEntry( data, offset_to_index) * elif tag == structs.T_RangeTblRef: * return create_RangeTblRef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JoinExpr: * return create_JoinExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeTblRef(((RangeTblRef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2432 * elif tag == structs.T_TargetEntry: * return create_TargetEntry( data, offset_to_index) * elif tag == structs.T_RangeTblRef: # <<<<<<<<<<<<<< * return create_RangeTblRef( data, offset_to_index) * elif tag == structs.T_JoinExpr: */ break; case T_JoinExpr: /* "pglast/ast.pyx":2435 * return create_RangeTblRef( data, offset_to_index) * elif tag == structs.T_JoinExpr: * return create_JoinExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FromExpr: * return create_FromExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JoinExpr(((JoinExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2434 * elif tag == structs.T_RangeTblRef: * return create_RangeTblRef( data, offset_to_index) * elif tag == structs.T_JoinExpr: # <<<<<<<<<<<<<< * return create_JoinExpr( data, offset_to_index) * elif tag == structs.T_FromExpr: */ break; case T_FromExpr: /* "pglast/ast.pyx":2437 * return create_JoinExpr( data, offset_to_index) * elif tag == structs.T_FromExpr: * return create_FromExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_OnConflictExpr: * return create_OnConflictExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FromExpr(((FromExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2436 * elif tag == structs.T_JoinExpr: * return create_JoinExpr( data, offset_to_index) * elif tag == structs.T_FromExpr: # <<<<<<<<<<<<<< * return create_FromExpr( data, offset_to_index) * elif tag == structs.T_OnConflictExpr: */ break; case T_OnConflictExpr: /* "pglast/ast.pyx":2439 * return create_FromExpr( data, offset_to_index) * elif tag == structs.T_OnConflictExpr: * return create_OnConflictExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Query: * return create_Query( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_OnConflictExpr(((OnConflictExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2438 * elif tag == structs.T_FromExpr: * return create_FromExpr( data, offset_to_index) * elif tag == structs.T_OnConflictExpr: # <<<<<<<<<<<<<< * return create_OnConflictExpr( data, offset_to_index) * elif tag == structs.T_Query: */ break; case T_Query: /* "pglast/ast.pyx":2441 * return create_OnConflictExpr( data, offset_to_index) * elif tag == structs.T_Query: * return create_Query( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TypeName: * return create_TypeName( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Query(((Query *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2440 * elif tag == structs.T_OnConflictExpr: * return create_OnConflictExpr( data, offset_to_index) * elif tag == structs.T_Query: # <<<<<<<<<<<<<< * return create_Query( data, offset_to_index) * elif tag == structs.T_TypeName: */ break; case T_TypeName: /* "pglast/ast.pyx":2443 * return create_Query( data, offset_to_index) * elif tag == structs.T_TypeName: * return create_TypeName( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ColumnRef: * return create_ColumnRef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TypeName(((TypeName *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2442 * elif tag == structs.T_Query: * return create_Query( data, offset_to_index) * elif tag == structs.T_TypeName: # <<<<<<<<<<<<<< * return create_TypeName( data, offset_to_index) * elif tag == structs.T_ColumnRef: */ break; case T_ColumnRef: /* "pglast/ast.pyx":2445 * return create_TypeName( data, offset_to_index) * elif tag == structs.T_ColumnRef: * return create_ColumnRef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ParamRef: * return create_ParamRef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ColumnRef(((ColumnRef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2444 * elif tag == structs.T_TypeName: * return create_TypeName( data, offset_to_index) * elif tag == structs.T_ColumnRef: # <<<<<<<<<<<<<< * return create_ColumnRef( data, offset_to_index) * elif tag == structs.T_ParamRef: */ break; case T_ParamRef: /* "pglast/ast.pyx":2447 * return create_ColumnRef( data, offset_to_index) * elif tag == structs.T_ParamRef: * return create_ParamRef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_A_Expr: * return create_A_Expr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ParamRef(((ParamRef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2446 * elif tag == structs.T_ColumnRef: * return create_ColumnRef( data, offset_to_index) * elif tag == structs.T_ParamRef: # <<<<<<<<<<<<<< * return create_ParamRef( data, offset_to_index) * elif tag == structs.T_A_Expr: */ break; case T_A_Expr: /* "pglast/ast.pyx":2449 * return create_ParamRef( data, offset_to_index) * elif tag == structs.T_A_Expr: * return create_A_Expr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_A_Const: * return create_A_Const( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_A_Expr(((A_Expr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2448 * elif tag == structs.T_ParamRef: * return create_ParamRef( data, offset_to_index) * elif tag == structs.T_A_Expr: # <<<<<<<<<<<<<< * return create_A_Expr( data, offset_to_index) * elif tag == structs.T_A_Const: */ break; case T_A_Const: /* "pglast/ast.pyx":2451 * return create_A_Expr( data, offset_to_index) * elif tag == structs.T_A_Const: * return create_A_Const( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TypeCast: * return create_TypeCast( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_A_Const(((A_Const *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2450 * elif tag == structs.T_A_Expr: * return create_A_Expr( data, offset_to_index) * elif tag == structs.T_A_Const: # <<<<<<<<<<<<<< * return create_A_Const( data, offset_to_index) * elif tag == structs.T_TypeCast: */ break; case T_TypeCast: /* "pglast/ast.pyx":2453 * return create_A_Const( data, offset_to_index) * elif tag == structs.T_TypeCast: * return create_TypeCast( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CollateClause: * return create_CollateClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TypeCast(((TypeCast *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2452 * elif tag == structs.T_A_Const: * return create_A_Const( data, offset_to_index) * elif tag == structs.T_TypeCast: # <<<<<<<<<<<<<< * return create_TypeCast( data, offset_to_index) * elif tag == structs.T_CollateClause: */ break; case T_CollateClause: /* "pglast/ast.pyx":2455 * return create_TypeCast( data, offset_to_index) * elif tag == structs.T_CollateClause: * return create_CollateClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RoleSpec: * return create_RoleSpec( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CollateClause(((CollateClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2454 * elif tag == structs.T_TypeCast: * return create_TypeCast( data, offset_to_index) * elif tag == structs.T_CollateClause: # <<<<<<<<<<<<<< * return create_CollateClause( data, offset_to_index) * elif tag == structs.T_RoleSpec: */ break; case T_RoleSpec: /* "pglast/ast.pyx":2457 * return create_CollateClause( data, offset_to_index) * elif tag == structs.T_RoleSpec: * return create_RoleSpec( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FuncCall: * return create_FuncCall( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RoleSpec(((RoleSpec *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2456 * elif tag == structs.T_CollateClause: * return create_CollateClause( data, offset_to_index) * elif tag == structs.T_RoleSpec: # <<<<<<<<<<<<<< * return create_RoleSpec( data, offset_to_index) * elif tag == structs.T_FuncCall: */ break; case T_FuncCall: /* "pglast/ast.pyx":2459 * return create_RoleSpec( data, offset_to_index) * elif tag == structs.T_FuncCall: * return create_FuncCall( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_A_Star: * return create_A_Star( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FuncCall(((FuncCall *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2458 * elif tag == structs.T_RoleSpec: * return create_RoleSpec( data, offset_to_index) * elif tag == structs.T_FuncCall: # <<<<<<<<<<<<<< * return create_FuncCall( data, offset_to_index) * elif tag == structs.T_A_Star: */ break; case T_A_Star: /* "pglast/ast.pyx":2461 * return create_FuncCall( data, offset_to_index) * elif tag == structs.T_A_Star: * return create_A_Star( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_A_Indices: * return create_A_Indices( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_A_Star(((A_Star *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2460 * elif tag == structs.T_FuncCall: * return create_FuncCall( data, offset_to_index) * elif tag == structs.T_A_Star: # <<<<<<<<<<<<<< * return create_A_Star( data, offset_to_index) * elif tag == structs.T_A_Indices: */ break; case T_A_Indices: /* "pglast/ast.pyx":2463 * return create_A_Star( data, offset_to_index) * elif tag == structs.T_A_Indices: * return create_A_Indices( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_A_Indirection: * return create_A_Indirection( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_A_Indices(((A_Indices *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2462 * elif tag == structs.T_A_Star: * return create_A_Star( data, offset_to_index) * elif tag == structs.T_A_Indices: # <<<<<<<<<<<<<< * return create_A_Indices( data, offset_to_index) * elif tag == structs.T_A_Indirection: */ break; case T_A_Indirection: /* "pglast/ast.pyx":2465 * return create_A_Indices( data, offset_to_index) * elif tag == structs.T_A_Indirection: * return create_A_Indirection( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_A_ArrayExpr: * return create_A_ArrayExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_A_Indirection(((A_Indirection *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2464 * elif tag == structs.T_A_Indices: * return create_A_Indices( data, offset_to_index) * elif tag == structs.T_A_Indirection: # <<<<<<<<<<<<<< * return create_A_Indirection( data, offset_to_index) * elif tag == structs.T_A_ArrayExpr: */ break; case T_A_ArrayExpr: /* "pglast/ast.pyx":2467 * return create_A_Indirection( data, offset_to_index) * elif tag == structs.T_A_ArrayExpr: * return create_A_ArrayExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ResTarget: * return create_ResTarget( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_A_ArrayExpr(((A_ArrayExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2466 * elif tag == structs.T_A_Indirection: * return create_A_Indirection( data, offset_to_index) * elif tag == structs.T_A_ArrayExpr: # <<<<<<<<<<<<<< * return create_A_ArrayExpr( data, offset_to_index) * elif tag == structs.T_ResTarget: */ break; case T_ResTarget: /* "pglast/ast.pyx":2469 * return create_A_ArrayExpr( data, offset_to_index) * elif tag == structs.T_ResTarget: * return create_ResTarget( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_MultiAssignRef: * return create_MultiAssignRef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ResTarget(((ResTarget *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2468 * elif tag == structs.T_A_ArrayExpr: * return create_A_ArrayExpr( data, offset_to_index) * elif tag == structs.T_ResTarget: # <<<<<<<<<<<<<< * return create_ResTarget( data, offset_to_index) * elif tag == structs.T_MultiAssignRef: */ break; case T_MultiAssignRef: /* "pglast/ast.pyx":2471 * return create_ResTarget( data, offset_to_index) * elif tag == structs.T_MultiAssignRef: * return create_MultiAssignRef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SortBy: * return create_SortBy( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_MultiAssignRef(((MultiAssignRef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2470 * elif tag == structs.T_ResTarget: * return create_ResTarget( data, offset_to_index) * elif tag == structs.T_MultiAssignRef: # <<<<<<<<<<<<<< * return create_MultiAssignRef( data, offset_to_index) * elif tag == structs.T_SortBy: */ break; case T_SortBy: /* "pglast/ast.pyx":2473 * return create_MultiAssignRef( data, offset_to_index) * elif tag == structs.T_SortBy: * return create_SortBy( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_WindowDef: * return create_WindowDef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SortBy(((SortBy *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2472 * elif tag == structs.T_MultiAssignRef: * return create_MultiAssignRef( data, offset_to_index) * elif tag == structs.T_SortBy: # <<<<<<<<<<<<<< * return create_SortBy( data, offset_to_index) * elif tag == structs.T_WindowDef: */ break; case T_WindowDef: /* "pglast/ast.pyx":2475 * return create_SortBy( data, offset_to_index) * elif tag == structs.T_WindowDef: * return create_WindowDef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeSubselect: * return create_RangeSubselect( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_WindowDef(((WindowDef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2474 * elif tag == structs.T_SortBy: * return create_SortBy( data, offset_to_index) * elif tag == structs.T_WindowDef: # <<<<<<<<<<<<<< * return create_WindowDef( data, offset_to_index) * elif tag == structs.T_RangeSubselect: */ break; case T_RangeSubselect: /* "pglast/ast.pyx":2477 * return create_WindowDef( data, offset_to_index) * elif tag == structs.T_RangeSubselect: * return create_RangeSubselect( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeFunction: * return create_RangeFunction( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeSubselect(((RangeSubselect *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2476 * elif tag == structs.T_WindowDef: * return create_WindowDef( data, offset_to_index) * elif tag == structs.T_RangeSubselect: # <<<<<<<<<<<<<< * return create_RangeSubselect( data, offset_to_index) * elif tag == structs.T_RangeFunction: */ break; case T_RangeFunction: /* "pglast/ast.pyx":2479 * return create_RangeSubselect( data, offset_to_index) * elif tag == structs.T_RangeFunction: * return create_RangeFunction( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeTableFunc: * return create_RangeTableFunc( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeFunction(((RangeFunction *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2478 * elif tag == structs.T_RangeSubselect: * return create_RangeSubselect( data, offset_to_index) * elif tag == structs.T_RangeFunction: # <<<<<<<<<<<<<< * return create_RangeFunction( data, offset_to_index) * elif tag == structs.T_RangeTableFunc: */ break; case T_RangeTableFunc: /* "pglast/ast.pyx":2481 * return create_RangeFunction( data, offset_to_index) * elif tag == structs.T_RangeTableFunc: * return create_RangeTableFunc( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeTableFuncCol: * return create_RangeTableFuncCol( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeTableFunc(((RangeTableFunc *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2480 * elif tag == structs.T_RangeFunction: * return create_RangeFunction( data, offset_to_index) * elif tag == structs.T_RangeTableFunc: # <<<<<<<<<<<<<< * return create_RangeTableFunc( data, offset_to_index) * elif tag == structs.T_RangeTableFuncCol: */ break; case T_RangeTableFuncCol: /* "pglast/ast.pyx":2483 * return create_RangeTableFunc( data, offset_to_index) * elif tag == structs.T_RangeTableFuncCol: * return create_RangeTableFuncCol( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeTableSample: * return create_RangeTableSample( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeTableFuncCol(((RangeTableFuncCol *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2482 * elif tag == structs.T_RangeTableFunc: * return create_RangeTableFunc( data, offset_to_index) * elif tag == structs.T_RangeTableFuncCol: # <<<<<<<<<<<<<< * return create_RangeTableFuncCol( data, offset_to_index) * elif tag == structs.T_RangeTableSample: */ break; case T_RangeTableSample: /* "pglast/ast.pyx":2485 * return create_RangeTableFuncCol( data, offset_to_index) * elif tag == structs.T_RangeTableSample: * return create_RangeTableSample( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ColumnDef: * return create_ColumnDef( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeTableSample(((RangeTableSample *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2484 * elif tag == structs.T_RangeTableFuncCol: * return create_RangeTableFuncCol( data, offset_to_index) * elif tag == structs.T_RangeTableSample: # <<<<<<<<<<<<<< * return create_RangeTableSample( data, offset_to_index) * elif tag == structs.T_ColumnDef: */ break; case T_ColumnDef: /* "pglast/ast.pyx":2487 * return create_RangeTableSample( data, offset_to_index) * elif tag == structs.T_ColumnDef: * return create_ColumnDef( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TableLikeClause: * return create_TableLikeClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ColumnDef(((ColumnDef *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2486 * elif tag == structs.T_RangeTableSample: * return create_RangeTableSample( data, offset_to_index) * elif tag == structs.T_ColumnDef: # <<<<<<<<<<<<<< * return create_ColumnDef( data, offset_to_index) * elif tag == structs.T_TableLikeClause: */ break; case T_TableLikeClause: /* "pglast/ast.pyx":2489 * return create_ColumnDef( data, offset_to_index) * elif tag == structs.T_TableLikeClause: * return create_TableLikeClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_IndexElem: * return create_IndexElem( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TableLikeClause(((TableLikeClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2488 * elif tag == structs.T_ColumnDef: * return create_ColumnDef( data, offset_to_index) * elif tag == structs.T_TableLikeClause: # <<<<<<<<<<<<<< * return create_TableLikeClause( data, offset_to_index) * elif tag == structs.T_IndexElem: */ break; case T_IndexElem: /* "pglast/ast.pyx":2491 * return create_TableLikeClause( data, offset_to_index) * elif tag == structs.T_IndexElem: * return create_IndexElem( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DefElem: * return create_DefElem( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_IndexElem(((IndexElem *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2490 * elif tag == structs.T_TableLikeClause: * return create_TableLikeClause( data, offset_to_index) * elif tag == structs.T_IndexElem: # <<<<<<<<<<<<<< * return create_IndexElem( data, offset_to_index) * elif tag == structs.T_DefElem: */ break; case T_DefElem: /* "pglast/ast.pyx":2493 * return create_IndexElem( data, offset_to_index) * elif tag == structs.T_DefElem: * return create_DefElem( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_LockingClause: * return create_LockingClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DefElem(((DefElem *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2492 * elif tag == structs.T_IndexElem: * return create_IndexElem( data, offset_to_index) * elif tag == structs.T_DefElem: # <<<<<<<<<<<<<< * return create_DefElem( data, offset_to_index) * elif tag == structs.T_LockingClause: */ break; case T_LockingClause: /* "pglast/ast.pyx":2495 * return create_DefElem( data, offset_to_index) * elif tag == structs.T_LockingClause: * return create_LockingClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_XmlSerialize: * return create_XmlSerialize( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_LockingClause(((LockingClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2494 * elif tag == structs.T_DefElem: * return create_DefElem( data, offset_to_index) * elif tag == structs.T_LockingClause: # <<<<<<<<<<<<<< * return create_LockingClause( data, offset_to_index) * elif tag == structs.T_XmlSerialize: */ break; case T_XmlSerialize: /* "pglast/ast.pyx":2497 * return create_LockingClause( data, offset_to_index) * elif tag == structs.T_XmlSerialize: * return create_XmlSerialize( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PartitionElem: * return create_PartitionElem( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_XmlSerialize(((XmlSerialize *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2496 * elif tag == structs.T_LockingClause: * return create_LockingClause( data, offset_to_index) * elif tag == structs.T_XmlSerialize: # <<<<<<<<<<<<<< * return create_XmlSerialize( data, offset_to_index) * elif tag == structs.T_PartitionElem: */ break; case T_PartitionElem: /* "pglast/ast.pyx":2499 * return create_XmlSerialize( data, offset_to_index) * elif tag == structs.T_PartitionElem: * return create_PartitionElem( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PartitionSpec: * return create_PartitionSpec( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PartitionElem(((PartitionElem *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2498 * elif tag == structs.T_XmlSerialize: * return create_XmlSerialize( data, offset_to_index) * elif tag == structs.T_PartitionElem: # <<<<<<<<<<<<<< * return create_PartitionElem( data, offset_to_index) * elif tag == structs.T_PartitionSpec: */ break; case T_PartitionSpec: /* "pglast/ast.pyx":2501 * return create_PartitionElem( data, offset_to_index) * elif tag == structs.T_PartitionSpec: * return create_PartitionSpec( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PartitionBoundSpec: * return create_PartitionBoundSpec( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PartitionSpec(((PartitionSpec *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2500 * elif tag == structs.T_PartitionElem: * return create_PartitionElem( data, offset_to_index) * elif tag == structs.T_PartitionSpec: # <<<<<<<<<<<<<< * return create_PartitionSpec( data, offset_to_index) * elif tag == structs.T_PartitionBoundSpec: */ break; case T_PartitionBoundSpec: /* "pglast/ast.pyx":2503 * return create_PartitionSpec( data, offset_to_index) * elif tag == structs.T_PartitionBoundSpec: * return create_PartitionBoundSpec( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PartitionRangeDatum: * return create_PartitionRangeDatum( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PartitionBoundSpec(((PartitionBoundSpec *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2502 * elif tag == structs.T_PartitionSpec: * return create_PartitionSpec( data, offset_to_index) * elif tag == structs.T_PartitionBoundSpec: # <<<<<<<<<<<<<< * return create_PartitionBoundSpec( data, offset_to_index) * elif tag == structs.T_PartitionRangeDatum: */ break; case T_PartitionRangeDatum: /* "pglast/ast.pyx":2505 * return create_PartitionBoundSpec( data, offset_to_index) * elif tag == structs.T_PartitionRangeDatum: * return create_PartitionRangeDatum( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SinglePartitionSpec: * return create_SinglePartitionSpec( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PartitionRangeDatum(((PartitionRangeDatum *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2504 * elif tag == structs.T_PartitionBoundSpec: * return create_PartitionBoundSpec( data, offset_to_index) * elif tag == structs.T_PartitionRangeDatum: # <<<<<<<<<<<<<< * return create_PartitionRangeDatum( data, offset_to_index) * elif tag == structs.T_SinglePartitionSpec: */ break; case T_SinglePartitionSpec: /* "pglast/ast.pyx":2507 * return create_PartitionRangeDatum( data, offset_to_index) * elif tag == structs.T_SinglePartitionSpec: * return create_SinglePartitionSpec( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PartitionCmd: * return create_PartitionCmd( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SinglePartitionSpec(((SinglePartitionSpec *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2506 * elif tag == structs.T_PartitionRangeDatum: * return create_PartitionRangeDatum( data, offset_to_index) * elif tag == structs.T_SinglePartitionSpec: # <<<<<<<<<<<<<< * return create_SinglePartitionSpec( data, offset_to_index) * elif tag == structs.T_PartitionCmd: */ break; case T_PartitionCmd: /* "pglast/ast.pyx":2509 * return create_SinglePartitionSpec( data, offset_to_index) * elif tag == structs.T_PartitionCmd: * return create_PartitionCmd( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeTblEntry: * return create_RangeTblEntry( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PartitionCmd(((PartitionCmd *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2508 * elif tag == structs.T_SinglePartitionSpec: * return create_SinglePartitionSpec( data, offset_to_index) * elif tag == structs.T_PartitionCmd: # <<<<<<<<<<<<<< * return create_PartitionCmd( data, offset_to_index) * elif tag == structs.T_RangeTblEntry: */ break; case T_RangeTblEntry: /* "pglast/ast.pyx":2511 * return create_PartitionCmd( data, offset_to_index) * elif tag == structs.T_RangeTblEntry: * return create_RangeTblEntry( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RTEPermissionInfo: * return create_RTEPermissionInfo( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeTblEntry(((RangeTblEntry *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2510 * elif tag == structs.T_PartitionCmd: * return create_PartitionCmd( data, offset_to_index) * elif tag == structs.T_RangeTblEntry: # <<<<<<<<<<<<<< * return create_RangeTblEntry( data, offset_to_index) * elif tag == structs.T_RTEPermissionInfo: */ break; case T_RTEPermissionInfo: /* "pglast/ast.pyx":2513 * return create_RangeTblEntry( data, offset_to_index) * elif tag == structs.T_RTEPermissionInfo: * return create_RTEPermissionInfo( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RangeTblFunction: * return create_RangeTblFunction( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RTEPermissionInfo(((RTEPermissionInfo *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2512 * elif tag == structs.T_RangeTblEntry: * return create_RangeTblEntry( data, offset_to_index) * elif tag == structs.T_RTEPermissionInfo: # <<<<<<<<<<<<<< * return create_RTEPermissionInfo( data, offset_to_index) * elif tag == structs.T_RangeTblFunction: */ break; case T_RangeTblFunction: /* "pglast/ast.pyx":2515 * return create_RTEPermissionInfo( data, offset_to_index) * elif tag == structs.T_RangeTblFunction: * return create_RangeTblFunction( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TableSampleClause: * return create_TableSampleClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RangeTblFunction(((RangeTblFunction *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2514 * elif tag == structs.T_RTEPermissionInfo: * return create_RTEPermissionInfo( data, offset_to_index) * elif tag == structs.T_RangeTblFunction: # <<<<<<<<<<<<<< * return create_RangeTblFunction( data, offset_to_index) * elif tag == structs.T_TableSampleClause: */ break; case T_TableSampleClause: /* "pglast/ast.pyx":2517 * return create_RangeTblFunction( data, offset_to_index) * elif tag == structs.T_TableSampleClause: * return create_TableSampleClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_WithCheckOption: * return create_WithCheckOption( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TableSampleClause(((TableSampleClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2516 * elif tag == structs.T_RangeTblFunction: * return create_RangeTblFunction( data, offset_to_index) * elif tag == structs.T_TableSampleClause: # <<<<<<<<<<<<<< * return create_TableSampleClause( data, offset_to_index) * elif tag == structs.T_WithCheckOption: */ break; case T_WithCheckOption: /* "pglast/ast.pyx":2519 * return create_TableSampleClause( data, offset_to_index) * elif tag == structs.T_WithCheckOption: * return create_WithCheckOption( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SortGroupClause: * return create_SortGroupClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_WithCheckOption(((WithCheckOption *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2518 * elif tag == structs.T_TableSampleClause: * return create_TableSampleClause( data, offset_to_index) * elif tag == structs.T_WithCheckOption: # <<<<<<<<<<<<<< * return create_WithCheckOption( data, offset_to_index) * elif tag == structs.T_SortGroupClause: */ break; case T_SortGroupClause: /* "pglast/ast.pyx":2521 * return create_WithCheckOption( data, offset_to_index) * elif tag == structs.T_SortGroupClause: * return create_SortGroupClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_GroupingSet: * return create_GroupingSet( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SortGroupClause(((SortGroupClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2520 * elif tag == structs.T_WithCheckOption: * return create_WithCheckOption( data, offset_to_index) * elif tag == structs.T_SortGroupClause: # <<<<<<<<<<<<<< * return create_SortGroupClause( data, offset_to_index) * elif tag == structs.T_GroupingSet: */ break; case T_GroupingSet: /* "pglast/ast.pyx":2523 * return create_SortGroupClause( data, offset_to_index) * elif tag == structs.T_GroupingSet: * return create_GroupingSet( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_WindowClause: * return create_WindowClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_GroupingSet(((GroupingSet *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2522 * elif tag == structs.T_SortGroupClause: * return create_SortGroupClause( data, offset_to_index) * elif tag == structs.T_GroupingSet: # <<<<<<<<<<<<<< * return create_GroupingSet( data, offset_to_index) * elif tag == structs.T_WindowClause: */ break; case T_WindowClause: /* "pglast/ast.pyx":2525 * return create_GroupingSet( data, offset_to_index) * elif tag == structs.T_WindowClause: * return create_WindowClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RowMarkClause: * return create_RowMarkClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_WindowClause(((WindowClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2524 * elif tag == structs.T_GroupingSet: * return create_GroupingSet( data, offset_to_index) * elif tag == structs.T_WindowClause: # <<<<<<<<<<<<<< * return create_WindowClause( data, offset_to_index) * elif tag == structs.T_RowMarkClause: */ break; case T_RowMarkClause: /* "pglast/ast.pyx":2527 * return create_WindowClause( data, offset_to_index) * elif tag == structs.T_RowMarkClause: * return create_RowMarkClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_WithClause: * return create_WithClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RowMarkClause(((RowMarkClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2526 * elif tag == structs.T_WindowClause: * return create_WindowClause( data, offset_to_index) * elif tag == structs.T_RowMarkClause: # <<<<<<<<<<<<<< * return create_RowMarkClause( data, offset_to_index) * elif tag == structs.T_WithClause: */ break; case T_WithClause: /* "pglast/ast.pyx":2529 * return create_RowMarkClause( data, offset_to_index) * elif tag == structs.T_WithClause: * return create_WithClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_InferClause: * return create_InferClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_WithClause(((WithClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2528 * elif tag == structs.T_RowMarkClause: * return create_RowMarkClause( data, offset_to_index) * elif tag == structs.T_WithClause: # <<<<<<<<<<<<<< * return create_WithClause( data, offset_to_index) * elif tag == structs.T_InferClause: */ break; case T_InferClause: /* "pglast/ast.pyx":2531 * return create_WithClause( data, offset_to_index) * elif tag == structs.T_InferClause: * return create_InferClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_OnConflictClause: * return create_OnConflictClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_InferClause(((InferClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2530 * elif tag == structs.T_WithClause: * return create_WithClause( data, offset_to_index) * elif tag == structs.T_InferClause: # <<<<<<<<<<<<<< * return create_InferClause( data, offset_to_index) * elif tag == structs.T_OnConflictClause: */ break; case T_OnConflictClause: /* "pglast/ast.pyx":2533 * return create_InferClause( data, offset_to_index) * elif tag == structs.T_OnConflictClause: * return create_OnConflictClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CTESearchClause: * return create_CTESearchClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_OnConflictClause(((OnConflictClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2532 * elif tag == structs.T_InferClause: * return create_InferClause( data, offset_to_index) * elif tag == structs.T_OnConflictClause: # <<<<<<<<<<<<<< * return create_OnConflictClause( data, offset_to_index) * elif tag == structs.T_CTESearchClause: */ break; case T_CTESearchClause: /* "pglast/ast.pyx":2535 * return create_OnConflictClause( data, offset_to_index) * elif tag == structs.T_CTESearchClause: * return create_CTESearchClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CTECycleClause: * return create_CTECycleClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CTESearchClause(((CTESearchClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2534 * elif tag == structs.T_OnConflictClause: * return create_OnConflictClause( data, offset_to_index) * elif tag == structs.T_CTESearchClause: # <<<<<<<<<<<<<< * return create_CTESearchClause( data, offset_to_index) * elif tag == structs.T_CTECycleClause: */ break; case T_CTECycleClause: /* "pglast/ast.pyx":2537 * return create_CTESearchClause( data, offset_to_index) * elif tag == structs.T_CTECycleClause: * return create_CTECycleClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CommonTableExpr: * return create_CommonTableExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CTECycleClause(((CTECycleClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2536 * elif tag == structs.T_CTESearchClause: * return create_CTESearchClause( data, offset_to_index) * elif tag == structs.T_CTECycleClause: # <<<<<<<<<<<<<< * return create_CTECycleClause( data, offset_to_index) * elif tag == structs.T_CommonTableExpr: */ break; case T_CommonTableExpr: /* "pglast/ast.pyx":2539 * return create_CTECycleClause( data, offset_to_index) * elif tag == structs.T_CommonTableExpr: * return create_CommonTableExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_MergeWhenClause: * return create_MergeWhenClause( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CommonTableExpr(((CommonTableExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2538 * elif tag == structs.T_CTECycleClause: * return create_CTECycleClause( data, offset_to_index) * elif tag == structs.T_CommonTableExpr: # <<<<<<<<<<<<<< * return create_CommonTableExpr( data, offset_to_index) * elif tag == structs.T_MergeWhenClause: */ break; case T_MergeWhenClause: /* "pglast/ast.pyx":2541 * return create_CommonTableExpr( data, offset_to_index) * elif tag == structs.T_MergeWhenClause: * return create_MergeWhenClause( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TriggerTransition: * return create_TriggerTransition( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_MergeWhenClause(((MergeWhenClause *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2540 * elif tag == structs.T_CommonTableExpr: * return create_CommonTableExpr( data, offset_to_index) * elif tag == structs.T_MergeWhenClause: # <<<<<<<<<<<<<< * return create_MergeWhenClause( data, offset_to_index) * elif tag == structs.T_TriggerTransition: */ break; case T_TriggerTransition: /* "pglast/ast.pyx":2543 * return create_MergeWhenClause( data, offset_to_index) * elif tag == structs.T_TriggerTransition: * return create_TriggerTransition( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonOutput: * return create_JsonOutput( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TriggerTransition(((TriggerTransition *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2542 * elif tag == structs.T_MergeWhenClause: * return create_MergeWhenClause( data, offset_to_index) * elif tag == structs.T_TriggerTransition: # <<<<<<<<<<<<<< * return create_TriggerTransition( data, offset_to_index) * elif tag == structs.T_JsonOutput: */ break; case T_JsonOutput: /* "pglast/ast.pyx":2545 * return create_TriggerTransition( data, offset_to_index) * elif tag == structs.T_JsonOutput: * return create_JsonOutput( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonArgument: * return create_JsonArgument( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonOutput(((JsonOutput *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2544 * elif tag == structs.T_TriggerTransition: * return create_TriggerTransition( data, offset_to_index) * elif tag == structs.T_JsonOutput: # <<<<<<<<<<<<<< * return create_JsonOutput( data, offset_to_index) * elif tag == structs.T_JsonArgument: */ break; case T_JsonArgument: /* "pglast/ast.pyx":2547 * return create_JsonOutput( data, offset_to_index) * elif tag == structs.T_JsonArgument: * return create_JsonArgument( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonFuncExpr: * return create_JsonFuncExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonArgument(((JsonArgument *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2546 * elif tag == structs.T_JsonOutput: * return create_JsonOutput( data, offset_to_index) * elif tag == structs.T_JsonArgument: # <<<<<<<<<<<<<< * return create_JsonArgument( data, offset_to_index) * elif tag == structs.T_JsonFuncExpr: */ break; case T_JsonFuncExpr: /* "pglast/ast.pyx":2549 * return create_JsonArgument( data, offset_to_index) * elif tag == structs.T_JsonFuncExpr: * return create_JsonFuncExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonTablePathSpec: * return create_JsonTablePathSpec( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonFuncExpr(((JsonFuncExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2548 * elif tag == structs.T_JsonArgument: * return create_JsonArgument( data, offset_to_index) * elif tag == structs.T_JsonFuncExpr: # <<<<<<<<<<<<<< * return create_JsonFuncExpr( data, offset_to_index) * elif tag == structs.T_JsonTablePathSpec: */ break; case T_JsonTablePathSpec: /* "pglast/ast.pyx":2551 * return create_JsonFuncExpr( data, offset_to_index) * elif tag == structs.T_JsonTablePathSpec: * return create_JsonTablePathSpec( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonTable: * return create_JsonTable( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonTablePathSpec(((JsonTablePathSpec *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2550 * elif tag == structs.T_JsonFuncExpr: * return create_JsonFuncExpr( data, offset_to_index) * elif tag == structs.T_JsonTablePathSpec: # <<<<<<<<<<<<<< * return create_JsonTablePathSpec( data, offset_to_index) * elif tag == structs.T_JsonTable: */ break; case T_JsonTable: /* "pglast/ast.pyx":2553 * return create_JsonTablePathSpec( data, offset_to_index) * elif tag == structs.T_JsonTable: * return create_JsonTable( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonTableColumn: * return create_JsonTableColumn( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonTable(((JsonTable *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2552 * elif tag == structs.T_JsonTablePathSpec: * return create_JsonTablePathSpec( data, offset_to_index) * elif tag == structs.T_JsonTable: # <<<<<<<<<<<<<< * return create_JsonTable( data, offset_to_index) * elif tag == structs.T_JsonTableColumn: */ break; case T_JsonTableColumn: /* "pglast/ast.pyx":2555 * return create_JsonTable( data, offset_to_index) * elif tag == structs.T_JsonTableColumn: * return create_JsonTableColumn( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonKeyValue: * return create_JsonKeyValue( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonTableColumn(((JsonTableColumn *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2554 * elif tag == structs.T_JsonTable: * return create_JsonTable( data, offset_to_index) * elif tag == structs.T_JsonTableColumn: # <<<<<<<<<<<<<< * return create_JsonTableColumn( data, offset_to_index) * elif tag == structs.T_JsonKeyValue: */ break; case T_JsonKeyValue: /* "pglast/ast.pyx":2557 * return create_JsonTableColumn( data, offset_to_index) * elif tag == structs.T_JsonKeyValue: * return create_JsonKeyValue( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonParseExpr: * return create_JsonParseExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonKeyValue(((JsonKeyValue *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2556 * elif tag == structs.T_JsonTableColumn: * return create_JsonTableColumn( data, offset_to_index) * elif tag == structs.T_JsonKeyValue: # <<<<<<<<<<<<<< * return create_JsonKeyValue( data, offset_to_index) * elif tag == structs.T_JsonParseExpr: */ break; case T_JsonParseExpr: /* "pglast/ast.pyx":2559 * return create_JsonKeyValue( data, offset_to_index) * elif tag == structs.T_JsonParseExpr: * return create_JsonParseExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonScalarExpr: * return create_JsonScalarExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonParseExpr(((JsonParseExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2558 * elif tag == structs.T_JsonKeyValue: * return create_JsonKeyValue( data, offset_to_index) * elif tag == structs.T_JsonParseExpr: # <<<<<<<<<<<<<< * return create_JsonParseExpr( data, offset_to_index) * elif tag == structs.T_JsonScalarExpr: */ break; case T_JsonScalarExpr: /* "pglast/ast.pyx":2561 * return create_JsonParseExpr( data, offset_to_index) * elif tag == structs.T_JsonScalarExpr: * return create_JsonScalarExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonSerializeExpr: * return create_JsonSerializeExpr( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonScalarExpr(((JsonScalarExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2560 * elif tag == structs.T_JsonParseExpr: * return create_JsonParseExpr( data, offset_to_index) * elif tag == structs.T_JsonScalarExpr: # <<<<<<<<<<<<<< * return create_JsonScalarExpr( data, offset_to_index) * elif tag == structs.T_JsonSerializeExpr: */ break; case T_JsonSerializeExpr: /* "pglast/ast.pyx":2563 * return create_JsonScalarExpr( data, offset_to_index) * elif tag == structs.T_JsonSerializeExpr: * return create_JsonSerializeExpr( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonObjectConstructor: * return create_JsonObjectConstructor( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonSerializeExpr(((JsonSerializeExpr *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2562 * elif tag == structs.T_JsonScalarExpr: * return create_JsonScalarExpr( data, offset_to_index) * elif tag == structs.T_JsonSerializeExpr: # <<<<<<<<<<<<<< * return create_JsonSerializeExpr( data, offset_to_index) * elif tag == structs.T_JsonObjectConstructor: */ break; case T_JsonObjectConstructor: /* "pglast/ast.pyx":2565 * return create_JsonSerializeExpr( data, offset_to_index) * elif tag == structs.T_JsonObjectConstructor: * return create_JsonObjectConstructor( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonArrayConstructor: * return create_JsonArrayConstructor( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonObjectConstructor(((JsonObjectConstructor *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2564 * elif tag == structs.T_JsonSerializeExpr: * return create_JsonSerializeExpr( data, offset_to_index) * elif tag == structs.T_JsonObjectConstructor: # <<<<<<<<<<<<<< * return create_JsonObjectConstructor( data, offset_to_index) * elif tag == structs.T_JsonArrayConstructor: */ break; case T_JsonArrayConstructor: /* "pglast/ast.pyx":2567 * return create_JsonObjectConstructor( data, offset_to_index) * elif tag == structs.T_JsonArrayConstructor: * return create_JsonArrayConstructor( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonArrayQueryConstructor: * return create_JsonArrayQueryConstructor( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonArrayConstructor(((JsonArrayConstructor *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2566 * elif tag == structs.T_JsonObjectConstructor: * return create_JsonObjectConstructor( data, offset_to_index) * elif tag == structs.T_JsonArrayConstructor: # <<<<<<<<<<<<<< * return create_JsonArrayConstructor( data, offset_to_index) * elif tag == structs.T_JsonArrayQueryConstructor: */ break; case T_JsonArrayQueryConstructor: /* "pglast/ast.pyx":2569 * return create_JsonArrayConstructor( data, offset_to_index) * elif tag == structs.T_JsonArrayQueryConstructor: * return create_JsonArrayQueryConstructor( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonAggConstructor: * return create_JsonAggConstructor( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonArrayQueryConstructor(((JsonArrayQueryConstructor *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2568 * elif tag == structs.T_JsonArrayConstructor: * return create_JsonArrayConstructor( data, offset_to_index) * elif tag == structs.T_JsonArrayQueryConstructor: # <<<<<<<<<<<<<< * return create_JsonArrayQueryConstructor( data, offset_to_index) * elif tag == structs.T_JsonAggConstructor: */ break; case T_JsonAggConstructor: /* "pglast/ast.pyx":2571 * return create_JsonArrayQueryConstructor( data, offset_to_index) * elif tag == structs.T_JsonAggConstructor: * return create_JsonAggConstructor( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonObjectAgg: * return create_JsonObjectAgg( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonAggConstructor(((JsonAggConstructor *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2570 * elif tag == structs.T_JsonArrayQueryConstructor: * return create_JsonArrayQueryConstructor( data, offset_to_index) * elif tag == structs.T_JsonAggConstructor: # <<<<<<<<<<<<<< * return create_JsonAggConstructor( data, offset_to_index) * elif tag == structs.T_JsonObjectAgg: */ break; case T_JsonObjectAgg: /* "pglast/ast.pyx":2573 * return create_JsonAggConstructor( data, offset_to_index) * elif tag == structs.T_JsonObjectAgg: * return create_JsonObjectAgg( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_JsonArrayAgg: * return create_JsonArrayAgg( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonObjectAgg(((JsonObjectAgg *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2572 * elif tag == structs.T_JsonAggConstructor: * return create_JsonAggConstructor( data, offset_to_index) * elif tag == structs.T_JsonObjectAgg: # <<<<<<<<<<<<<< * return create_JsonObjectAgg( data, offset_to_index) * elif tag == structs.T_JsonArrayAgg: */ break; case T_JsonArrayAgg: /* "pglast/ast.pyx":2575 * return create_JsonObjectAgg( data, offset_to_index) * elif tag == structs.T_JsonArrayAgg: * return create_JsonArrayAgg( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RawStmt: * return create_RawStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_JsonArrayAgg(((JsonArrayAgg *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2574 * elif tag == structs.T_JsonObjectAgg: * return create_JsonObjectAgg( data, offset_to_index) * elif tag == structs.T_JsonArrayAgg: # <<<<<<<<<<<<<< * return create_JsonArrayAgg( data, offset_to_index) * elif tag == structs.T_RawStmt: */ break; case T_RawStmt: /* "pglast/ast.pyx":2577 * return create_JsonArrayAgg( data, offset_to_index) * elif tag == structs.T_RawStmt: * return create_RawStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_InsertStmt: * return create_InsertStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RawStmt(((RawStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2576 * elif tag == structs.T_JsonArrayAgg: * return create_JsonArrayAgg( data, offset_to_index) * elif tag == structs.T_RawStmt: # <<<<<<<<<<<<<< * return create_RawStmt( data, offset_to_index) * elif tag == structs.T_InsertStmt: */ break; case T_InsertStmt: /* "pglast/ast.pyx":2579 * return create_RawStmt( data, offset_to_index) * elif tag == structs.T_InsertStmt: * return create_InsertStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DeleteStmt: * return create_DeleteStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_InsertStmt(((InsertStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2578 * elif tag == structs.T_RawStmt: * return create_RawStmt( data, offset_to_index) * elif tag == structs.T_InsertStmt: # <<<<<<<<<<<<<< * return create_InsertStmt( data, offset_to_index) * elif tag == structs.T_DeleteStmt: */ break; case T_DeleteStmt: /* "pglast/ast.pyx":2581 * return create_InsertStmt( data, offset_to_index) * elif tag == structs.T_DeleteStmt: * return create_DeleteStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_UpdateStmt: * return create_UpdateStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DeleteStmt(((DeleteStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2580 * elif tag == structs.T_InsertStmt: * return create_InsertStmt( data, offset_to_index) * elif tag == structs.T_DeleteStmt: # <<<<<<<<<<<<<< * return create_DeleteStmt( data, offset_to_index) * elif tag == structs.T_UpdateStmt: */ break; case T_UpdateStmt: /* "pglast/ast.pyx":2583 * return create_DeleteStmt( data, offset_to_index) * elif tag == structs.T_UpdateStmt: * return create_UpdateStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_MergeStmt: * return create_MergeStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_UpdateStmt(((UpdateStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2582 * elif tag == structs.T_DeleteStmt: * return create_DeleteStmt( data, offset_to_index) * elif tag == structs.T_UpdateStmt: # <<<<<<<<<<<<<< * return create_UpdateStmt( data, offset_to_index) * elif tag == structs.T_MergeStmt: */ break; case T_MergeStmt: /* "pglast/ast.pyx":2585 * return create_UpdateStmt( data, offset_to_index) * elif tag == structs.T_MergeStmt: * return create_MergeStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SelectStmt: * return create_SelectStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_MergeStmt(((MergeStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2584 * elif tag == structs.T_UpdateStmt: * return create_UpdateStmt( data, offset_to_index) * elif tag == structs.T_MergeStmt: # <<<<<<<<<<<<<< * return create_MergeStmt( data, offset_to_index) * elif tag == structs.T_SelectStmt: */ break; case T_SelectStmt: /* "pglast/ast.pyx":2587 * return create_MergeStmt( data, offset_to_index) * elif tag == structs.T_SelectStmt: * return create_SelectStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SetOperationStmt: * return create_SetOperationStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SelectStmt(((SelectStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2586 * elif tag == structs.T_MergeStmt: * return create_MergeStmt( data, offset_to_index) * elif tag == structs.T_SelectStmt: # <<<<<<<<<<<<<< * return create_SelectStmt( data, offset_to_index) * elif tag == structs.T_SetOperationStmt: */ break; case T_SetOperationStmt: /* "pglast/ast.pyx":2589 * return create_SelectStmt( data, offset_to_index) * elif tag == structs.T_SetOperationStmt: * return create_SetOperationStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ReturnStmt: * return create_ReturnStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SetOperationStmt(((SetOperationStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2588 * elif tag == structs.T_SelectStmt: * return create_SelectStmt( data, offset_to_index) * elif tag == structs.T_SetOperationStmt: # <<<<<<<<<<<<<< * return create_SetOperationStmt( data, offset_to_index) * elif tag == structs.T_ReturnStmt: */ break; case T_ReturnStmt: /* "pglast/ast.pyx":2591 * return create_SetOperationStmt( data, offset_to_index) * elif tag == structs.T_ReturnStmt: * return create_ReturnStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PLAssignStmt: * return create_PLAssignStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ReturnStmt(((ReturnStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2590 * elif tag == structs.T_SetOperationStmt: * return create_SetOperationStmt( data, offset_to_index) * elif tag == structs.T_ReturnStmt: # <<<<<<<<<<<<<< * return create_ReturnStmt( data, offset_to_index) * elif tag == structs.T_PLAssignStmt: */ break; case T_PLAssignStmt: /* "pglast/ast.pyx":2593 * return create_ReturnStmt( data, offset_to_index) * elif tag == structs.T_PLAssignStmt: * return create_PLAssignStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateSchemaStmt: * return create_CreateSchemaStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PLAssignStmt(((PLAssignStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2592 * elif tag == structs.T_ReturnStmt: * return create_ReturnStmt( data, offset_to_index) * elif tag == structs.T_PLAssignStmt: # <<<<<<<<<<<<<< * return create_PLAssignStmt( data, offset_to_index) * elif tag == structs.T_CreateSchemaStmt: */ break; case T_CreateSchemaStmt: /* "pglast/ast.pyx":2595 * return create_PLAssignStmt( data, offset_to_index) * elif tag == structs.T_CreateSchemaStmt: * return create_CreateSchemaStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTableStmt: * return create_AlterTableStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateSchemaStmt(((CreateSchemaStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2594 * elif tag == structs.T_PLAssignStmt: * return create_PLAssignStmt( data, offset_to_index) * elif tag == structs.T_CreateSchemaStmt: # <<<<<<<<<<<<<< * return create_CreateSchemaStmt( data, offset_to_index) * elif tag == structs.T_AlterTableStmt: */ break; case T_AlterTableStmt: /* "pglast/ast.pyx":2597 * return create_CreateSchemaStmt( data, offset_to_index) * elif tag == structs.T_AlterTableStmt: * return create_AlterTableStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ReplicaIdentityStmt: * return create_ReplicaIdentityStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTableStmt(((AlterTableStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2596 * elif tag == structs.T_CreateSchemaStmt: * return create_CreateSchemaStmt( data, offset_to_index) * elif tag == structs.T_AlterTableStmt: # <<<<<<<<<<<<<< * return create_AlterTableStmt( data, offset_to_index) * elif tag == structs.T_ReplicaIdentityStmt: */ break; case T_ReplicaIdentityStmt: /* "pglast/ast.pyx":2599 * return create_AlterTableStmt( data, offset_to_index) * elif tag == structs.T_ReplicaIdentityStmt: * return create_ReplicaIdentityStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTableCmd: * return create_AlterTableCmd( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ReplicaIdentityStmt(((ReplicaIdentityStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2598 * elif tag == structs.T_AlterTableStmt: * return create_AlterTableStmt( data, offset_to_index) * elif tag == structs.T_ReplicaIdentityStmt: # <<<<<<<<<<<<<< * return create_ReplicaIdentityStmt( data, offset_to_index) * elif tag == structs.T_AlterTableCmd: */ break; case T_AlterTableCmd: /* "pglast/ast.pyx":2601 * return create_ReplicaIdentityStmt( data, offset_to_index) * elif tag == structs.T_AlterTableCmd: * return create_AlterTableCmd( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterCollationStmt: * return create_AlterCollationStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTableCmd(((AlterTableCmd *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2600 * elif tag == structs.T_ReplicaIdentityStmt: * return create_ReplicaIdentityStmt( data, offset_to_index) * elif tag == structs.T_AlterTableCmd: # <<<<<<<<<<<<<< * return create_AlterTableCmd( data, offset_to_index) * elif tag == structs.T_AlterCollationStmt: */ break; case T_AlterCollationStmt: /* "pglast/ast.pyx":2603 * return create_AlterTableCmd( data, offset_to_index) * elif tag == structs.T_AlterCollationStmt: * return create_AlterCollationStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterDomainStmt: * return create_AlterDomainStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterCollationStmt(((AlterCollationStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2602 * elif tag == structs.T_AlterTableCmd: * return create_AlterTableCmd( data, offset_to_index) * elif tag == structs.T_AlterCollationStmt: # <<<<<<<<<<<<<< * return create_AlterCollationStmt( data, offset_to_index) * elif tag == structs.T_AlterDomainStmt: */ break; case T_AlterDomainStmt: /* "pglast/ast.pyx":2605 * return create_AlterCollationStmt( data, offset_to_index) * elif tag == structs.T_AlterDomainStmt: * return create_AlterDomainStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_GrantStmt: * return create_GrantStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterDomainStmt(((AlterDomainStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2604 * elif tag == structs.T_AlterCollationStmt: * return create_AlterCollationStmt( data, offset_to_index) * elif tag == structs.T_AlterDomainStmt: # <<<<<<<<<<<<<< * return create_AlterDomainStmt( data, offset_to_index) * elif tag == structs.T_GrantStmt: */ break; case T_GrantStmt: /* "pglast/ast.pyx":2607 * return create_AlterDomainStmt( data, offset_to_index) * elif tag == structs.T_GrantStmt: * return create_GrantStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ObjectWithArgs: * return create_ObjectWithArgs( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_GrantStmt(((GrantStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2606 * elif tag == structs.T_AlterDomainStmt: * return create_AlterDomainStmt( data, offset_to_index) * elif tag == structs.T_GrantStmt: # <<<<<<<<<<<<<< * return create_GrantStmt( data, offset_to_index) * elif tag == structs.T_ObjectWithArgs: */ break; case T_ObjectWithArgs: /* "pglast/ast.pyx":2609 * return create_GrantStmt( data, offset_to_index) * elif tag == structs.T_ObjectWithArgs: * return create_ObjectWithArgs( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AccessPriv: * return create_AccessPriv( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ObjectWithArgs(((ObjectWithArgs *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2608 * elif tag == structs.T_GrantStmt: * return create_GrantStmt( data, offset_to_index) * elif tag == structs.T_ObjectWithArgs: # <<<<<<<<<<<<<< * return create_ObjectWithArgs( data, offset_to_index) * elif tag == structs.T_AccessPriv: */ break; case T_AccessPriv: /* "pglast/ast.pyx":2611 * return create_ObjectWithArgs( data, offset_to_index) * elif tag == structs.T_AccessPriv: * return create_AccessPriv( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_GrantRoleStmt: * return create_GrantRoleStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AccessPriv(((AccessPriv *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2610 * elif tag == structs.T_ObjectWithArgs: * return create_ObjectWithArgs( data, offset_to_index) * elif tag == structs.T_AccessPriv: # <<<<<<<<<<<<<< * return create_AccessPriv( data, offset_to_index) * elif tag == structs.T_GrantRoleStmt: */ break; case T_GrantRoleStmt: /* "pglast/ast.pyx":2613 * return create_AccessPriv( data, offset_to_index) * elif tag == structs.T_GrantRoleStmt: * return create_GrantRoleStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterDefaultPrivilegesStmt: * return create_AlterDefaultPrivilegesStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_GrantRoleStmt(((GrantRoleStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2612 * elif tag == structs.T_AccessPriv: * return create_AccessPriv( data, offset_to_index) * elif tag == structs.T_GrantRoleStmt: # <<<<<<<<<<<<<< * return create_GrantRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterDefaultPrivilegesStmt: */ break; case T_AlterDefaultPrivilegesStmt: /* "pglast/ast.pyx":2615 * return create_GrantRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterDefaultPrivilegesStmt: * return create_AlterDefaultPrivilegesStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CopyStmt: * return create_CopyStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterDefaultPrivilegesStmt(((AlterDefaultPrivilegesStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2614 * elif tag == structs.T_GrantRoleStmt: * return create_GrantRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterDefaultPrivilegesStmt: # <<<<<<<<<<<<<< * return create_AlterDefaultPrivilegesStmt( data, offset_to_index) * elif tag == structs.T_CopyStmt: */ break; case T_CopyStmt: /* "pglast/ast.pyx":2617 * return create_AlterDefaultPrivilegesStmt( data, offset_to_index) * elif tag == structs.T_CopyStmt: * return create_CopyStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_VariableSetStmt: * return create_VariableSetStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CopyStmt(((CopyStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2616 * elif tag == structs.T_AlterDefaultPrivilegesStmt: * return create_AlterDefaultPrivilegesStmt( data, offset_to_index) * elif tag == structs.T_CopyStmt: # <<<<<<<<<<<<<< * return create_CopyStmt( data, offset_to_index) * elif tag == structs.T_VariableSetStmt: */ break; case T_VariableSetStmt: /* "pglast/ast.pyx":2619 * return create_CopyStmt( data, offset_to_index) * elif tag == structs.T_VariableSetStmt: * return create_VariableSetStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_VariableShowStmt: * return create_VariableShowStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_VariableSetStmt(((VariableSetStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2618 * elif tag == structs.T_CopyStmt: * return create_CopyStmt( data, offset_to_index) * elif tag == structs.T_VariableSetStmt: # <<<<<<<<<<<<<< * return create_VariableSetStmt( data, offset_to_index) * elif tag == structs.T_VariableShowStmt: */ break; case T_VariableShowStmt: /* "pglast/ast.pyx":2621 * return create_VariableSetStmt( data, offset_to_index) * elif tag == structs.T_VariableShowStmt: * return create_VariableShowStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateStmt: * return create_CreateStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_VariableShowStmt(((VariableShowStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2620 * elif tag == structs.T_VariableSetStmt: * return create_VariableSetStmt( data, offset_to_index) * elif tag == structs.T_VariableShowStmt: # <<<<<<<<<<<<<< * return create_VariableShowStmt( data, offset_to_index) * elif tag == structs.T_CreateStmt: */ break; case T_CreateStmt: /* "pglast/ast.pyx":2623 * return create_VariableShowStmt( data, offset_to_index) * elif tag == structs.T_CreateStmt: * return create_CreateStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Constraint: * return create_Constraint( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateStmt(((CreateStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2622 * elif tag == structs.T_VariableShowStmt: * return create_VariableShowStmt( data, offset_to_index) * elif tag == structs.T_CreateStmt: # <<<<<<<<<<<<<< * return create_CreateStmt( data, offset_to_index) * elif tag == structs.T_Constraint: */ break; case T_Constraint: /* "pglast/ast.pyx":2625 * return create_CreateStmt( data, offset_to_index) * elif tag == structs.T_Constraint: * return create_Constraint( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateTableSpaceStmt: * return create_CreateTableSpaceStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Constraint(((Constraint *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2624 * elif tag == structs.T_CreateStmt: * return create_CreateStmt( data, offset_to_index) * elif tag == structs.T_Constraint: # <<<<<<<<<<<<<< * return create_Constraint( data, offset_to_index) * elif tag == structs.T_CreateTableSpaceStmt: */ break; case T_CreateTableSpaceStmt: /* "pglast/ast.pyx":2627 * return create_Constraint( data, offset_to_index) * elif tag == structs.T_CreateTableSpaceStmt: * return create_CreateTableSpaceStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropTableSpaceStmt: * return create_DropTableSpaceStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateTableSpaceStmt(((CreateTableSpaceStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2626 * elif tag == structs.T_Constraint: * return create_Constraint( data, offset_to_index) * elif tag == structs.T_CreateTableSpaceStmt: # <<<<<<<<<<<<<< * return create_CreateTableSpaceStmt( data, offset_to_index) * elif tag == structs.T_DropTableSpaceStmt: */ break; case T_DropTableSpaceStmt: /* "pglast/ast.pyx":2629 * return create_CreateTableSpaceStmt( data, offset_to_index) * elif tag == structs.T_DropTableSpaceStmt: * return create_DropTableSpaceStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTableSpaceOptionsStmt: * return create_AlterTableSpaceOptionsStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropTableSpaceStmt(((DropTableSpaceStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2628 * elif tag == structs.T_CreateTableSpaceStmt: * return create_CreateTableSpaceStmt( data, offset_to_index) * elif tag == structs.T_DropTableSpaceStmt: # <<<<<<<<<<<<<< * return create_DropTableSpaceStmt( data, offset_to_index) * elif tag == structs.T_AlterTableSpaceOptionsStmt: */ break; case T_AlterTableSpaceOptionsStmt: /* "pglast/ast.pyx":2631 * return create_DropTableSpaceStmt( data, offset_to_index) * elif tag == structs.T_AlterTableSpaceOptionsStmt: * return create_AlterTableSpaceOptionsStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTableMoveAllStmt: * return create_AlterTableMoveAllStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTableSpaceOptionsStmt(((AlterTableSpaceOptionsStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2630 * elif tag == structs.T_DropTableSpaceStmt: * return create_DropTableSpaceStmt( data, offset_to_index) * elif tag == structs.T_AlterTableSpaceOptionsStmt: # <<<<<<<<<<<<<< * return create_AlterTableSpaceOptionsStmt( data, offset_to_index) * elif tag == structs.T_AlterTableMoveAllStmt: */ break; case T_AlterTableMoveAllStmt: /* "pglast/ast.pyx":2633 * return create_AlterTableSpaceOptionsStmt( data, offset_to_index) * elif tag == structs.T_AlterTableMoveAllStmt: * return create_AlterTableMoveAllStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateExtensionStmt: * return create_CreateExtensionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTableMoveAllStmt(((AlterTableMoveAllStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2632 * elif tag == structs.T_AlterTableSpaceOptionsStmt: * return create_AlterTableSpaceOptionsStmt( data, offset_to_index) * elif tag == structs.T_AlterTableMoveAllStmt: # <<<<<<<<<<<<<< * return create_AlterTableMoveAllStmt( data, offset_to_index) * elif tag == structs.T_CreateExtensionStmt: */ break; case T_CreateExtensionStmt: /* "pglast/ast.pyx":2635 * return create_AlterTableMoveAllStmt( data, offset_to_index) * elif tag == structs.T_CreateExtensionStmt: * return create_CreateExtensionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterExtensionStmt: * return create_AlterExtensionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateExtensionStmt(((CreateExtensionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2634 * elif tag == structs.T_AlterTableMoveAllStmt: * return create_AlterTableMoveAllStmt( data, offset_to_index) * elif tag == structs.T_CreateExtensionStmt: # <<<<<<<<<<<<<< * return create_CreateExtensionStmt( data, offset_to_index) * elif tag == structs.T_AlterExtensionStmt: */ break; case T_AlterExtensionStmt: /* "pglast/ast.pyx":2637 * return create_CreateExtensionStmt( data, offset_to_index) * elif tag == structs.T_AlterExtensionStmt: * return create_AlterExtensionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterExtensionContentsStmt: * return create_AlterExtensionContentsStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterExtensionStmt(((AlterExtensionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2636 * elif tag == structs.T_CreateExtensionStmt: * return create_CreateExtensionStmt( data, offset_to_index) * elif tag == structs.T_AlterExtensionStmt: # <<<<<<<<<<<<<< * return create_AlterExtensionStmt( data, offset_to_index) * elif tag == structs.T_AlterExtensionContentsStmt: */ break; case T_AlterExtensionContentsStmt: /* "pglast/ast.pyx":2639 * return create_AlterExtensionStmt( data, offset_to_index) * elif tag == structs.T_AlterExtensionContentsStmt: * return create_AlterExtensionContentsStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateFdwStmt: * return create_CreateFdwStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterExtensionContentsStmt(((AlterExtensionContentsStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2638 * elif tag == structs.T_AlterExtensionStmt: * return create_AlterExtensionStmt( data, offset_to_index) * elif tag == structs.T_AlterExtensionContentsStmt: # <<<<<<<<<<<<<< * return create_AlterExtensionContentsStmt( data, offset_to_index) * elif tag == structs.T_CreateFdwStmt: */ break; case T_CreateFdwStmt: /* "pglast/ast.pyx":2641 * return create_AlterExtensionContentsStmt( data, offset_to_index) * elif tag == structs.T_CreateFdwStmt: * return create_CreateFdwStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterFdwStmt: * return create_AlterFdwStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateFdwStmt(((CreateFdwStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2640 * elif tag == structs.T_AlterExtensionContentsStmt: * return create_AlterExtensionContentsStmt( data, offset_to_index) * elif tag == structs.T_CreateFdwStmt: # <<<<<<<<<<<<<< * return create_CreateFdwStmt( data, offset_to_index) * elif tag == structs.T_AlterFdwStmt: */ break; case T_AlterFdwStmt: /* "pglast/ast.pyx":2643 * return create_CreateFdwStmt( data, offset_to_index) * elif tag == structs.T_AlterFdwStmt: * return create_AlterFdwStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateForeignServerStmt: * return create_CreateForeignServerStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterFdwStmt(((AlterFdwStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2642 * elif tag == structs.T_CreateFdwStmt: * return create_CreateFdwStmt( data, offset_to_index) * elif tag == structs.T_AlterFdwStmt: # <<<<<<<<<<<<<< * return create_AlterFdwStmt( data, offset_to_index) * elif tag == structs.T_CreateForeignServerStmt: */ break; case T_CreateForeignServerStmt: /* "pglast/ast.pyx":2645 * return create_AlterFdwStmt( data, offset_to_index) * elif tag == structs.T_CreateForeignServerStmt: * return create_CreateForeignServerStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterForeignServerStmt: * return create_AlterForeignServerStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateForeignServerStmt(((CreateForeignServerStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2644 * elif tag == structs.T_AlterFdwStmt: * return create_AlterFdwStmt( data, offset_to_index) * elif tag == structs.T_CreateForeignServerStmt: # <<<<<<<<<<<<<< * return create_CreateForeignServerStmt( data, offset_to_index) * elif tag == structs.T_AlterForeignServerStmt: */ break; case T_AlterForeignServerStmt: /* "pglast/ast.pyx":2647 * return create_CreateForeignServerStmt( data, offset_to_index) * elif tag == structs.T_AlterForeignServerStmt: * return create_AlterForeignServerStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateForeignTableStmt: * return create_CreateForeignTableStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterForeignServerStmt(((AlterForeignServerStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2646 * elif tag == structs.T_CreateForeignServerStmt: * return create_CreateForeignServerStmt( data, offset_to_index) * elif tag == structs.T_AlterForeignServerStmt: # <<<<<<<<<<<<<< * return create_AlterForeignServerStmt( data, offset_to_index) * elif tag == structs.T_CreateForeignTableStmt: */ break; case T_CreateForeignTableStmt: /* "pglast/ast.pyx":2649 * return create_AlterForeignServerStmt( data, offset_to_index) * elif tag == structs.T_CreateForeignTableStmt: * return create_CreateForeignTableStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateUserMappingStmt: * return create_CreateUserMappingStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateForeignTableStmt(((CreateForeignTableStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2648 * elif tag == structs.T_AlterForeignServerStmt: * return create_AlterForeignServerStmt( data, offset_to_index) * elif tag == structs.T_CreateForeignTableStmt: # <<<<<<<<<<<<<< * return create_CreateForeignTableStmt( data, offset_to_index) * elif tag == structs.T_CreateUserMappingStmt: */ break; case T_CreateUserMappingStmt: /* "pglast/ast.pyx":2651 * return create_CreateForeignTableStmt( data, offset_to_index) * elif tag == structs.T_CreateUserMappingStmt: * return create_CreateUserMappingStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterUserMappingStmt: * return create_AlterUserMappingStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateUserMappingStmt(((CreateUserMappingStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2650 * elif tag == structs.T_CreateForeignTableStmt: * return create_CreateForeignTableStmt( data, offset_to_index) * elif tag == structs.T_CreateUserMappingStmt: # <<<<<<<<<<<<<< * return create_CreateUserMappingStmt( data, offset_to_index) * elif tag == structs.T_AlterUserMappingStmt: */ break; case T_AlterUserMappingStmt: /* "pglast/ast.pyx":2653 * return create_CreateUserMappingStmt( data, offset_to_index) * elif tag == structs.T_AlterUserMappingStmt: * return create_AlterUserMappingStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropUserMappingStmt: * return create_DropUserMappingStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterUserMappingStmt(((AlterUserMappingStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2652 * elif tag == structs.T_CreateUserMappingStmt: * return create_CreateUserMappingStmt( data, offset_to_index) * elif tag == structs.T_AlterUserMappingStmt: # <<<<<<<<<<<<<< * return create_AlterUserMappingStmt( data, offset_to_index) * elif tag == structs.T_DropUserMappingStmt: */ break; case T_DropUserMappingStmt: /* "pglast/ast.pyx":2655 * return create_AlterUserMappingStmt( data, offset_to_index) * elif tag == structs.T_DropUserMappingStmt: * return create_DropUserMappingStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ImportForeignSchemaStmt: * return create_ImportForeignSchemaStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropUserMappingStmt(((DropUserMappingStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2654 * elif tag == structs.T_AlterUserMappingStmt: * return create_AlterUserMappingStmt( data, offset_to_index) * elif tag == structs.T_DropUserMappingStmt: # <<<<<<<<<<<<<< * return create_DropUserMappingStmt( data, offset_to_index) * elif tag == structs.T_ImportForeignSchemaStmt: */ break; case T_ImportForeignSchemaStmt: /* "pglast/ast.pyx":2657 * return create_DropUserMappingStmt( data, offset_to_index) * elif tag == structs.T_ImportForeignSchemaStmt: * return create_ImportForeignSchemaStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreatePolicyStmt: * return create_CreatePolicyStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ImportForeignSchemaStmt(((ImportForeignSchemaStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2656 * elif tag == structs.T_DropUserMappingStmt: * return create_DropUserMappingStmt( data, offset_to_index) * elif tag == structs.T_ImportForeignSchemaStmt: # <<<<<<<<<<<<<< * return create_ImportForeignSchemaStmt( data, offset_to_index) * elif tag == structs.T_CreatePolicyStmt: */ break; case T_CreatePolicyStmt: /* "pglast/ast.pyx":2659 * return create_ImportForeignSchemaStmt( data, offset_to_index) * elif tag == structs.T_CreatePolicyStmt: * return create_CreatePolicyStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterPolicyStmt: * return create_AlterPolicyStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreatePolicyStmt(((CreatePolicyStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2658 * elif tag == structs.T_ImportForeignSchemaStmt: * return create_ImportForeignSchemaStmt( data, offset_to_index) * elif tag == structs.T_CreatePolicyStmt: # <<<<<<<<<<<<<< * return create_CreatePolicyStmt( data, offset_to_index) * elif tag == structs.T_AlterPolicyStmt: */ break; case T_AlterPolicyStmt: /* "pglast/ast.pyx":2661 * return create_CreatePolicyStmt( data, offset_to_index) * elif tag == structs.T_AlterPolicyStmt: * return create_AlterPolicyStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateAmStmt: * return create_CreateAmStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterPolicyStmt(((AlterPolicyStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2660 * elif tag == structs.T_CreatePolicyStmt: * return create_CreatePolicyStmt( data, offset_to_index) * elif tag == structs.T_AlterPolicyStmt: # <<<<<<<<<<<<<< * return create_AlterPolicyStmt( data, offset_to_index) * elif tag == structs.T_CreateAmStmt: */ break; case T_CreateAmStmt: /* "pglast/ast.pyx":2663 * return create_AlterPolicyStmt( data, offset_to_index) * elif tag == structs.T_CreateAmStmt: * return create_CreateAmStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateTrigStmt: * return create_CreateTrigStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateAmStmt(((CreateAmStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2662 * elif tag == structs.T_AlterPolicyStmt: * return create_AlterPolicyStmt( data, offset_to_index) * elif tag == structs.T_CreateAmStmt: # <<<<<<<<<<<<<< * return create_CreateAmStmt( data, offset_to_index) * elif tag == structs.T_CreateTrigStmt: */ break; case T_CreateTrigStmt: /* "pglast/ast.pyx":2665 * return create_CreateAmStmt( data, offset_to_index) * elif tag == structs.T_CreateTrigStmt: * return create_CreateTrigStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateEventTrigStmt: * return create_CreateEventTrigStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateTrigStmt(((CreateTrigStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2664 * elif tag == structs.T_CreateAmStmt: * return create_CreateAmStmt( data, offset_to_index) * elif tag == structs.T_CreateTrigStmt: # <<<<<<<<<<<<<< * return create_CreateTrigStmt( data, offset_to_index) * elif tag == structs.T_CreateEventTrigStmt: */ break; case T_CreateEventTrigStmt: /* "pglast/ast.pyx":2667 * return create_CreateTrigStmt( data, offset_to_index) * elif tag == structs.T_CreateEventTrigStmt: * return create_CreateEventTrigStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterEventTrigStmt: * return create_AlterEventTrigStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateEventTrigStmt(((CreateEventTrigStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2666 * elif tag == structs.T_CreateTrigStmt: * return create_CreateTrigStmt( data, offset_to_index) * elif tag == structs.T_CreateEventTrigStmt: # <<<<<<<<<<<<<< * return create_CreateEventTrigStmt( data, offset_to_index) * elif tag == structs.T_AlterEventTrigStmt: */ break; case T_AlterEventTrigStmt: /* "pglast/ast.pyx":2669 * return create_CreateEventTrigStmt( data, offset_to_index) * elif tag == structs.T_AlterEventTrigStmt: * return create_AlterEventTrigStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreatePLangStmt: * return create_CreatePLangStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterEventTrigStmt(((AlterEventTrigStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2668 * elif tag == structs.T_CreateEventTrigStmt: * return create_CreateEventTrigStmt( data, offset_to_index) * elif tag == structs.T_AlterEventTrigStmt: # <<<<<<<<<<<<<< * return create_AlterEventTrigStmt( data, offset_to_index) * elif tag == structs.T_CreatePLangStmt: */ break; case T_CreatePLangStmt: /* "pglast/ast.pyx":2671 * return create_AlterEventTrigStmt( data, offset_to_index) * elif tag == structs.T_CreatePLangStmt: * return create_CreatePLangStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateRoleStmt: * return create_CreateRoleStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreatePLangStmt(((CreatePLangStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2670 * elif tag == structs.T_AlterEventTrigStmt: * return create_AlterEventTrigStmt( data, offset_to_index) * elif tag == structs.T_CreatePLangStmt: # <<<<<<<<<<<<<< * return create_CreatePLangStmt( data, offset_to_index) * elif tag == structs.T_CreateRoleStmt: */ break; case T_CreateRoleStmt: /* "pglast/ast.pyx":2673 * return create_CreatePLangStmt( data, offset_to_index) * elif tag == structs.T_CreateRoleStmt: * return create_CreateRoleStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterRoleStmt: * return create_AlterRoleStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateRoleStmt(((CreateRoleStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2672 * elif tag == structs.T_CreatePLangStmt: * return create_CreatePLangStmt( data, offset_to_index) * elif tag == structs.T_CreateRoleStmt: # <<<<<<<<<<<<<< * return create_CreateRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterRoleStmt: */ break; case T_AlterRoleStmt: /* "pglast/ast.pyx":2675 * return create_CreateRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterRoleStmt: * return create_AlterRoleStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterRoleSetStmt: * return create_AlterRoleSetStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterRoleStmt(((AlterRoleStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2674 * elif tag == structs.T_CreateRoleStmt: * return create_CreateRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterRoleStmt: # <<<<<<<<<<<<<< * return create_AlterRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterRoleSetStmt: */ break; case T_AlterRoleSetStmt: /* "pglast/ast.pyx":2677 * return create_AlterRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterRoleSetStmt: * return create_AlterRoleSetStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropRoleStmt: * return create_DropRoleStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterRoleSetStmt(((AlterRoleSetStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2676 * elif tag == structs.T_AlterRoleStmt: * return create_AlterRoleStmt( data, offset_to_index) * elif tag == structs.T_AlterRoleSetStmt: # <<<<<<<<<<<<<< * return create_AlterRoleSetStmt( data, offset_to_index) * elif tag == structs.T_DropRoleStmt: */ break; case T_DropRoleStmt: /* "pglast/ast.pyx":2679 * return create_AlterRoleSetStmt( data, offset_to_index) * elif tag == structs.T_DropRoleStmt: * return create_DropRoleStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateSeqStmt: * return create_CreateSeqStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropRoleStmt(((DropRoleStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2678 * elif tag == structs.T_AlterRoleSetStmt: * return create_AlterRoleSetStmt( data, offset_to_index) * elif tag == structs.T_DropRoleStmt: # <<<<<<<<<<<<<< * return create_DropRoleStmt( data, offset_to_index) * elif tag == structs.T_CreateSeqStmt: */ break; case T_CreateSeqStmt: /* "pglast/ast.pyx":2681 * return create_DropRoleStmt( data, offset_to_index) * elif tag == structs.T_CreateSeqStmt: * return create_CreateSeqStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterSeqStmt: * return create_AlterSeqStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateSeqStmt(((CreateSeqStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2680 * elif tag == structs.T_DropRoleStmt: * return create_DropRoleStmt( data, offset_to_index) * elif tag == structs.T_CreateSeqStmt: # <<<<<<<<<<<<<< * return create_CreateSeqStmt( data, offset_to_index) * elif tag == structs.T_AlterSeqStmt: */ break; case T_AlterSeqStmt: /* "pglast/ast.pyx":2683 * return create_CreateSeqStmt( data, offset_to_index) * elif tag == structs.T_AlterSeqStmt: * return create_AlterSeqStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DefineStmt: * return create_DefineStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterSeqStmt(((AlterSeqStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2682 * elif tag == structs.T_CreateSeqStmt: * return create_CreateSeqStmt( data, offset_to_index) * elif tag == structs.T_AlterSeqStmt: # <<<<<<<<<<<<<< * return create_AlterSeqStmt( data, offset_to_index) * elif tag == structs.T_DefineStmt: */ break; case T_DefineStmt: /* "pglast/ast.pyx":2685 * return create_AlterSeqStmt( data, offset_to_index) * elif tag == structs.T_DefineStmt: * return create_DefineStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateDomainStmt: * return create_CreateDomainStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DefineStmt(((DefineStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2684 * elif tag == structs.T_AlterSeqStmt: * return create_AlterSeqStmt( data, offset_to_index) * elif tag == structs.T_DefineStmt: # <<<<<<<<<<<<<< * return create_DefineStmt( data, offset_to_index) * elif tag == structs.T_CreateDomainStmt: */ break; case T_CreateDomainStmt: /* "pglast/ast.pyx":2687 * return create_DefineStmt( data, offset_to_index) * elif tag == structs.T_CreateDomainStmt: * return create_CreateDomainStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateOpClassStmt: * return create_CreateOpClassStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateDomainStmt(((CreateDomainStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2686 * elif tag == structs.T_DefineStmt: * return create_DefineStmt( data, offset_to_index) * elif tag == structs.T_CreateDomainStmt: # <<<<<<<<<<<<<< * return create_CreateDomainStmt( data, offset_to_index) * elif tag == structs.T_CreateOpClassStmt: */ break; case T_CreateOpClassStmt: /* "pglast/ast.pyx":2689 * return create_CreateDomainStmt( data, offset_to_index) * elif tag == structs.T_CreateOpClassStmt: * return create_CreateOpClassStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateOpClassItem: * return create_CreateOpClassItem( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateOpClassStmt(((CreateOpClassStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2688 * elif tag == structs.T_CreateDomainStmt: * return create_CreateDomainStmt( data, offset_to_index) * elif tag == structs.T_CreateOpClassStmt: # <<<<<<<<<<<<<< * return create_CreateOpClassStmt( data, offset_to_index) * elif tag == structs.T_CreateOpClassItem: */ break; case T_CreateOpClassItem: /* "pglast/ast.pyx":2691 * return create_CreateOpClassStmt( data, offset_to_index) * elif tag == structs.T_CreateOpClassItem: * return create_CreateOpClassItem( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateOpFamilyStmt: * return create_CreateOpFamilyStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateOpClassItem(((CreateOpClassItem *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2690 * elif tag == structs.T_CreateOpClassStmt: * return create_CreateOpClassStmt( data, offset_to_index) * elif tag == structs.T_CreateOpClassItem: # <<<<<<<<<<<<<< * return create_CreateOpClassItem( data, offset_to_index) * elif tag == structs.T_CreateOpFamilyStmt: */ break; case T_CreateOpFamilyStmt: /* "pglast/ast.pyx":2693 * return create_CreateOpClassItem( data, offset_to_index) * elif tag == structs.T_CreateOpFamilyStmt: * return create_CreateOpFamilyStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterOpFamilyStmt: * return create_AlterOpFamilyStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateOpFamilyStmt(((CreateOpFamilyStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2692 * elif tag == structs.T_CreateOpClassItem: * return create_CreateOpClassItem( data, offset_to_index) * elif tag == structs.T_CreateOpFamilyStmt: # <<<<<<<<<<<<<< * return create_CreateOpFamilyStmt( data, offset_to_index) * elif tag == structs.T_AlterOpFamilyStmt: */ break; case T_AlterOpFamilyStmt: /* "pglast/ast.pyx":2695 * return create_CreateOpFamilyStmt( data, offset_to_index) * elif tag == structs.T_AlterOpFamilyStmt: * return create_AlterOpFamilyStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropStmt: * return create_DropStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterOpFamilyStmt(((AlterOpFamilyStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2694 * elif tag == structs.T_CreateOpFamilyStmt: * return create_CreateOpFamilyStmt( data, offset_to_index) * elif tag == structs.T_AlterOpFamilyStmt: # <<<<<<<<<<<<<< * return create_AlterOpFamilyStmt( data, offset_to_index) * elif tag == structs.T_DropStmt: */ break; case T_DropStmt: /* "pglast/ast.pyx":2697 * return create_AlterOpFamilyStmt( data, offset_to_index) * elif tag == structs.T_DropStmt: * return create_DropStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TruncateStmt: * return create_TruncateStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropStmt(((DropStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2696 * elif tag == structs.T_AlterOpFamilyStmt: * return create_AlterOpFamilyStmt( data, offset_to_index) * elif tag == structs.T_DropStmt: # <<<<<<<<<<<<<< * return create_DropStmt( data, offset_to_index) * elif tag == structs.T_TruncateStmt: */ break; case T_TruncateStmt: /* "pglast/ast.pyx":2699 * return create_DropStmt( data, offset_to_index) * elif tag == structs.T_TruncateStmt: * return create_TruncateStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CommentStmt: * return create_CommentStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TruncateStmt(((TruncateStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2698 * elif tag == structs.T_DropStmt: * return create_DropStmt( data, offset_to_index) * elif tag == structs.T_TruncateStmt: # <<<<<<<<<<<<<< * return create_TruncateStmt( data, offset_to_index) * elif tag == structs.T_CommentStmt: */ break; case T_CommentStmt: /* "pglast/ast.pyx":2701 * return create_TruncateStmt( data, offset_to_index) * elif tag == structs.T_CommentStmt: * return create_CommentStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_SecLabelStmt: * return create_SecLabelStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CommentStmt(((CommentStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2700 * elif tag == structs.T_TruncateStmt: * return create_TruncateStmt( data, offset_to_index) * elif tag == structs.T_CommentStmt: # <<<<<<<<<<<<<< * return create_CommentStmt( data, offset_to_index) * elif tag == structs.T_SecLabelStmt: */ break; case T_SecLabelStmt: /* "pglast/ast.pyx":2703 * return create_CommentStmt( data, offset_to_index) * elif tag == structs.T_SecLabelStmt: * return create_SecLabelStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DeclareCursorStmt: * return create_DeclareCursorStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_SecLabelStmt(((SecLabelStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2702 * elif tag == structs.T_CommentStmt: * return create_CommentStmt( data, offset_to_index) * elif tag == structs.T_SecLabelStmt: # <<<<<<<<<<<<<< * return create_SecLabelStmt( data, offset_to_index) * elif tag == structs.T_DeclareCursorStmt: */ break; case T_DeclareCursorStmt: /* "pglast/ast.pyx":2705 * return create_SecLabelStmt( data, offset_to_index) * elif tag == structs.T_DeclareCursorStmt: * return create_DeclareCursorStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ClosePortalStmt: * return create_ClosePortalStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DeclareCursorStmt(((DeclareCursorStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2704 * elif tag == structs.T_SecLabelStmt: * return create_SecLabelStmt( data, offset_to_index) * elif tag == structs.T_DeclareCursorStmt: # <<<<<<<<<<<<<< * return create_DeclareCursorStmt( data, offset_to_index) * elif tag == structs.T_ClosePortalStmt: */ break; case T_ClosePortalStmt: /* "pglast/ast.pyx":2707 * return create_DeclareCursorStmt( data, offset_to_index) * elif tag == structs.T_ClosePortalStmt: * return create_ClosePortalStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FetchStmt: * return create_FetchStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ClosePortalStmt(((ClosePortalStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2706 * elif tag == structs.T_DeclareCursorStmt: * return create_DeclareCursorStmt( data, offset_to_index) * elif tag == structs.T_ClosePortalStmt: # <<<<<<<<<<<<<< * return create_ClosePortalStmt( data, offset_to_index) * elif tag == structs.T_FetchStmt: */ break; case T_FetchStmt: /* "pglast/ast.pyx":2709 * return create_ClosePortalStmt( data, offset_to_index) * elif tag == structs.T_FetchStmt: * return create_FetchStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_IndexStmt: * return create_IndexStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FetchStmt(((FetchStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2708 * elif tag == structs.T_ClosePortalStmt: * return create_ClosePortalStmt( data, offset_to_index) * elif tag == structs.T_FetchStmt: # <<<<<<<<<<<<<< * return create_FetchStmt( data, offset_to_index) * elif tag == structs.T_IndexStmt: */ break; case T_IndexStmt: /* "pglast/ast.pyx":2711 * return create_FetchStmt( data, offset_to_index) * elif tag == structs.T_IndexStmt: * return create_IndexStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateStatsStmt: * return create_CreateStatsStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_IndexStmt(((IndexStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2710 * elif tag == structs.T_FetchStmt: * return create_FetchStmt( data, offset_to_index) * elif tag == structs.T_IndexStmt: # <<<<<<<<<<<<<< * return create_IndexStmt( data, offset_to_index) * elif tag == structs.T_CreateStatsStmt: */ break; case T_CreateStatsStmt: /* "pglast/ast.pyx":2713 * return create_IndexStmt( data, offset_to_index) * elif tag == structs.T_CreateStatsStmt: * return create_CreateStatsStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_StatsElem: * return create_StatsElem( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateStatsStmt(((CreateStatsStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2712 * elif tag == structs.T_IndexStmt: * return create_IndexStmt( data, offset_to_index) * elif tag == structs.T_CreateStatsStmt: # <<<<<<<<<<<<<< * return create_CreateStatsStmt( data, offset_to_index) * elif tag == structs.T_StatsElem: */ break; case T_StatsElem: /* "pglast/ast.pyx":2715 * return create_CreateStatsStmt( data, offset_to_index) * elif tag == structs.T_StatsElem: * return create_StatsElem( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterStatsStmt: * return create_AlterStatsStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_StatsElem(((StatsElem *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2714 * elif tag == structs.T_CreateStatsStmt: * return create_CreateStatsStmt( data, offset_to_index) * elif tag == structs.T_StatsElem: # <<<<<<<<<<<<<< * return create_StatsElem( data, offset_to_index) * elif tag == structs.T_AlterStatsStmt: */ break; case T_AlterStatsStmt: /* "pglast/ast.pyx":2717 * return create_StatsElem( data, offset_to_index) * elif tag == structs.T_AlterStatsStmt: * return create_AlterStatsStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateFunctionStmt: * return create_CreateFunctionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterStatsStmt(((AlterStatsStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2716 * elif tag == structs.T_StatsElem: * return create_StatsElem( data, offset_to_index) * elif tag == structs.T_AlterStatsStmt: # <<<<<<<<<<<<<< * return create_AlterStatsStmt( data, offset_to_index) * elif tag == structs.T_CreateFunctionStmt: */ break; case T_CreateFunctionStmt: /* "pglast/ast.pyx":2719 * return create_AlterStatsStmt( data, offset_to_index) * elif tag == structs.T_CreateFunctionStmt: * return create_CreateFunctionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_FunctionParameter: * return create_FunctionParameter( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateFunctionStmt(((CreateFunctionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2718 * elif tag == structs.T_AlterStatsStmt: * return create_AlterStatsStmt( data, offset_to_index) * elif tag == structs.T_CreateFunctionStmt: # <<<<<<<<<<<<<< * return create_CreateFunctionStmt( data, offset_to_index) * elif tag == structs.T_FunctionParameter: */ break; case T_FunctionParameter: /* "pglast/ast.pyx":2721 * return create_CreateFunctionStmt( data, offset_to_index) * elif tag == structs.T_FunctionParameter: * return create_FunctionParameter( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterFunctionStmt: * return create_AlterFunctionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_FunctionParameter(((FunctionParameter *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2720 * elif tag == structs.T_CreateFunctionStmt: * return create_CreateFunctionStmt( data, offset_to_index) * elif tag == structs.T_FunctionParameter: # <<<<<<<<<<<<<< * return create_FunctionParameter( data, offset_to_index) * elif tag == structs.T_AlterFunctionStmt: */ break; case T_AlterFunctionStmt: /* "pglast/ast.pyx":2723 * return create_FunctionParameter( data, offset_to_index) * elif tag == structs.T_AlterFunctionStmt: * return create_AlterFunctionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DoStmt: * return create_DoStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterFunctionStmt(((AlterFunctionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2722 * elif tag == structs.T_FunctionParameter: * return create_FunctionParameter( data, offset_to_index) * elif tag == structs.T_AlterFunctionStmt: # <<<<<<<<<<<<<< * return create_AlterFunctionStmt( data, offset_to_index) * elif tag == structs.T_DoStmt: */ break; case T_DoStmt: /* "pglast/ast.pyx":2725 * return create_AlterFunctionStmt( data, offset_to_index) * elif tag == structs.T_DoStmt: * return create_DoStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_InlineCodeBlock: * return create_InlineCodeBlock( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DoStmt(((DoStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2724 * elif tag == structs.T_AlterFunctionStmt: * return create_AlterFunctionStmt( data, offset_to_index) * elif tag == structs.T_DoStmt: # <<<<<<<<<<<<<< * return create_DoStmt( data, offset_to_index) * elif tag == structs.T_InlineCodeBlock: */ break; case T_InlineCodeBlock: /* "pglast/ast.pyx":2727 * return create_DoStmt( data, offset_to_index) * elif tag == structs.T_InlineCodeBlock: * return create_InlineCodeBlock( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CallStmt: * return create_CallStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_InlineCodeBlock(((InlineCodeBlock *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2726 * elif tag == structs.T_DoStmt: * return create_DoStmt( data, offset_to_index) * elif tag == structs.T_InlineCodeBlock: # <<<<<<<<<<<<<< * return create_InlineCodeBlock( data, offset_to_index) * elif tag == structs.T_CallStmt: */ break; case T_CallStmt: /* "pglast/ast.pyx":2729 * return create_InlineCodeBlock( data, offset_to_index) * elif tag == structs.T_CallStmt: * return create_CallStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CallContext: * return create_CallContext( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CallStmt(((CallStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2728 * elif tag == structs.T_InlineCodeBlock: * return create_InlineCodeBlock( data, offset_to_index) * elif tag == structs.T_CallStmt: # <<<<<<<<<<<<<< * return create_CallStmt( data, offset_to_index) * elif tag == structs.T_CallContext: */ break; case T_CallContext: /* "pglast/ast.pyx":2731 * return create_CallStmt( data, offset_to_index) * elif tag == structs.T_CallContext: * return create_CallContext( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RenameStmt: * return create_RenameStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CallContext(((CallContext *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2730 * elif tag == structs.T_CallStmt: * return create_CallStmt( data, offset_to_index) * elif tag == structs.T_CallContext: # <<<<<<<<<<<<<< * return create_CallContext( data, offset_to_index) * elif tag == structs.T_RenameStmt: */ break; case T_RenameStmt: /* "pglast/ast.pyx":2733 * return create_CallContext( data, offset_to_index) * elif tag == structs.T_RenameStmt: * return create_RenameStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterObjectDependsStmt: * return create_AlterObjectDependsStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RenameStmt(((RenameStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2732 * elif tag == structs.T_CallContext: * return create_CallContext( data, offset_to_index) * elif tag == structs.T_RenameStmt: # <<<<<<<<<<<<<< * return create_RenameStmt( data, offset_to_index) * elif tag == structs.T_AlterObjectDependsStmt: */ break; case T_AlterObjectDependsStmt: /* "pglast/ast.pyx":2735 * return create_RenameStmt( data, offset_to_index) * elif tag == structs.T_AlterObjectDependsStmt: * return create_AlterObjectDependsStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterObjectSchemaStmt: * return create_AlterObjectSchemaStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterObjectDependsStmt(((AlterObjectDependsStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2734 * elif tag == structs.T_RenameStmt: * return create_RenameStmt( data, offset_to_index) * elif tag == structs.T_AlterObjectDependsStmt: # <<<<<<<<<<<<<< * return create_AlterObjectDependsStmt( data, offset_to_index) * elif tag == structs.T_AlterObjectSchemaStmt: */ break; case T_AlterObjectSchemaStmt: /* "pglast/ast.pyx":2737 * return create_AlterObjectDependsStmt( data, offset_to_index) * elif tag == structs.T_AlterObjectSchemaStmt: * return create_AlterObjectSchemaStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterOwnerStmt: * return create_AlterOwnerStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterObjectSchemaStmt(((AlterObjectSchemaStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2736 * elif tag == structs.T_AlterObjectDependsStmt: * return create_AlterObjectDependsStmt( data, offset_to_index) * elif tag == structs.T_AlterObjectSchemaStmt: # <<<<<<<<<<<<<< * return create_AlterObjectSchemaStmt( data, offset_to_index) * elif tag == structs.T_AlterOwnerStmt: */ break; case T_AlterOwnerStmt: /* "pglast/ast.pyx":2739 * return create_AlterObjectSchemaStmt( data, offset_to_index) * elif tag == structs.T_AlterOwnerStmt: * return create_AlterOwnerStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterOperatorStmt: * return create_AlterOperatorStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterOwnerStmt(((AlterOwnerStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2738 * elif tag == structs.T_AlterObjectSchemaStmt: * return create_AlterObjectSchemaStmt( data, offset_to_index) * elif tag == structs.T_AlterOwnerStmt: # <<<<<<<<<<<<<< * return create_AlterOwnerStmt( data, offset_to_index) * elif tag == structs.T_AlterOperatorStmt: */ break; case T_AlterOperatorStmt: /* "pglast/ast.pyx":2741 * return create_AlterOwnerStmt( data, offset_to_index) * elif tag == structs.T_AlterOperatorStmt: * return create_AlterOperatorStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTypeStmt: * return create_AlterTypeStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterOperatorStmt(((AlterOperatorStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2740 * elif tag == structs.T_AlterOwnerStmt: * return create_AlterOwnerStmt( data, offset_to_index) * elif tag == structs.T_AlterOperatorStmt: # <<<<<<<<<<<<<< * return create_AlterOperatorStmt( data, offset_to_index) * elif tag == structs.T_AlterTypeStmt: */ break; case T_AlterTypeStmt: /* "pglast/ast.pyx":2743 * return create_AlterOperatorStmt( data, offset_to_index) * elif tag == structs.T_AlterTypeStmt: * return create_AlterTypeStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RuleStmt: * return create_RuleStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTypeStmt(((AlterTypeStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2742 * elif tag == structs.T_AlterOperatorStmt: * return create_AlterOperatorStmt( data, offset_to_index) * elif tag == structs.T_AlterTypeStmt: # <<<<<<<<<<<<<< * return create_AlterTypeStmt( data, offset_to_index) * elif tag == structs.T_RuleStmt: */ break; case T_RuleStmt: /* "pglast/ast.pyx":2745 * return create_AlterTypeStmt( data, offset_to_index) * elif tag == structs.T_RuleStmt: * return create_RuleStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_NotifyStmt: * return create_NotifyStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RuleStmt(((RuleStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2744 * elif tag == structs.T_AlterTypeStmt: * return create_AlterTypeStmt( data, offset_to_index) * elif tag == structs.T_RuleStmt: # <<<<<<<<<<<<<< * return create_RuleStmt( data, offset_to_index) * elif tag == structs.T_NotifyStmt: */ break; case T_NotifyStmt: /* "pglast/ast.pyx":2747 * return create_RuleStmt( data, offset_to_index) * elif tag == structs.T_NotifyStmt: * return create_NotifyStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ListenStmt: * return create_ListenStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_NotifyStmt(((NotifyStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2746 * elif tag == structs.T_RuleStmt: * return create_RuleStmt( data, offset_to_index) * elif tag == structs.T_NotifyStmt: # <<<<<<<<<<<<<< * return create_NotifyStmt( data, offset_to_index) * elif tag == structs.T_ListenStmt: */ break; case T_ListenStmt: /* "pglast/ast.pyx":2749 * return create_NotifyStmt( data, offset_to_index) * elif tag == structs.T_ListenStmt: * return create_ListenStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_UnlistenStmt: * return create_UnlistenStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ListenStmt(((ListenStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2748 * elif tag == structs.T_NotifyStmt: * return create_NotifyStmt( data, offset_to_index) * elif tag == structs.T_ListenStmt: # <<<<<<<<<<<<<< * return create_ListenStmt( data, offset_to_index) * elif tag == structs.T_UnlistenStmt: */ break; case T_UnlistenStmt: /* "pglast/ast.pyx":2751 * return create_ListenStmt( data, offset_to_index) * elif tag == structs.T_UnlistenStmt: * return create_UnlistenStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_TransactionStmt: * return create_TransactionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_UnlistenStmt(((UnlistenStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2750 * elif tag == structs.T_ListenStmt: * return create_ListenStmt( data, offset_to_index) * elif tag == structs.T_UnlistenStmt: # <<<<<<<<<<<<<< * return create_UnlistenStmt( data, offset_to_index) * elif tag == structs.T_TransactionStmt: */ break; case T_TransactionStmt: /* "pglast/ast.pyx":2753 * return create_UnlistenStmt( data, offset_to_index) * elif tag == structs.T_TransactionStmt: * return create_TransactionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CompositeTypeStmt: * return create_CompositeTypeStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_TransactionStmt(((TransactionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2752 * elif tag == structs.T_UnlistenStmt: * return create_UnlistenStmt( data, offset_to_index) * elif tag == structs.T_TransactionStmt: # <<<<<<<<<<<<<< * return create_TransactionStmt( data, offset_to_index) * elif tag == structs.T_CompositeTypeStmt: */ break; case T_CompositeTypeStmt: /* "pglast/ast.pyx":2755 * return create_TransactionStmt( data, offset_to_index) * elif tag == structs.T_CompositeTypeStmt: * return create_CompositeTypeStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateEnumStmt: * return create_CreateEnumStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CompositeTypeStmt(((CompositeTypeStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2754 * elif tag == structs.T_TransactionStmt: * return create_TransactionStmt( data, offset_to_index) * elif tag == structs.T_CompositeTypeStmt: # <<<<<<<<<<<<<< * return create_CompositeTypeStmt( data, offset_to_index) * elif tag == structs.T_CreateEnumStmt: */ break; case T_CreateEnumStmt: /* "pglast/ast.pyx":2757 * return create_CompositeTypeStmt( data, offset_to_index) * elif tag == structs.T_CreateEnumStmt: * return create_CreateEnumStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateRangeStmt: * return create_CreateRangeStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateEnumStmt(((CreateEnumStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2756 * elif tag == structs.T_CompositeTypeStmt: * return create_CompositeTypeStmt( data, offset_to_index) * elif tag == structs.T_CreateEnumStmt: # <<<<<<<<<<<<<< * return create_CreateEnumStmt( data, offset_to_index) * elif tag == structs.T_CreateRangeStmt: */ break; case T_CreateRangeStmt: /* "pglast/ast.pyx":2759 * return create_CreateEnumStmt( data, offset_to_index) * elif tag == structs.T_CreateRangeStmt: * return create_CreateRangeStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterEnumStmt: * return create_AlterEnumStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateRangeStmt(((CreateRangeStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2758 * elif tag == structs.T_CreateEnumStmt: * return create_CreateEnumStmt( data, offset_to_index) * elif tag == structs.T_CreateRangeStmt: # <<<<<<<<<<<<<< * return create_CreateRangeStmt( data, offset_to_index) * elif tag == structs.T_AlterEnumStmt: */ break; case T_AlterEnumStmt: /* "pglast/ast.pyx":2761 * return create_CreateRangeStmt( data, offset_to_index) * elif tag == structs.T_AlterEnumStmt: * return create_AlterEnumStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ViewStmt: * return create_ViewStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterEnumStmt(((AlterEnumStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2760 * elif tag == structs.T_CreateRangeStmt: * return create_CreateRangeStmt( data, offset_to_index) * elif tag == structs.T_AlterEnumStmt: # <<<<<<<<<<<<<< * return create_AlterEnumStmt( data, offset_to_index) * elif tag == structs.T_ViewStmt: */ break; case T_ViewStmt: /* "pglast/ast.pyx":2763 * return create_AlterEnumStmt( data, offset_to_index) * elif tag == structs.T_ViewStmt: * return create_ViewStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_LoadStmt: * return create_LoadStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ViewStmt(((ViewStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2762 * elif tag == structs.T_AlterEnumStmt: * return create_AlterEnumStmt( data, offset_to_index) * elif tag == structs.T_ViewStmt: # <<<<<<<<<<<<<< * return create_ViewStmt( data, offset_to_index) * elif tag == structs.T_LoadStmt: */ break; case T_LoadStmt: /* "pglast/ast.pyx":2765 * return create_ViewStmt( data, offset_to_index) * elif tag == structs.T_LoadStmt: * return create_LoadStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreatedbStmt: * return create_CreatedbStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_LoadStmt(((LoadStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2764 * elif tag == structs.T_ViewStmt: * return create_ViewStmt( data, offset_to_index) * elif tag == structs.T_LoadStmt: # <<<<<<<<<<<<<< * return create_LoadStmt( data, offset_to_index) * elif tag == structs.T_CreatedbStmt: */ break; case T_CreatedbStmt: /* "pglast/ast.pyx":2767 * return create_LoadStmt( data, offset_to_index) * elif tag == structs.T_CreatedbStmt: * return create_CreatedbStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterDatabaseStmt: * return create_AlterDatabaseStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreatedbStmt(((CreatedbStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2766 * elif tag == structs.T_LoadStmt: * return create_LoadStmt( data, offset_to_index) * elif tag == structs.T_CreatedbStmt: # <<<<<<<<<<<<<< * return create_CreatedbStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseStmt: */ break; case T_AlterDatabaseStmt: /* "pglast/ast.pyx":2769 * return create_CreatedbStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseStmt: * return create_AlterDatabaseStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterDatabaseRefreshCollStmt: * return create_AlterDatabaseRefreshCollStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterDatabaseStmt(((AlterDatabaseStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2768 * elif tag == structs.T_CreatedbStmt: * return create_CreatedbStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseStmt: # <<<<<<<<<<<<<< * return create_AlterDatabaseStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseRefreshCollStmt: */ break; case T_AlterDatabaseRefreshCollStmt: /* "pglast/ast.pyx":2771 * return create_AlterDatabaseStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseRefreshCollStmt: * return create_AlterDatabaseRefreshCollStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterDatabaseSetStmt: * return create_AlterDatabaseSetStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterDatabaseRefreshCollStmt(((AlterDatabaseRefreshCollStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2770 * elif tag == structs.T_AlterDatabaseStmt: * return create_AlterDatabaseStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseRefreshCollStmt: # <<<<<<<<<<<<<< * return create_AlterDatabaseRefreshCollStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseSetStmt: */ break; case T_AlterDatabaseSetStmt: /* "pglast/ast.pyx":2773 * return create_AlterDatabaseRefreshCollStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseSetStmt: * return create_AlterDatabaseSetStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropdbStmt: * return create_DropdbStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterDatabaseSetStmt(((AlterDatabaseSetStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2772 * elif tag == structs.T_AlterDatabaseRefreshCollStmt: * return create_AlterDatabaseRefreshCollStmt( data, offset_to_index) * elif tag == structs.T_AlterDatabaseSetStmt: # <<<<<<<<<<<<<< * return create_AlterDatabaseSetStmt( data, offset_to_index) * elif tag == structs.T_DropdbStmt: */ break; case T_DropdbStmt: /* "pglast/ast.pyx":2775 * return create_AlterDatabaseSetStmt( data, offset_to_index) * elif tag == structs.T_DropdbStmt: * return create_DropdbStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterSystemStmt: * return create_AlterSystemStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropdbStmt(((DropdbStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2774 * elif tag == structs.T_AlterDatabaseSetStmt: * return create_AlterDatabaseSetStmt( data, offset_to_index) * elif tag == structs.T_DropdbStmt: # <<<<<<<<<<<<<< * return create_DropdbStmt( data, offset_to_index) * elif tag == structs.T_AlterSystemStmt: */ break; case T_AlterSystemStmt: /* "pglast/ast.pyx":2777 * return create_DropdbStmt( data, offset_to_index) * elif tag == structs.T_AlterSystemStmt: * return create_AlterSystemStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ClusterStmt: * return create_ClusterStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterSystemStmt(((AlterSystemStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2776 * elif tag == structs.T_DropdbStmt: * return create_DropdbStmt( data, offset_to_index) * elif tag == structs.T_AlterSystemStmt: # <<<<<<<<<<<<<< * return create_AlterSystemStmt( data, offset_to_index) * elif tag == structs.T_ClusterStmt: */ break; case T_ClusterStmt: /* "pglast/ast.pyx":2779 * return create_AlterSystemStmt( data, offset_to_index) * elif tag == structs.T_ClusterStmt: * return create_ClusterStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_VacuumStmt: * return create_VacuumStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ClusterStmt(((ClusterStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2778 * elif tag == structs.T_AlterSystemStmt: * return create_AlterSystemStmt( data, offset_to_index) * elif tag == structs.T_ClusterStmt: # <<<<<<<<<<<<<< * return create_ClusterStmt( data, offset_to_index) * elif tag == structs.T_VacuumStmt: */ break; case T_VacuumStmt: /* "pglast/ast.pyx":2781 * return create_ClusterStmt( data, offset_to_index) * elif tag == structs.T_VacuumStmt: * return create_VacuumStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_VacuumRelation: * return create_VacuumRelation( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_VacuumStmt(((VacuumStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2780 * elif tag == structs.T_ClusterStmt: * return create_ClusterStmt( data, offset_to_index) * elif tag == structs.T_VacuumStmt: # <<<<<<<<<<<<<< * return create_VacuumStmt( data, offset_to_index) * elif tag == structs.T_VacuumRelation: */ break; case T_VacuumRelation: /* "pglast/ast.pyx":2783 * return create_VacuumStmt( data, offset_to_index) * elif tag == structs.T_VacuumRelation: * return create_VacuumRelation( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ExplainStmt: * return create_ExplainStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_VacuumRelation(((VacuumRelation *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2782 * elif tag == structs.T_VacuumStmt: * return create_VacuumStmt( data, offset_to_index) * elif tag == structs.T_VacuumRelation: # <<<<<<<<<<<<<< * return create_VacuumRelation( data, offset_to_index) * elif tag == structs.T_ExplainStmt: */ break; case T_ExplainStmt: /* "pglast/ast.pyx":2785 * return create_VacuumRelation( data, offset_to_index) * elif tag == structs.T_ExplainStmt: * return create_ExplainStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateTableAsStmt: * return create_CreateTableAsStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ExplainStmt(((ExplainStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2784 * elif tag == structs.T_VacuumRelation: * return create_VacuumRelation( data, offset_to_index) * elif tag == structs.T_ExplainStmt: # <<<<<<<<<<<<<< * return create_ExplainStmt( data, offset_to_index) * elif tag == structs.T_CreateTableAsStmt: */ break; case T_CreateTableAsStmt: /* "pglast/ast.pyx":2787 * return create_ExplainStmt( data, offset_to_index) * elif tag == structs.T_CreateTableAsStmt: * return create_CreateTableAsStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_RefreshMatViewStmt: * return create_RefreshMatViewStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateTableAsStmt(((CreateTableAsStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2786 * elif tag == structs.T_ExplainStmt: * return create_ExplainStmt( data, offset_to_index) * elif tag == structs.T_CreateTableAsStmt: # <<<<<<<<<<<<<< * return create_CreateTableAsStmt( data, offset_to_index) * elif tag == structs.T_RefreshMatViewStmt: */ break; case T_RefreshMatViewStmt: /* "pglast/ast.pyx":2789 * return create_CreateTableAsStmt( data, offset_to_index) * elif tag == structs.T_RefreshMatViewStmt: * return create_RefreshMatViewStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CheckPointStmt: * return create_CheckPointStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_RefreshMatViewStmt(((RefreshMatViewStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2788 * elif tag == structs.T_CreateTableAsStmt: * return create_CreateTableAsStmt( data, offset_to_index) * elif tag == structs.T_RefreshMatViewStmt: # <<<<<<<<<<<<<< * return create_RefreshMatViewStmt( data, offset_to_index) * elif tag == structs.T_CheckPointStmt: */ break; case T_CheckPointStmt: /* "pglast/ast.pyx":2791 * return create_RefreshMatViewStmt( data, offset_to_index) * elif tag == structs.T_CheckPointStmt: * return create_CheckPointStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DiscardStmt: * return create_DiscardStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CheckPointStmt(((CheckPointStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2790 * elif tag == structs.T_RefreshMatViewStmt: * return create_RefreshMatViewStmt( data, offset_to_index) * elif tag == structs.T_CheckPointStmt: # <<<<<<<<<<<<<< * return create_CheckPointStmt( data, offset_to_index) * elif tag == structs.T_DiscardStmt: */ break; case T_DiscardStmt: /* "pglast/ast.pyx":2793 * return create_CheckPointStmt( data, offset_to_index) * elif tag == structs.T_DiscardStmt: * return create_DiscardStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_LockStmt: * return create_LockStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DiscardStmt(((DiscardStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2792 * elif tag == structs.T_CheckPointStmt: * return create_CheckPointStmt( data, offset_to_index) * elif tag == structs.T_DiscardStmt: # <<<<<<<<<<<<<< * return create_DiscardStmt( data, offset_to_index) * elif tag == structs.T_LockStmt: */ break; case T_LockStmt: /* "pglast/ast.pyx":2795 * return create_DiscardStmt( data, offset_to_index) * elif tag == structs.T_LockStmt: * return create_LockStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ConstraintsSetStmt: * return create_ConstraintsSetStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_LockStmt(((LockStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2794 * elif tag == structs.T_DiscardStmt: * return create_DiscardStmt( data, offset_to_index) * elif tag == structs.T_LockStmt: # <<<<<<<<<<<<<< * return create_LockStmt( data, offset_to_index) * elif tag == structs.T_ConstraintsSetStmt: */ break; case T_ConstraintsSetStmt: /* "pglast/ast.pyx":2797 * return create_LockStmt( data, offset_to_index) * elif tag == structs.T_ConstraintsSetStmt: * return create_ConstraintsSetStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ReindexStmt: * return create_ReindexStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ConstraintsSetStmt(((ConstraintsSetStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2796 * elif tag == structs.T_LockStmt: * return create_LockStmt( data, offset_to_index) * elif tag == structs.T_ConstraintsSetStmt: # <<<<<<<<<<<<<< * return create_ConstraintsSetStmt( data, offset_to_index) * elif tag == structs.T_ReindexStmt: */ break; case T_ReindexStmt: /* "pglast/ast.pyx":2799 * return create_ConstraintsSetStmt( data, offset_to_index) * elif tag == structs.T_ReindexStmt: * return create_ReindexStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateConversionStmt: * return create_CreateConversionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ReindexStmt(((ReindexStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2798 * elif tag == structs.T_ConstraintsSetStmt: * return create_ConstraintsSetStmt( data, offset_to_index) * elif tag == structs.T_ReindexStmt: # <<<<<<<<<<<<<< * return create_ReindexStmt( data, offset_to_index) * elif tag == structs.T_CreateConversionStmt: */ break; case T_CreateConversionStmt: /* "pglast/ast.pyx":2801 * return create_ReindexStmt( data, offset_to_index) * elif tag == structs.T_CreateConversionStmt: * return create_CreateConversionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateCastStmt: * return create_CreateCastStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateConversionStmt(((CreateConversionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2800 * elif tag == structs.T_ReindexStmt: * return create_ReindexStmt( data, offset_to_index) * elif tag == structs.T_CreateConversionStmt: # <<<<<<<<<<<<<< * return create_CreateConversionStmt( data, offset_to_index) * elif tag == structs.T_CreateCastStmt: */ break; case T_CreateCastStmt: /* "pglast/ast.pyx":2803 * return create_CreateConversionStmt( data, offset_to_index) * elif tag == structs.T_CreateCastStmt: * return create_CreateCastStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateTransformStmt: * return create_CreateTransformStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateCastStmt(((CreateCastStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2802 * elif tag == structs.T_CreateConversionStmt: * return create_CreateConversionStmt( data, offset_to_index) * elif tag == structs.T_CreateCastStmt: # <<<<<<<<<<<<<< * return create_CreateCastStmt( data, offset_to_index) * elif tag == structs.T_CreateTransformStmt: */ break; case T_CreateTransformStmt: /* "pglast/ast.pyx":2805 * return create_CreateCastStmt( data, offset_to_index) * elif tag == structs.T_CreateTransformStmt: * return create_CreateTransformStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PrepareStmt: * return create_PrepareStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateTransformStmt(((CreateTransformStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2804 * elif tag == structs.T_CreateCastStmt: * return create_CreateCastStmt( data, offset_to_index) * elif tag == structs.T_CreateTransformStmt: # <<<<<<<<<<<<<< * return create_CreateTransformStmt( data, offset_to_index) * elif tag == structs.T_PrepareStmt: */ break; case T_PrepareStmt: /* "pglast/ast.pyx":2807 * return create_CreateTransformStmt( data, offset_to_index) * elif tag == structs.T_PrepareStmt: * return create_PrepareStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ExecuteStmt: * return create_ExecuteStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PrepareStmt(((PrepareStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2806 * elif tag == structs.T_CreateTransformStmt: * return create_CreateTransformStmt( data, offset_to_index) * elif tag == structs.T_PrepareStmt: # <<<<<<<<<<<<<< * return create_PrepareStmt( data, offset_to_index) * elif tag == structs.T_ExecuteStmt: */ break; case T_ExecuteStmt: /* "pglast/ast.pyx":2809 * return create_PrepareStmt( data, offset_to_index) * elif tag == structs.T_ExecuteStmt: * return create_ExecuteStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DeallocateStmt: * return create_DeallocateStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ExecuteStmt(((ExecuteStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2808 * elif tag == structs.T_PrepareStmt: * return create_PrepareStmt( data, offset_to_index) * elif tag == structs.T_ExecuteStmt: # <<<<<<<<<<<<<< * return create_ExecuteStmt( data, offset_to_index) * elif tag == structs.T_DeallocateStmt: */ break; case T_DeallocateStmt: /* "pglast/ast.pyx":2811 * return create_ExecuteStmt( data, offset_to_index) * elif tag == structs.T_DeallocateStmt: * return create_DeallocateStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropOwnedStmt: * return create_DropOwnedStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DeallocateStmt(((DeallocateStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2810 * elif tag == structs.T_ExecuteStmt: * return create_ExecuteStmt( data, offset_to_index) * elif tag == structs.T_DeallocateStmt: # <<<<<<<<<<<<<< * return create_DeallocateStmt( data, offset_to_index) * elif tag == structs.T_DropOwnedStmt: */ break; case T_DropOwnedStmt: /* "pglast/ast.pyx":2813 * return create_DeallocateStmt( data, offset_to_index) * elif tag == structs.T_DropOwnedStmt: * return create_DropOwnedStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_ReassignOwnedStmt: * return create_ReassignOwnedStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropOwnedStmt(((DropOwnedStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2812 * elif tag == structs.T_DeallocateStmt: * return create_DeallocateStmt( data, offset_to_index) * elif tag == structs.T_DropOwnedStmt: # <<<<<<<<<<<<<< * return create_DropOwnedStmt( data, offset_to_index) * elif tag == structs.T_ReassignOwnedStmt: */ break; case T_ReassignOwnedStmt: /* "pglast/ast.pyx":2815 * return create_DropOwnedStmt( data, offset_to_index) * elif tag == structs.T_ReassignOwnedStmt: * return create_ReassignOwnedStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTSDictionaryStmt: * return create_AlterTSDictionaryStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_ReassignOwnedStmt(((ReassignOwnedStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2814 * elif tag == structs.T_DropOwnedStmt: * return create_DropOwnedStmt( data, offset_to_index) * elif tag == structs.T_ReassignOwnedStmt: # <<<<<<<<<<<<<< * return create_ReassignOwnedStmt( data, offset_to_index) * elif tag == structs.T_AlterTSDictionaryStmt: */ break; case T_AlterTSDictionaryStmt: /* "pglast/ast.pyx":2817 * return create_ReassignOwnedStmt( data, offset_to_index) * elif tag == structs.T_AlterTSDictionaryStmt: * return create_AlterTSDictionaryStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterTSConfigurationStmt: * return create_AlterTSConfigurationStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTSDictionaryStmt(((AlterTSDictionaryStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2816 * elif tag == structs.T_ReassignOwnedStmt: * return create_ReassignOwnedStmt( data, offset_to_index) * elif tag == structs.T_AlterTSDictionaryStmt: # <<<<<<<<<<<<<< * return create_AlterTSDictionaryStmt( data, offset_to_index) * elif tag == structs.T_AlterTSConfigurationStmt: */ break; case T_AlterTSConfigurationStmt: /* "pglast/ast.pyx":2819 * return create_AlterTSDictionaryStmt( data, offset_to_index) * elif tag == structs.T_AlterTSConfigurationStmt: * return create_AlterTSConfigurationStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PublicationTable: * return create_PublicationTable( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterTSConfigurationStmt(((AlterTSConfigurationStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2818 * elif tag == structs.T_AlterTSDictionaryStmt: * return create_AlterTSDictionaryStmt( data, offset_to_index) * elif tag == structs.T_AlterTSConfigurationStmt: # <<<<<<<<<<<<<< * return create_AlterTSConfigurationStmt( data, offset_to_index) * elif tag == structs.T_PublicationTable: */ break; case T_PublicationTable: /* "pglast/ast.pyx":2821 * return create_AlterTSConfigurationStmt( data, offset_to_index) * elif tag == structs.T_PublicationTable: * return create_PublicationTable( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_PublicationObjSpec: * return create_PublicationObjSpec( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PublicationTable(((PublicationTable *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2820 * elif tag == structs.T_AlterTSConfigurationStmt: * return create_AlterTSConfigurationStmt( data, offset_to_index) * elif tag == structs.T_PublicationTable: # <<<<<<<<<<<<<< * return create_PublicationTable( data, offset_to_index) * elif tag == structs.T_PublicationObjSpec: */ break; case T_PublicationObjSpec: /* "pglast/ast.pyx":2823 * return create_PublicationTable( data, offset_to_index) * elif tag == structs.T_PublicationObjSpec: * return create_PublicationObjSpec( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreatePublicationStmt: * return create_CreatePublicationStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_PublicationObjSpec(((PublicationObjSpec *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2822 * elif tag == structs.T_PublicationTable: * return create_PublicationTable( data, offset_to_index) * elif tag == structs.T_PublicationObjSpec: # <<<<<<<<<<<<<< * return create_PublicationObjSpec( data, offset_to_index) * elif tag == structs.T_CreatePublicationStmt: */ break; case T_CreatePublicationStmt: /* "pglast/ast.pyx":2825 * return create_PublicationObjSpec( data, offset_to_index) * elif tag == structs.T_CreatePublicationStmt: * return create_CreatePublicationStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterPublicationStmt: * return create_AlterPublicationStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreatePublicationStmt(((CreatePublicationStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2824 * elif tag == structs.T_PublicationObjSpec: * return create_PublicationObjSpec( data, offset_to_index) * elif tag == structs.T_CreatePublicationStmt: # <<<<<<<<<<<<<< * return create_CreatePublicationStmt( data, offset_to_index) * elif tag == structs.T_AlterPublicationStmt: */ break; case T_AlterPublicationStmt: /* "pglast/ast.pyx":2827 * return create_CreatePublicationStmt( data, offset_to_index) * elif tag == structs.T_AlterPublicationStmt: * return create_AlterPublicationStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_CreateSubscriptionStmt: * return create_CreateSubscriptionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterPublicationStmt(((AlterPublicationStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2826 * elif tag == structs.T_CreatePublicationStmt: * return create_CreatePublicationStmt( data, offset_to_index) * elif tag == structs.T_AlterPublicationStmt: # <<<<<<<<<<<<<< * return create_AlterPublicationStmt( data, offset_to_index) * elif tag == structs.T_CreateSubscriptionStmt: */ break; case T_CreateSubscriptionStmt: /* "pglast/ast.pyx":2829 * return create_AlterPublicationStmt( data, offset_to_index) * elif tag == structs.T_CreateSubscriptionStmt: * return create_CreateSubscriptionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_AlterSubscriptionStmt: * return create_AlterSubscriptionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_CreateSubscriptionStmt(((CreateSubscriptionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2828 * elif tag == structs.T_AlterPublicationStmt: * return create_AlterPublicationStmt( data, offset_to_index) * elif tag == structs.T_CreateSubscriptionStmt: # <<<<<<<<<<<<<< * return create_CreateSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_AlterSubscriptionStmt: */ break; case T_AlterSubscriptionStmt: /* "pglast/ast.pyx":2831 * return create_CreateSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_AlterSubscriptionStmt: * return create_AlterSubscriptionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_DropSubscriptionStmt: * return create_DropSubscriptionStmt( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_AlterSubscriptionStmt(((AlterSubscriptionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2830 * elif tag == structs.T_CreateSubscriptionStmt: * return create_CreateSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_AlterSubscriptionStmt: # <<<<<<<<<<<<<< * return create_AlterSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_DropSubscriptionStmt: */ break; case T_DropSubscriptionStmt: /* "pglast/ast.pyx":2833 * return create_AlterSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_DropSubscriptionStmt: * return create_DropSubscriptionStmt( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Integer: * return create_Integer( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_DropSubscriptionStmt(((DropSubscriptionStmt *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2832 * elif tag == structs.T_AlterSubscriptionStmt: * return create_AlterSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_DropSubscriptionStmt: # <<<<<<<<<<<<<< * return create_DropSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_Integer: */ break; case T_Integer: /* "pglast/ast.pyx":2835 * return create_DropSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_Integer: * return create_Integer( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Float: * return create_Float( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Integer(((Integer *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2834 * elif tag == structs.T_DropSubscriptionStmt: * return create_DropSubscriptionStmt( data, offset_to_index) * elif tag == structs.T_Integer: # <<<<<<<<<<<<<< * return create_Integer( data, offset_to_index) * elif tag == structs.T_Float: */ break; case T_Float: /* "pglast/ast.pyx":2837 * return create_Integer( data, offset_to_index) * elif tag == structs.T_Float: * return create_Float( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_Boolean: * return create_Boolean( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Float(((Float *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2836 * elif tag == structs.T_Integer: * return create_Integer( data, offset_to_index) * elif tag == structs.T_Float: # <<<<<<<<<<<<<< * return create_Float( data, offset_to_index) * elif tag == structs.T_Boolean: */ break; case T_Boolean: /* "pglast/ast.pyx":2839 * return create_Float( data, offset_to_index) * elif tag == structs.T_Boolean: * return create_Boolean( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_String: * return create_String( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_Boolean(((Boolean *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2838 * elif tag == structs.T_Float: * return create_Float( data, offset_to_index) * elif tag == structs.T_Boolean: # <<<<<<<<<<<<<< * return create_Boolean( data, offset_to_index) * elif tag == structs.T_String: */ break; case T_String: /* "pglast/ast.pyx":2841 * return create_Boolean( data, offset_to_index) * elif tag == structs.T_String: * return create_String( data, offset_to_index) # <<<<<<<<<<<<<< * elif tag == structs.T_BitString: * return create_BitString( data, offset_to_index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_String(((String *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2840 * elif tag == structs.T_Boolean: * return create_Boolean( data, offset_to_index) * elif tag == structs.T_String: # <<<<<<<<<<<<<< * return create_String( data, offset_to_index) * elif tag == structs.T_BitString: */ break; case T_BitString: /* "pglast/ast.pyx":2843 * return create_String( data, offset_to_index) * elif tag == structs.T_BitString: * return create_BitString( data, offset_to_index) # <<<<<<<<<<<<<< * raise ValueError("Unhandled tag: %s" % tag) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_6pglast_6parser_create_BitString(((BitString *)__pyx_v_data), __pyx_v_offset_to_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/ast.pyx":2842 * elif tag == structs.T_String: * return create_String( data, offset_to_index) * elif tag == structs.T_BitString: # <<<<<<<<<<<<<< * return create_BitString( data, offset_to_index) * raise ValueError("Unhandled tag: %s" % tag) */ break; default: break; } /* "pglast/ast.pyx":2844 * elif tag == structs.T_BitString: * return create_BitString( data, offset_to_index) * raise ValueError("Unhandled tag: %s" % tag) # <<<<<<<<<<<<<< */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Unhandled_tag_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 2844, __pyx_L1_error) /* "pglast/ast.pyx":2315 * * * cdef create(void* data, offset_to_index): # <<<<<<<<<<<<<< * if data is NULL: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pglast.parser.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":28 * "Exception representing the error state returned by the PG parser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_10ParseError_1__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_6pglast_6parser_10ParseError_1__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_10ParseError_1__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pglast_6parser_10ParseError_1__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(1, 28, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 28, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.ParseError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pglast_6parser_10ParseError___str__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_10ParseError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_message = NULL; PyObject *__pyx_v_location = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); /* "pglast/parser.pyx":29 * * def __str__(self): * message = self.args[0] # <<<<<<<<<<<<<< * if len(self.args) > 1: * location = self.args[1] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_message = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/parser.pyx":30 * def __str__(self): * message = self.args[0] * if len(self.args) > 1: # <<<<<<<<<<<<<< * location = self.args[1] * if location is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 > 1); if (__pyx_t_4) { /* "pglast/parser.pyx":31 * message = self.args[0] * if len(self.args) > 1: * location = self.args[1] # <<<<<<<<<<<<<< * if location is not None: * message += f', at index {location}' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":32 * if len(self.args) > 1: * location = self.args[1] * if location is not None: # <<<<<<<<<<<<<< * message += f', at index {location}' * return message */ __pyx_t_4 = (__pyx_v_location != Py_None); if (__pyx_t_4) { /* "pglast/parser.pyx":33 * location = self.args[1] * if location is not None: * message += f', at index {location}' # <<<<<<<<<<<<<< * return message * */ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_location, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_at_index, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":32 * if len(self.args) > 1: * location = self.args[1] * if location is not None: # <<<<<<<<<<<<<< * message += f', at index {location}' * return message */ } /* "pglast/parser.pyx":30 * def __str__(self): * message = self.args[0] * if len(self.args) > 1: # <<<<<<<<<<<<<< * location = self.args[1] * if location is not None: */ } /* "pglast/parser.pyx":34 * if location is not None: * message += f', at index {location}' * return message # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_message); __pyx_r = __pyx_v_message; goto __pyx_L0; /* "pglast/parser.pyx":28 * "Exception representing the error state returned by the PG parser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pglast.parser.ParseError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF(__pyx_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":40 * "Exception representing the error state returned by the PG deparser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_12DeparseError_1__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_6pglast_6parser_12DeparseError_1__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_12DeparseError_1__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pglast_6parser_12DeparseError_1__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(1, 40, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 40, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.DeparseError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pglast_6parser_12DeparseError___str__(__pyx_self, __pyx_v_self); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_12DeparseError___str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_message = NULL; PyObject *__pyx_v_location = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); /* "pglast/parser.pyx":41 * * def __str__(self): * message = self.args[0] # <<<<<<<<<<<<<< * if len(self.args) > 1: * location = self.args[1] */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_message = __pyx_t_2; __pyx_t_2 = 0; /* "pglast/parser.pyx":42 * def __str__(self): * message = self.args[0] * if len(self.args) > 1: # <<<<<<<<<<<<<< * location = self.args[1] * if location is not None: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 > 1); if (__pyx_t_4) { /* "pglast/parser.pyx":43 * message = self.args[0] * if len(self.args) > 1: * location = self.args[1] # <<<<<<<<<<<<<< * if location is not None: * message += f', at position {location}' */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_location = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":44 * if len(self.args) > 1: * location = self.args[1] * if location is not None: # <<<<<<<<<<<<<< * message += f', at position {location}' * return message */ __pyx_t_4 = (__pyx_v_location != Py_None); if (__pyx_t_4) { /* "pglast/parser.pyx":45 * location = self.args[1] * if location is not None: * message += f', at position {location}' # <<<<<<<<<<<<<< * return message * */ __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_location, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_at_position, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_message, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":44 * if len(self.args) > 1: * location = self.args[1] * if location is not None: # <<<<<<<<<<<<<< * message += f', at position {location}' * return message */ } /* "pglast/parser.pyx":42 * def __str__(self): * message = self.args[0] * if len(self.args) > 1: # <<<<<<<<<<<<<< * location = self.args[1] * if location is not None: */ } /* "pglast/parser.pyx":46 * if location is not None: * message += f', at position {location}' * return message # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_message); __pyx_r = __pyx_v_message; goto __pyx_L0; /* "pglast/parser.pyx":40 * "Exception representing the error state returned by the PG deparser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pglast.parser.DeparseError.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF(__pyx_v_location); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":208 * cdef unsigned long max_offset * * def __init__(self, str s): # <<<<<<<<<<<<<< * cdef unsigned long idx = 0 * cdef unsigned long ofs = 0 */ /* Python wrapper */ static int __pyx_pw_6pglast_6parser_13Displacements_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_6pglast_6parser_13Displacements_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_s = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 208, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 208, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_s = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 208, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.Displacements.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 1, "s", 1))) __PYX_ERR(1, 208, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_13Displacements___init__(((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_v_self), __pyx_v_s); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_6pglast_6parser_13Displacements___init__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self, PyObject *__pyx_v_s) { unsigned long __pyx_v_idx; unsigned long __pyx_v_ofs; size_t __pyx_v_c_len_in_utf8; PyObject *__pyx_v_disps = NULL; Py_UCS4 __pyx_v_c; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; void *__pyx_t_5; int __pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); /* "pglast/parser.pyx":209 * * def __init__(self, str s): * cdef unsigned long idx = 0 # <<<<<<<<<<<<<< * cdef unsigned long ofs = 0 * cdef size_t c_len_in_utf8 */ __pyx_v_idx = 0; /* "pglast/parser.pyx":210 * def __init__(self, str s): * cdef unsigned long idx = 0 * cdef unsigned long ofs = 0 # <<<<<<<<<<<<<< * cdef size_t c_len_in_utf8 * */ __pyx_v_ofs = 0; /* "pglast/parser.pyx":213 * cdef size_t c_len_in_utf8 * * disps = [] # <<<<<<<<<<<<<< * for c in s: * c_len_in_utf8 = len(c.encode('utf-8')) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_disps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":214 * * disps = [] * for c in s: # <<<<<<<<<<<<<< * c_len_in_utf8 = len(c.encode('utf-8')) * if c_len_in_utf8 > 1: */ if (unlikely(__pyx_v_s == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); __PYX_ERR(1, 214, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_s); __pyx_t_2 = __pyx_v_s; __pyx_t_7 = __Pyx_init_unicode_iteration(__pyx_t_2, (&__pyx_t_4), (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 214, __pyx_L1_error) for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_4; __pyx_t_8++) { __pyx_t_3 = __pyx_t_8; __pyx_v_c = __Pyx_PyUnicode_READ(__pyx_t_6, __pyx_t_5, __pyx_t_3); /* "pglast/parser.pyx":215 * disps = [] * for c in s: * c_len_in_utf8 = len(c.encode('utf-8')) # <<<<<<<<<<<<<< * if c_len_in_utf8 > 1: * while c_len_in_utf8 > 0: */ __pyx_t_1 = __Pyx_PyUnicode_FromOrdinal(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(1, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_c_len_in_utf8 = __pyx_t_10; /* "pglast/parser.pyx":216 * for c in s: * c_len_in_utf8 = len(c.encode('utf-8')) * if c_len_in_utf8 > 1: # <<<<<<<<<<<<<< * while c_len_in_utf8 > 0: * disps.append((ofs, idx)) */ __pyx_t_11 = (__pyx_v_c_len_in_utf8 > 1); if (__pyx_t_11) { /* "pglast/parser.pyx":217 * c_len_in_utf8 = len(c.encode('utf-8')) * if c_len_in_utf8 > 1: * while c_len_in_utf8 > 0: # <<<<<<<<<<<<<< * disps.append((ofs, idx)) * c_len_in_utf8 -= 1 */ while (1) { __pyx_t_11 = (__pyx_v_c_len_in_utf8 > 0); if (!__pyx_t_11) break; /* "pglast/parser.pyx":218 * if c_len_in_utf8 > 1: * while c_len_in_utf8 > 0: * disps.append((ofs, idx)) # <<<<<<<<<<<<<< * c_len_in_utf8 -= 1 * ofs += 1 */ __pyx_t_9 = __Pyx_PyInt_From_unsigned_long(__pyx_v_ofs); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_9); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9)) __PYX_ERR(1, 218, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_disps, __pyx_t_12); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 218, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pglast/parser.pyx":219 * while c_len_in_utf8 > 0: * disps.append((ofs, idx)) * c_len_in_utf8 -= 1 # <<<<<<<<<<<<<< * ofs += 1 * else: */ __pyx_v_c_len_in_utf8 = (__pyx_v_c_len_in_utf8 - 1); /* "pglast/parser.pyx":220 * disps.append((ofs, idx)) * c_len_in_utf8 -= 1 * ofs += 1 # <<<<<<<<<<<<<< * else: * ofs += 1 */ __pyx_v_ofs = (__pyx_v_ofs + 1); } /* "pglast/parser.pyx":216 * for c in s: * c_len_in_utf8 = len(c.encode('utf-8')) * if c_len_in_utf8 > 1: # <<<<<<<<<<<<<< * while c_len_in_utf8 > 0: * disps.append((ofs, idx)) */ goto __pyx_L5; } /* "pglast/parser.pyx":222 * ofs += 1 * else: * ofs += 1 # <<<<<<<<<<<<<< * idx += 1 * self.max_offset = ofs - 1 */ /*else*/ { __pyx_v_ofs = (__pyx_v_ofs + 1); } __pyx_L5:; /* "pglast/parser.pyx":223 * else: * ofs += 1 * idx += 1 # <<<<<<<<<<<<<< * self.max_offset = ofs - 1 * self.displacements = tuple(reversed(disps)) */ __pyx_v_idx = (__pyx_v_idx + 1); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/parser.pyx":224 * ofs += 1 * idx += 1 * self.max_offset = ofs - 1 # <<<<<<<<<<<<<< * self.displacements = tuple(reversed(disps)) * */ __pyx_v_self->max_offset = (__pyx_v_ofs - 1); /* "pglast/parser.pyx":225 * idx += 1 * self.max_offset = ofs - 1 * self.displacements = tuple(reversed(disps)) # <<<<<<<<<<<<<< * * def __call__(self, offset): */ __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_v_disps); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->displacements); __Pyx_DECREF(__pyx_v_self->displacements); __pyx_v_self->displacements = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":208 * cdef unsigned long max_offset * * def __init__(self, str s): # <<<<<<<<<<<<<< * cdef unsigned long idx = 0 * cdef unsigned long ofs = 0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pglast.parser.Displacements.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_disps); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":227 * self.displacements = tuple(reversed(disps)) * * def __call__(self, offset): # <<<<<<<<<<<<<< * if not 0 <= offset <= self.max_offset: * # It may happen that the error is actually at the very end of the statement, giving */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_13Displacements_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_6pglast_6parser_13Displacements_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_offset = 0; CYTHON_UNUSED Py_ssize_t __pyx_nargs; CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) { (void)__Pyx_Arg_NewRef_VARARGS(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 227, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__call__") < 0)) __PYX_ERR(1, 227, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); } __pyx_v_offset = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 227, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.Displacements.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pglast_6parser_13Displacements_2__call__(((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_v_self), __pyx_v_offset); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_13Displacements_2__call__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self, PyObject *__pyx_v_offset) { PyObject *__pyx_v_o = NULL; PyObject *__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 1); /* "pglast/parser.pyx":228 * * def __call__(self, offset): * if not 0 <= offset <= self.max_offset: # <<<<<<<<<<<<<< * # It may happen that the error is actually at the very end of the statement, giving * # the message "syntax error at end of input", with a position that is beyond the */ __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_offset, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { __Pyx_DECREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->max_offset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyObject_RichCompare(__pyx_v_offset, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 228, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (!__pyx_t_3); if (__pyx_t_4) { /* "pglast/parser.pyx":232 * # the message "syntax error at end of input", with a position that is beyond the * # end of the string. Return None in such case * return None # <<<<<<<<<<<<<< * * for o, i in self.displacements: */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "pglast/parser.pyx":228 * * def __call__(self, offset): * if not 0 <= offset <= self.max_offset: # <<<<<<<<<<<<<< * # It may happen that the error is actually at the very end of the statement, giving * # the message "syntax error at end of input", with a position that is beyond the */ } /* "pglast/parser.pyx":234 * return None * * for o, i in self.displacements: # <<<<<<<<<<<<<< * if o <= offset: * return i + (offset - o) */ if (unlikely(__pyx_v_self->displacements == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(1, 234, __pyx_L1_error) } __pyx_t_1 = __pyx_v_self->displacements; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 234, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(1, 234, __pyx_L1_error) #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 234, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(1, 234, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 234, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "pglast/parser.pyx":235 * * for o, i in self.displacements: * if o <= offset: # <<<<<<<<<<<<<< * return i + (offset - o) * */ __pyx_t_2 = PyObject_RichCompare(__pyx_v_o, __pyx_v_offset, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "pglast/parser.pyx":236 * for o, i in self.displacements: * if o <= offset: * return i + (offset - o) # <<<<<<<<<<<<<< * * return offset */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyNumber_Subtract(__pyx_v_offset, __pyx_v_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyNumber_Add(__pyx_v_i, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "pglast/parser.pyx":235 * * for o, i in self.displacements: * if o <= offset: # <<<<<<<<<<<<<< * return i + (offset - o) * */ } /* "pglast/parser.pyx":234 * return None * * for o, i in self.displacements: # <<<<<<<<<<<<<< * if o <= offset: * return i + (offset - o) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":238 * return i + (offset - o) * * return offset # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_offset); __pyx_r = __pyx_v_offset; goto __pyx_L0; /* "pglast/parser.pyx":227 * self.displacements = tuple(reversed(disps)) * * def __call__(self, offset): # <<<<<<<<<<<<<< * if not 0 <= offset <= self.max_offset: * # It may happen that the error is actually at the very end of the statement, giving */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.Displacements.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_o); __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_13Displacements_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_6pglast_6parser_13Displacements_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_13Displacements_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pglast_6parser_13Displacements_5__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; __pyx_r = __pyx_pf_6pglast_6parser_13Displacements_4__reduce_cython__(((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_13Displacements_4__reduce_cython__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 1); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.displacements, self.max_offset) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_self->max_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->displacements); __Pyx_GIVEREF(__pyx_v_self->displacements); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->displacements)) __PYX_ERR(2, 5, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_1 = 0; __pyx_v_state = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.displacements, self.max_offset) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v__dict = __pyx_t_2; __pyx_t_2 = 0; /* "(tree fragment)":7 * state = (self.displacements, self.max_offset) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_3 = (__pyx_v__dict != Py_None); if (__pyx_t_3) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.displacements is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.displacements, self.max_offset) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.displacements is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, None), state */ /*else*/ { __pyx_t_3 = (__pyx_v_self->displacements != ((PyObject*)Py_None)); __pyx_v_use_setstate = __pyx_t_3; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.displacements is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Displacements, (type(self), 0x236a782, None), state * else: */ if (__pyx_v_use_setstate) { /* "(tree fragment)":13 * use_setstate = self.displacements is not None * if use_setstate: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Displacements); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_int_37136258); __Pyx_GIVEREF(__pyx_int_37136258); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_37136258)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.displacements is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Displacements, (type(self), 0x236a782, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_Displacements, (type(self), 0x236a782, None), state * else: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Displacements__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Displacements); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_int_37136258); __Pyx_GIVEREF(__pyx_int_37136258); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_37136258)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.Displacements.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Displacements__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_13Displacements_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_6pglast_6parser_13Displacements_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_13Displacements_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pglast_6parser_13Displacements_7__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v___pyx_state = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.Displacements.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pglast_6parser_13Displacements_6__setstate_cython__(((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_13Displacements_6__setstate_cython__(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 1); /* "(tree fragment)":17 * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Displacements__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_6pglast_6parser___pyx_unpickle_Displacements__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Displacements__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pglast.parser.Displacements.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":241 * * * def get_postgresql_version(): # <<<<<<<<<<<<<< * "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_1get_postgresql_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_get_postgresql_version, "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)."); static PyMethodDef __pyx_mdef_6pglast_6parser_1get_postgresql_version = {"get_postgresql_version", (PyCFunction)__pyx_pw_6pglast_6parser_1get_postgresql_version, METH_NOARGS, __pyx_doc_6pglast_6parser_get_postgresql_version}; static PyObject *__pyx_pw_6pglast_6parser_1get_postgresql_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_postgresql_version (wrapper)", 0); __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __pyx_r = __pyx_pf_6pglast_6parser_get_postgresql_version(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_get_postgresql_version(CYTHON_UNUSED PyObject *__pyx_self) { int __pyx_v_version; PyObject *__pyx_v_major = NULL; PyObject *__pyx_v_minor = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_postgresql_version", 1); /* "pglast/parser.pyx":244 * "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)." * * version = PG_VERSION_NUM # <<<<<<<<<<<<<< * major, minor = divmod(version, 10_000) * return (major, minor) */ __pyx_v_version = PG_VERSION_NUM; /* "pglast/parser.pyx":245 * * version = PG_VERSION_NUM * major, minor = divmod(version, 10_000) # <<<<<<<<<<<<<< * return (major, minor) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_version); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Divmod(__pyx_t_1, __pyx_int_10000); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 245, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(1, 245, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(1, 245, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_major = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_minor = __pyx_t_3; __pyx_t_3 = 0; /* "pglast/parser.pyx":246 * version = PG_VERSION_NUM * major, minor = divmod(version, 10_000) * return (major, minor) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_major); __Pyx_GIVEREF(__pyx_v_major); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_major)) __PYX_ERR(1, 246, __pyx_L1_error); __Pyx_INCREF(__pyx_v_minor); __Pyx_GIVEREF(__pyx_v_minor); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_minor)) __PYX_ERR(1, 246, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "pglast/parser.pyx":241 * * * def get_postgresql_version(): # <<<<<<<<<<<<<< * "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.get_postgresql_version", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_major); __Pyx_XDECREF(__pyx_v_minor); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":249 * * * def parse_sql(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its abstract syntax tree." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_3parse_sql(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_2parse_sql, "Parse the given ``SQL`` `query` and return its abstract syntax tree."); static PyMethodDef __pyx_mdef_6pglast_6parser_3parse_sql = {"parse_sql", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_3parse_sql, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_2parse_sql}; static PyObject *__pyx_pw_6pglast_6parser_3parse_sql(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_sql (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 249, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_sql") < 0)) __PYX_ERR(1, 249, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_query = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("parse_sql", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 249, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.parse_sql", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(1, 249, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_2parse_sql(__pyx_self, __pyx_v_query); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_2parse_sql(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query) { PgQueryInternalParsetreeAndError __pyx_v_parsed; MemoryContext __pyx_v_mctx; int __pyx_v_i; char const *__pyx_v_cstring; PyObject *__pyx_v_utf8 = NULL; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_v_stmts = NULL; PyObject *__pyx_v_item = NULL; PyObject *__pyx_v_message = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char *__pyx_t_7; Py_ssize_t __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; unsigned int __pyx_t_14; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_sql", 1); /* "pglast/parser.pyx":257 * cdef const char *cstring * * utf8 = query.encode('utf-8') # <<<<<<<<<<<<<< * offset_to_index = Displacements(query) * cstring = utf8 */ if (unlikely(__pyx_v_query == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 257, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":258 * * utf8 = query.encode('utf-8') * offset_to_index = Displacements(query) # <<<<<<<<<<<<<< * cstring = utf8 * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":259 * utf8 = query.encode('utf-8') * offset_to_index = Displacements(query) * cstring = utf8 # <<<<<<<<<<<<<< * * mctx = pg_query_enter_memory_context() */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 259, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":261 * cstring = utf8 * * mctx = pg_query_enter_memory_context() # <<<<<<<<<<<<<< * * with nogil: */ __pyx_v_mctx = pg_query_enter_memory_context(); /* "pglast/parser.pyx":263 * mctx = pg_query_enter_memory_context() * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_raw_parse(cstring, PG_QUERY_PARSE_DEFAULT) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":264 * * with nogil: * parsed = pg_query_raw_parse(cstring, PG_QUERY_PARSE_DEFAULT) # <<<<<<<<<<<<<< * * try: */ __pyx_v_parsed = pg_query_raw_parse(__pyx_v_cstring, PG_QUERY_PARSE_DEFAULT); } /* "pglast/parser.pyx":263 * mctx = pg_query_enter_memory_context() * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_raw_parse(cstring, PG_QUERY_PARSE_DEFAULT) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":266 * parsed = pg_query_raw_parse(cstring, PG_QUERY_PARSE_DEFAULT) * * try: # <<<<<<<<<<<<<< * if parsed.tree is not NULL: * stmts = PyTuple_New(parsed.tree.length) */ /*try:*/ { /* "pglast/parser.pyx":267 * * try: * if parsed.tree is not NULL: # <<<<<<<<<<<<<< * stmts = PyTuple_New(parsed.tree.length) * for i in range(parsed.tree.length): */ __pyx_t_3 = (__pyx_v_parsed.tree != NULL); if (__pyx_t_3) { /* "pglast/parser.pyx":268 * try: * if parsed.tree is not NULL: * stmts = PyTuple_New(parsed.tree.length) # <<<<<<<<<<<<<< * for i in range(parsed.tree.length): * item = create(structs.list_nth(parsed.tree, i), offset_to_index) */ __pyx_t_1 = PyTuple_New(__pyx_v_parsed.tree->length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 268, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_stmts = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":269 * if parsed.tree is not NULL: * stmts = PyTuple_New(parsed.tree.length) * for i in range(parsed.tree.length): # <<<<<<<<<<<<<< * item = create(structs.list_nth(parsed.tree, i), offset_to_index) * Py_INCREF(item) */ __pyx_t_4 = __pyx_v_parsed.tree->length; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "pglast/parser.pyx":270 * stmts = PyTuple_New(parsed.tree.length) * for i in range(parsed.tree.length): * item = create(structs.list_nth(parsed.tree, i), offset_to_index) # <<<<<<<<<<<<<< * Py_INCREF(item) * PyTuple_SET_ITEM(stmts, i, item) */ __pyx_t_1 = __pyx_f_6pglast_6parser_create(list_nth(__pyx_v_parsed.tree, __pyx_v_i), ((PyObject *)__pyx_v_offset_to_index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 270, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":271 * for i in range(parsed.tree.length): * item = create(structs.list_nth(parsed.tree, i), offset_to_index) * Py_INCREF(item) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(stmts, i, item) * return stmts */ Py_INCREF(__pyx_v_item); /* "pglast/parser.pyx":272 * item = create(structs.list_nth(parsed.tree, i), offset_to_index) * Py_INCREF(item) * PyTuple_SET_ITEM(stmts, i, item) # <<<<<<<<<<<<<< * return stmts * elif parsed.error is NULL: */ PyTuple_SET_ITEM(__pyx_v_stmts, __pyx_v_i, __pyx_v_item); } /* "pglast/parser.pyx":273 * Py_INCREF(item) * PyTuple_SET_ITEM(stmts, i, item) * return stmts # <<<<<<<<<<<<<< * elif parsed.error is NULL: * return () */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_stmts); __pyx_r = __pyx_v_stmts; goto __pyx_L6_return; /* "pglast/parser.pyx":267 * * try: * if parsed.tree is not NULL: # <<<<<<<<<<<<<< * stmts = PyTuple_New(parsed.tree.length) * for i in range(parsed.tree.length): */ } /* "pglast/parser.pyx":274 * PyTuple_SET_ITEM(stmts, i, item) * return stmts * elif parsed.error is NULL: # <<<<<<<<<<<<<< * return () * else: */ __pyx_t_3 = (__pyx_v_parsed.error == NULL); if (likely(__pyx_t_3)) { /* "pglast/parser.pyx":275 * return stmts * elif parsed.error is NULL: * return () # <<<<<<<<<<<<<< * else: * message = parsed.error.message.decode('utf8') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L6_return; /* "pglast/parser.pyx":274 * PyTuple_SET_ITEM(stmts, i, item) * return stmts * elif parsed.error is NULL: # <<<<<<<<<<<<<< * return () * else: */ } /* "pglast/parser.pyx":277 * return () * else: * message = parsed.error.message.decode('utf8') # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * finally: */ /*else*/ { __pyx_t_7 = __pyx_v_parsed.error->message; __pyx_t_8 = __Pyx_ssize_strlen(__pyx_t_7); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 277, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_7, 0, __pyx_t_8, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 277, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":278 * else: * message = parsed.error.message.decode('utf8') * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) # <<<<<<<<<<<<<< * finally: * pg_query_exit_memory_context(mctx); */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 278, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = __Pyx_PyInt_From_long((__pyx_v_parsed.error->cursorpos - 1)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 278, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_12 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_13 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_13)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_14 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_11}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 278, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __pyx_t_12 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_14 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_message, __pyx_t_10}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_14, 2+__pyx_t_14); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 278, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 278, __pyx_L7_error) } } /* "pglast/parser.pyx":280 * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * finally: * pg_query_exit_memory_context(mctx); # <<<<<<<<<<<<<< * * */ /*finally:*/ { __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { pg_query_exit_memory_context(__pyx_v_mctx); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_15; goto __pyx_L1_error; } __pyx_L6_return: { __pyx_t_21 = __pyx_r; __pyx_r = 0; pg_query_exit_memory_context(__pyx_v_mctx); __pyx_r = __pyx_t_21; __pyx_t_21 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":249 * * * def parse_sql(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its abstract syntax tree." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("pglast.parser.parse_sql", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XDECREF(__pyx_v_stmts); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":283 * * * def parse_sql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``JSON`` encoded syntax tree." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_5parse_sql_json(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_4parse_sql_json, "Parse the given ``SQL`` `query` and return its ``JSON`` encoded syntax tree."); static PyMethodDef __pyx_mdef_6pglast_6parser_5parse_sql_json = {"parse_sql_json", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_5parse_sql_json, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_4parse_sql_json}; static PyObject *__pyx_pw_6pglast_6parser_5parse_sql_json(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_sql_json (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 283, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_sql_json") < 0)) __PYX_ERR(1, 283, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_query = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("parse_sql_json", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 283, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.parse_sql_json", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(1, 283, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_4parse_sql_json(__pyx_self, __pyx_v_query); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_4parse_sql_json(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query) { PgQueryParseResult __pyx_v_parsed; char const *__pyx_v_cstring; PyObject *__pyx_v_utf8 = NULL; PyObject *__pyx_v_message = NULL; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; char *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_sql_json", 1); /* "pglast/parser.pyx":289 * cdef const char *cstring * * utf8 = query.encode('utf-8') # <<<<<<<<<<<<<< * cstring = utf8 * */ if (unlikely(__pyx_v_query == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 289, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":290 * * utf8 = query.encode('utf-8') * cstring = utf8 # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 290, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":292 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_parse(cstring) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":293 * * with nogil: * parsed = pg_query_parse(cstring) # <<<<<<<<<<<<<< * * try: */ __pyx_v_parsed = pg_query_parse(__pyx_v_cstring); } /* "pglast/parser.pyx":292 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_parse(cstring) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":295 * parsed = pg_query_parse(cstring) * * try: # <<<<<<<<<<<<<< * if parsed.error: * message = parsed.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":296 * * try: * if parsed.error: # <<<<<<<<<<<<<< * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) */ __pyx_t_3 = (__pyx_v_parsed.error != 0); if (unlikely(__pyx_t_3)) { /* "pglast/parser.pyx":297 * try: * if parsed.error: * message = parsed.error.message.decode('utf8') # <<<<<<<<<<<<<< * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) */ __pyx_t_4 = __pyx_v_parsed.error->message; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 297, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 297, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":298 * if parsed.error: * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 298, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":299 * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) # <<<<<<<<<<<<<< * * return parsed.parse_tree.decode('utf8') */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 299, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_parsed.error->cursorpos - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 299, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_9 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 299, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_message, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 299, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 299, __pyx_L7_error) /* "pglast/parser.pyx":296 * * try: * if parsed.error: # <<<<<<<<<<<<<< * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) */ } /* "pglast/parser.pyx":301 * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * * return parsed.parse_tree.decode('utf8') # <<<<<<<<<<<<<< * finally: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_v_parsed.parse_tree; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 301, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 301, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_r = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_return; } /* "pglast/parser.pyx":303 * return parsed.parse_tree.decode('utf8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_parse_result(parsed) * */ /*finally:*/ { __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":304 * finally: * with nogil: * pg_query_free_parse_result(parsed) # <<<<<<<<<<<<<< * * */ pg_query_free_parse_result(__pyx_v_parsed); } /* "pglast/parser.pyx":303 * return parsed.parse_tree.decode('utf8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_parse_result(parsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L1_error; } __pyx_L6_return: { __pyx_t_20 = __pyx_r; __pyx_r = 0; { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":304 * finally: * with nogil: * pg_query_free_parse_result(parsed) # <<<<<<<<<<<<<< * * */ pg_query_free_parse_result(__pyx_v_parsed); } /* "pglast/parser.pyx":303 * return parsed.parse_tree.decode('utf8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_parse_result(parsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } __pyx_r = __pyx_t_20; __pyx_t_20 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":283 * * * def parse_sql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``JSON`` encoded syntax tree." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pglast.parser.parse_sql_json", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":307 * * * def parse_sql_protobuf(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``protobuf`` encoded syntax tree." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_7parse_sql_protobuf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_6parse_sql_protobuf, "Parse the given ``SQL`` `query` and return its ``protobuf`` encoded syntax tree."); static PyMethodDef __pyx_mdef_6pglast_6parser_7parse_sql_protobuf = {"parse_sql_protobuf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_7parse_sql_protobuf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_6parse_sql_protobuf}; static PyObject *__pyx_pw_6pglast_6parser_7parse_sql_protobuf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_sql_protobuf (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 307, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_sql_protobuf") < 0)) __PYX_ERR(1, 307, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_query = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("parse_sql_protobuf", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 307, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.parse_sql_protobuf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(1, 307, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_6parse_sql_protobuf(__pyx_self, __pyx_v_query); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_6parse_sql_protobuf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query) { PgQueryProtobufParseResult __pyx_v_parsed; char const *__pyx_v_cstring; PyObject *__pyx_v_utf8 = NULL; PyObject *__pyx_v_message = NULL; CYTHON_UNUSED int __pyx_v_cursorpos; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; char *__pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; unsigned int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_sql_protobuf", 1); /* "pglast/parser.pyx":313 * cdef const char *cstring * * utf8 = query.encode('utf-8') # <<<<<<<<<<<<<< * cstring = utf8 * */ if (unlikely(__pyx_v_query == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 313, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":314 * * utf8 = query.encode('utf-8') * cstring = utf8 # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 314, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":316 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_parse_protobuf(cstring) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":317 * * with nogil: * parsed = pg_query_parse_protobuf(cstring) # <<<<<<<<<<<<<< * * try: */ __pyx_v_parsed = pg_query_parse_protobuf(__pyx_v_cstring); } /* "pglast/parser.pyx":316 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_parse_protobuf(cstring) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":319 * parsed = pg_query_parse_protobuf(cstring) * * try: # <<<<<<<<<<<<<< * if parsed.error: * message = parsed.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":320 * * try: * if parsed.error: # <<<<<<<<<<<<<< * message = parsed.error.message.decode('utf8') * cursorpos = parsed.error.cursorpos */ __pyx_t_3 = (__pyx_v_parsed.error != 0); if (unlikely(__pyx_t_3)) { /* "pglast/parser.pyx":321 * try: * if parsed.error: * message = parsed.error.message.decode('utf8') # <<<<<<<<<<<<<< * cursorpos = parsed.error.cursorpos * offset_to_index = Displacements(query) */ __pyx_t_4 = __pyx_v_parsed.error->message; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 321, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 321, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":322 * if parsed.error: * message = parsed.error.message.decode('utf8') * cursorpos = parsed.error.cursorpos # <<<<<<<<<<<<<< * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) */ __pyx_t_6 = __pyx_v_parsed.error->cursorpos; __pyx_v_cursorpos = __pyx_t_6; /* "pglast/parser.pyx":323 * message = parsed.error.message.decode('utf8') * cursorpos = parsed.error.cursorpos * offset_to_index = Displacements(query) # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 323, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":324 * cursorpos = parsed.error.cursorpos * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) # <<<<<<<<<<<<<< * * return PyBytes_FromStringAndSize(parsed.parse_tree.data, parsed.parse_tree.len) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 324, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyInt_From_long((__pyx_v_parsed.error->cursorpos - 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 324, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 324, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_t_10 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_12 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_message, __pyx_t_8}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 324, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 324, __pyx_L7_error) /* "pglast/parser.pyx":320 * * try: * if parsed.error: # <<<<<<<<<<<<<< * message = parsed.error.message.decode('utf8') * cursorpos = parsed.error.cursorpos */ } /* "pglast/parser.pyx":326 * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * * return PyBytes_FromStringAndSize(parsed.parse_tree.data, parsed.parse_tree.len) # <<<<<<<<<<<<<< * finally: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_parsed.parse_tree.data, __pyx_v_parsed.parse_tree.len); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 326, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_return; } /* "pglast/parser.pyx":328 * return PyBytes_FromStringAndSize(parsed.parse_tree.data, parsed.parse_tree.len) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_protobuf_parse_result(parsed) * */ /*finally:*/ { __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_6 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":329 * finally: * with nogil: * pg_query_free_protobuf_parse_result(parsed) # <<<<<<<<<<<<<< * * */ pg_query_free_protobuf_parse_result(__pyx_v_parsed); } /* "pglast/parser.pyx":328 * return PyBytes_FromStringAndSize(parsed.parse_tree.data, parsed.parse_tree.len) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_protobuf_parse_result(parsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L1_error; } __pyx_L6_return: { __pyx_t_20 = __pyx_r; __pyx_r = 0; { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":329 * finally: * with nogil: * pg_query_free_protobuf_parse_result(parsed) # <<<<<<<<<<<<<< * * */ pg_query_free_protobuf_parse_result(__pyx_v_parsed); } /* "pglast/parser.pyx":328 * return PyBytes_FromStringAndSize(parsed.parse_tree.data, parsed.parse_tree.len) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_protobuf_parse_result(parsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } __pyx_r = __pyx_t_20; __pyx_t_20 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":307 * * * def parse_sql_protobuf(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``protobuf`` encoded syntax tree." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("pglast.parser.parse_sql_protobuf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":332 * * * def parse_plpgsql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``pgpgsql`` `query` and return its ``JSON`` encoded syntax tree." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_9parse_plpgsql_json(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_8parse_plpgsql_json, "Parse the given ``pgpgsql`` `query` and return its ``JSON`` encoded syntax tree."); static PyMethodDef __pyx_mdef_6pglast_6parser_9parse_plpgsql_json = {"parse_plpgsql_json", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_9parse_plpgsql_json, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_8parse_plpgsql_json}; static PyObject *__pyx_pw_6pglast_6parser_9parse_plpgsql_json(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_plpgsql_json (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 332, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "parse_plpgsql_json") < 0)) __PYX_ERR(1, 332, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_query = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("parse_plpgsql_json", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.parse_plpgsql_json", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(1, 332, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_8parse_plpgsql_json(__pyx_self, __pyx_v_query); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_8parse_plpgsql_json(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query) { PgQueryPlpgsqlParseResult __pyx_v_parsed; char const *__pyx_v_cstring; PyObject *__pyx_v_utf8 = NULL; PyObject *__pyx_v_message = NULL; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; char *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_plpgsql_json", 1); /* "pglast/parser.pyx":338 * cdef const char *cstring * * utf8 = query.encode('utf-8') # <<<<<<<<<<<<<< * cstring = utf8 * */ if (unlikely(__pyx_v_query == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 338, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":339 * * utf8 = query.encode('utf-8') * cstring = utf8 # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 339, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":341 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_parse_plpgsql(cstring) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":342 * * with nogil: * parsed = pg_query_parse_plpgsql(cstring) # <<<<<<<<<<<<<< * * try: */ __pyx_v_parsed = pg_query_parse_plpgsql(__pyx_v_cstring); } /* "pglast/parser.pyx":341 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * parsed = pg_query_parse_plpgsql(cstring) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":344 * parsed = pg_query_parse_plpgsql(cstring) * * try: # <<<<<<<<<<<<<< * if parsed.error: * message = parsed.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":345 * * try: * if parsed.error: # <<<<<<<<<<<<<< * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) */ __pyx_t_3 = (__pyx_v_parsed.error != 0); if (unlikely(__pyx_t_3)) { /* "pglast/parser.pyx":346 * try: * if parsed.error: * message = parsed.error.message.decode('utf8') # <<<<<<<<<<<<<< * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) */ __pyx_t_4 = __pyx_v_parsed.error->message; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 346, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 346, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":347 * if parsed.error: * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 347, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":348 * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) # <<<<<<<<<<<<<< * * return parsed.plpgsql_funcs.decode('utf8') */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 348, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_parsed.error->cursorpos - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 348, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_9 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 348, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_message, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 348, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 348, __pyx_L7_error) /* "pglast/parser.pyx":345 * * try: * if parsed.error: # <<<<<<<<<<<<<< * message = parsed.error.message.decode('utf8') * offset_to_index = Displacements(query) */ } /* "pglast/parser.pyx":350 * raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) * * return parsed.plpgsql_funcs.decode('utf8') # <<<<<<<<<<<<<< * finally: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_v_parsed.plpgsql_funcs; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 350, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 350, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_r = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_return; } /* "pglast/parser.pyx":352 * return parsed.plpgsql_funcs.decode('utf8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_plpgsql_parse_result(parsed) * */ /*finally:*/ { __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":353 * finally: * with nogil: * pg_query_free_plpgsql_parse_result(parsed) # <<<<<<<<<<<<<< * * */ pg_query_free_plpgsql_parse_result(__pyx_v_parsed); } /* "pglast/parser.pyx":352 * return parsed.plpgsql_funcs.decode('utf8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_plpgsql_parse_result(parsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L1_error; } __pyx_L6_return: { __pyx_t_20 = __pyx_r; __pyx_r = 0; { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":353 * finally: * with nogil: * pg_query_free_plpgsql_parse_result(parsed) # <<<<<<<<<<<<<< * * */ pg_query_free_plpgsql_parse_result(__pyx_v_parsed); } /* "pglast/parser.pyx":352 * return parsed.plpgsql_funcs.decode('utf8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_plpgsql_parse_result(parsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } __pyx_r = __pyx_t_20; __pyx_t_20 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":332 * * * def parse_plpgsql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``pgpgsql`` `query` and return its ``JSON`` encoded syntax tree." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pglast.parser.parse_plpgsql_json", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":356 * * * def fingerprint(str query): # <<<<<<<<<<<<<< * "Compute and return a *signature* of the given ``SQL`` `query`." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_11fingerprint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_10fingerprint, "Compute and return a *signature* of the given ``SQL`` `query`."); static PyMethodDef __pyx_mdef_6pglast_6parser_11fingerprint = {"fingerprint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_11fingerprint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_10fingerprint}; static PyObject *__pyx_pw_6pglast_6parser_11fingerprint(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fingerprint (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fingerprint") < 0)) __PYX_ERR(1, 356, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_query = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fingerprint", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.fingerprint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(1, 356, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_10fingerprint(__pyx_self, __pyx_v_query); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_10fingerprint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query) { PgQueryFingerprintResult __pyx_v_result; char const *__pyx_v_cstring; PyObject *__pyx_v_utf8 = NULL; PyObject *__pyx_v_message = NULL; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; char *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; char const *__pyx_t_14; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fingerprint", 1); /* "pglast/parser.pyx":362 * cdef const char *cstring * * utf8 = query.encode('utf-8') # <<<<<<<<<<<<<< * cstring = utf8 * */ if (unlikely(__pyx_v_query == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 362, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":363 * * utf8 = query.encode('utf-8') * cstring = utf8 # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 363, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":365 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * result = pg_query_fingerprint(cstring) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":366 * * with nogil: * result = pg_query_fingerprint(cstring) # <<<<<<<<<<<<<< * * try: */ __pyx_v_result = pg_query_fingerprint(__pyx_v_cstring); } /* "pglast/parser.pyx":365 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * result = pg_query_fingerprint(cstring) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":368 * result = pg_query_fingerprint(cstring) * * try: # <<<<<<<<<<<<<< * if result.error: * message = result.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":369 * * try: * if result.error: # <<<<<<<<<<<<<< * message = result.error.message.decode('utf8') * offset_to_index = Displacements(query) */ __pyx_t_3 = (__pyx_v_result.error != 0); if (unlikely(__pyx_t_3)) { /* "pglast/parser.pyx":370 * try: * if result.error: * message = result.error.message.decode('utf8') # <<<<<<<<<<<<<< * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(result.error.cursorpos-1)) */ __pyx_t_4 = __pyx_v_result.error->message; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 370, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 370, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":371 * if result.error: * message = result.error.message.decode('utf8') * offset_to_index = Displacements(query) # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(result.error.cursorpos-1)) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 371, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":372 * message = result.error.message.decode('utf8') * offset_to_index = Displacements(query) * raise ParseError(message, offset_to_index(result.error.cursorpos-1)) # <<<<<<<<<<<<<< * * return result.fingerprint_str.decode('ascii') */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 372, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_result.error->cursorpos - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 372, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_9 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 372, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_message, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 372, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 372, __pyx_L7_error) /* "pglast/parser.pyx":369 * * try: * if result.error: # <<<<<<<<<<<<<< * message = result.error.message.decode('utf8') * offset_to_index = Displacements(query) */ } /* "pglast/parser.pyx":374 * raise ParseError(message, offset_to_index(result.error.cursorpos-1)) * * return result.fingerprint_str.decode('ascii') # <<<<<<<<<<<<<< * finally: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_v_result.fingerprint_str; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 374, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 374, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_r = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L6_return; } /* "pglast/parser.pyx":376 * return result.fingerprint_str.decode('ascii') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_fingerprint_result(result) * */ /*finally:*/ { __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":377 * finally: * with nogil: * pg_query_free_fingerprint_result(result) # <<<<<<<<<<<<<< * * */ pg_query_free_fingerprint_result(__pyx_v_result); } /* "pglast/parser.pyx":376 * return result.fingerprint_str.decode('ascii') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_fingerprint_result(result) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); } __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L1_error; } __pyx_L6_return: { __pyx_t_20 = __pyx_r; __pyx_r = 0; { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":377 * finally: * with nogil: * pg_query_free_fingerprint_result(result) # <<<<<<<<<<<<<< * * */ pg_query_free_fingerprint_result(__pyx_v_result); } /* "pglast/parser.pyx":376 * return result.fingerprint_str.decode('ascii') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_fingerprint_result(result) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } __pyx_r = __pyx_t_20; __pyx_t_20 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":356 * * * def fingerprint(str query): # <<<<<<<<<<<<<< * "Compute and return a *signature* of the given ``SQL`` `query`." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pglast.parser.fingerprint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":380 * * * def split(str stmts, bint with_parser=True, bint only_slices=False): # <<<<<<<<<<<<<< * """Split the given `stmts` string into a sequence of the single ``SQL`` statements. * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_13split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_12split, "Split the given `stmts` string into a sequence of the single ``SQL`` statements.\n\n By default this uses the *parser* to perform the job; when `with_parser` is ``False``\n the *scanner* variant is used, indicated when the statements may contain parse errors.\n\n When `only_slices` is ``True``, return a sequence of ``slice`` instances, one for each\n statement, instead of statements text.\n\n NB: leading and trailing whitespace are removed from the statements.\n "); static PyMethodDef __pyx_mdef_6pglast_6parser_13split = {"split", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_13split, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_12split}; static PyObject *__pyx_pw_6pglast_6parser_13split(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_stmts = 0; int __pyx_v_with_parser; int __pyx_v_only_slices; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("split (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stmts,&__pyx_n_s_with_parser,&__pyx_n_s_only_slices,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stmts)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 380, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_with_parser); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_only_slices); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 380, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "split") < 0)) __PYX_ERR(1, 380, __pyx_L3_error) } } else { switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_stmts = ((PyObject*)values[0]); if (values[1]) { __pyx_v_with_parser = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_with_parser == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 380, __pyx_L3_error) } else { __pyx_v_with_parser = ((int)((int)1)); } if (values[2]) { __pyx_v_only_slices = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_only_slices == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 380, __pyx_L3_error) } else { __pyx_v_only_slices = ((int)((int)0)); } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("split", 0, 1, 3, __pyx_nargs); __PYX_ERR(1, 380, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.split", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_stmts), (&PyUnicode_Type), 1, "stmts", 1))) __PYX_ERR(1, 380, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_12split(__pyx_self, __pyx_v_stmts, __pyx_v_with_parser, __pyx_v_only_slices); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_12split(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_stmts, int __pyx_v_with_parser, int __pyx_v_only_slices) { PgQuerySplitResult __pyx_v_splitted; char const *__pyx_v_cstring; int __pyx_v_i; int __pyx_v_prev_offset; int __pyx_v_start; int __pyx_v_end; PyObject *__pyx_v_utf8 = NULL; PyObject *__pyx_v_message = NULL; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_stmt = NULL; PyObject *__pyx_v_cur_offset = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; char *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_t_14; char const *__pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("split", 1); /* "pglast/parser.pyx":394 * cdef PgQuerySplitResult splitted * cdef const char *cstring * cdef int i = 0 # <<<<<<<<<<<<<< * cdef int prev_offset = 0 * cdef int start */ __pyx_v_i = 0; /* "pglast/parser.pyx":395 * cdef const char *cstring * cdef int i = 0 * cdef int prev_offset = 0 # <<<<<<<<<<<<<< * cdef int start * cdef int end */ __pyx_v_prev_offset = 0; /* "pglast/parser.pyx":399 * cdef int end * * utf8 = stmts.encode('utf-8') # <<<<<<<<<<<<<< * cstring = utf8 * */ if (unlikely(__pyx_v_stmts == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 399, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_stmts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":400 * * utf8 = stmts.encode('utf-8') * cstring = utf8 # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":402 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * if with_parser: * splitted = pg_query_split_with_parser(cstring) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":403 * * with nogil: * if with_parser: # <<<<<<<<<<<<<< * splitted = pg_query_split_with_parser(cstring) * else: */ if (__pyx_v_with_parser) { /* "pglast/parser.pyx":404 * with nogil: * if with_parser: * splitted = pg_query_split_with_parser(cstring) # <<<<<<<<<<<<<< * else: * splitted = pg_query_split_with_scanner(cstring) */ __pyx_v_splitted = pg_query_split_with_parser(__pyx_v_cstring); /* "pglast/parser.pyx":403 * * with nogil: * if with_parser: # <<<<<<<<<<<<<< * splitted = pg_query_split_with_parser(cstring) * else: */ goto __pyx_L6; } /* "pglast/parser.pyx":406 * splitted = pg_query_split_with_parser(cstring) * else: * splitted = pg_query_split_with_scanner(cstring) # <<<<<<<<<<<<<< * * try: */ /*else*/ { __pyx_v_splitted = pg_query_split_with_scanner(__pyx_v_cstring); } __pyx_L6:; } /* "pglast/parser.pyx":402 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * if with_parser: * splitted = pg_query_split_with_parser(cstring) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":408 * splitted = pg_query_split_with_scanner(cstring) * * try: # <<<<<<<<<<<<<< * if splitted.error: * message = splitted.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":409 * * try: * if splitted.error: # <<<<<<<<<<<<<< * message = splitted.error.message.decode('utf8') * offset_to_index = Displacements(stmts) */ __pyx_t_3 = (__pyx_v_splitted.error != 0); if (unlikely(__pyx_t_3)) { /* "pglast/parser.pyx":410 * try: * if splitted.error: * message = splitted.error.message.decode('utf8') # <<<<<<<<<<<<<< * offset_to_index = Displacements(stmts) * raise ParseError(message, offset_to_index(splitted.error.cursorpos-1)) */ __pyx_t_4 = __pyx_v_splitted.error->message; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 410, __pyx_L8_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 410, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":411 * if splitted.error: * message = splitted.error.message.decode('utf8') * offset_to_index = Displacements(stmts) # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(splitted.error.cursorpos-1)) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_stmts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 411, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":412 * message = splitted.error.message.decode('utf8') * offset_to_index = Displacements(stmts) * raise ParseError(message, offset_to_index(splitted.error.cursorpos-1)) # <<<<<<<<<<<<<< * * result = [] */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 412, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_splitted.error->cursorpos - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 412, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_9 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 412, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_message, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 412, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 412, __pyx_L8_error) /* "pglast/parser.pyx":409 * * try: * if splitted.error: # <<<<<<<<<<<<<< * message = splitted.error.message.decode('utf8') * offset_to_index = Displacements(stmts) */ } /* "pglast/parser.pyx":414 * raise ParseError(message, offset_to_index(splitted.error.cursorpos-1)) * * result = [] # <<<<<<<<<<<<<< * while i < splitted.n_stmts: * start = splitted.stmts[i].stmt_location */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":415 * * result = [] * while i < splitted.n_stmts: # <<<<<<<<<<<<<< * start = splitted.stmts[i].stmt_location * end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len */ while (1) { __pyx_t_3 = (__pyx_v_i < __pyx_v_splitted.n_stmts); if (!__pyx_t_3) break; /* "pglast/parser.pyx":416 * result = [] * while i < splitted.n_stmts: * start = splitted.stmts[i].stmt_location # <<<<<<<<<<<<<< * end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len * stmt = utf8[start:end].decode('utf-8').strip() */ __pyx_t_12 = (__pyx_v_splitted.stmts[__pyx_v_i])->stmt_location; __pyx_v_start = __pyx_t_12; /* "pglast/parser.pyx":417 * while i < splitted.n_stmts: * start = splitted.stmts[i].stmt_location * end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len # <<<<<<<<<<<<<< * stmt = utf8[start:end].decode('utf-8').strip() * if only_slices: */ __pyx_v_end = ((__pyx_v_splitted.stmts[__pyx_v_i])->stmt_location + (__pyx_v_splitted.stmts[__pyx_v_i])->stmt_len); /* "pglast/parser.pyx":418 * start = splitted.stmts[i].stmt_location * end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len * stmt = utf8[start:end].decode('utf-8').strip() # <<<<<<<<<<<<<< * if only_slices: * # Adjust offsets, we remove leading/trailing whitespace above */ __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_utf8, __pyx_v_start, __pyx_v_end, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 418, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_decode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 418, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_kp_u_utf_8}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 418, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 418, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 418, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_XDECREF_SET(__pyx_v_stmt, __pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":419 * end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len * stmt = utf8[start:end].decode('utf-8').strip() * if only_slices: # <<<<<<<<<<<<<< * # Adjust offsets, we remove leading/trailing whitespace above * cur_offset = stmts.index(stmt, prev_offset) */ if (__pyx_v_only_slices) { /* "pglast/parser.pyx":421 * if only_slices: * # Adjust offsets, we remove leading/trailing whitespace above * cur_offset = stmts.index(stmt, prev_offset) # <<<<<<<<<<<<<< * result.append(slice(cur_offset, cur_offset + len(stmt))) * prev_offset = cur_offset + 1 */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_prev_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 421, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyUnicode_Type_index, __pyx_v_stmts, __pyx_v_stmt, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 421, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_cur_offset, __pyx_t_9); __pyx_t_9 = 0; /* "pglast/parser.pyx":422 * # Adjust offsets, we remove leading/trailing whitespace above * cur_offset = stmts.index(stmt, prev_offset) * result.append(slice(cur_offset, cur_offset + len(stmt))) # <<<<<<<<<<<<<< * prev_offset = cur_offset + 1 * else: */ __pyx_t_5 = PyObject_Length(__pyx_v_stmt); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 422, __pyx_L8_error) __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 422, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyNumber_Add(__pyx_v_cur_offset, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 422, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PySlice_New(__pyx_v_cur_offset, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 422, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 422, __pyx_L8_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pglast/parser.pyx":423 * cur_offset = stmts.index(stmt, prev_offset) * result.append(slice(cur_offset, cur_offset + len(stmt))) * prev_offset = cur_offset + 1 # <<<<<<<<<<<<<< * else: * result.append(stmt) */ __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_cur_offset, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 423, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 423, __pyx_L8_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_prev_offset = __pyx_t_12; /* "pglast/parser.pyx":419 * end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len * stmt = utf8[start:end].decode('utf-8').strip() * if only_slices: # <<<<<<<<<<<<<< * # Adjust offsets, we remove leading/trailing whitespace above * cur_offset = stmts.index(stmt, prev_offset) */ goto __pyx_L13; } /* "pglast/parser.pyx":425 * prev_offset = cur_offset + 1 * else: * result.append(stmt) # <<<<<<<<<<<<<< * i += 1 * return tuple(result) */ /*else*/ { __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_stmt); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 425, __pyx_L8_error) } __pyx_L13:; /* "pglast/parser.pyx":426 * else: * result.append(stmt) * i += 1 # <<<<<<<<<<<<<< * return tuple(result) * finally: */ __pyx_v_i = (__pyx_v_i + 1); } /* "pglast/parser.pyx":427 * result.append(stmt) * i += 1 * return tuple(result) # <<<<<<<<<<<<<< * finally: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 427, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L7_return; } /* "pglast/parser.pyx":429 * return tuple(result) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_split_result(splitted) * */ /*finally:*/ { __pyx_L8_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __pyx_t_12 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":430 * finally: * with nogil: * pg_query_free_split_result(splitted) # <<<<<<<<<<<<<< * * */ pg_query_free_split_result(__pyx_v_splitted); } /* "pglast/parser.pyx":429 * return tuple(result) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_split_result(splitted) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L18; } __pyx_L18:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21); } __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18); __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15; goto __pyx_L1_error; } __pyx_L7_return: { __pyx_t_21 = __pyx_r; __pyx_r = 0; { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":430 * finally: * with nogil: * pg_query_free_split_result(splitted) # <<<<<<<<<<<<<< * * */ pg_query_free_split_result(__pyx_v_splitted); } /* "pglast/parser.pyx":429 * return tuple(result) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_split_result(splitted) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L21; } __pyx_L21:; } } __pyx_r = __pyx_t_21; __pyx_t_21 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":380 * * * def split(str stmts, bint with_parser=True, bint only_slices=False): # <<<<<<<<<<<<<< * """Split the given `stmts` string into a sequence of the single ``SQL`` statements. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("pglast.parser.split", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_stmt); __Pyx_XDECREF(__pyx_v_cur_offset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":433 * * * def deparse_protobuf(bytes protobuf): # <<<<<<<<<<<<<< * "Convert the ``protobuf`` serialized parse tree into an equivalent ``SQL`` statement." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_15deparse_protobuf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_14deparse_protobuf, "Convert the ``protobuf`` serialized parse tree into an equivalent ``SQL`` statement."); static PyMethodDef __pyx_mdef_6pglast_6parser_15deparse_protobuf = {"deparse_protobuf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_15deparse_protobuf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_14deparse_protobuf}; static PyObject *__pyx_pw_6pglast_6parser_15deparse_protobuf(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_protobuf = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deparse_protobuf (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_protobuf,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_protobuf)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 433, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "deparse_protobuf") < 0)) __PYX_ERR(1, 433, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_protobuf = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("deparse_protobuf", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 433, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.deparse_protobuf", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_protobuf), (&PyBytes_Type), 1, "protobuf", 1))) __PYX_ERR(1, 433, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_14deparse_protobuf(__pyx_self, __pyx_v_protobuf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_14deparse_protobuf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_protobuf) { PgQueryProtobuf __pyx_v_tree; PgQueryDeparseResult __pyx_v_deparsed; PyObject *__pyx_v_message = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char *__pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deparse_protobuf", 1); /* "pglast/parser.pyx":439 * cdef PgQueryDeparseResult deparsed * * PyBytes_AsStringAndSize(protobuf, &tree.data, &tree.len) # <<<<<<<<<<<<<< * with nogil: * deparsed = pg_query_deparse_protobuf(tree) */ __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_protobuf, (&__pyx_v_tree.data), ((Py_ssize_t *)(&__pyx_v_tree.len))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 439, __pyx_L1_error) /* "pglast/parser.pyx":440 * * PyBytes_AsStringAndSize(protobuf, &tree.data, &tree.len) * with nogil: # <<<<<<<<<<<<<< * deparsed = pg_query_deparse_protobuf(tree) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":441 * PyBytes_AsStringAndSize(protobuf, &tree.data, &tree.len) * with nogil: * deparsed = pg_query_deparse_protobuf(tree) # <<<<<<<<<<<<<< * * try: */ __pyx_v_deparsed = pg_query_deparse_protobuf(__pyx_v_tree); } /* "pglast/parser.pyx":440 * * PyBytes_AsStringAndSize(protobuf, &tree.data, &tree.len) * with nogil: # <<<<<<<<<<<<<< * deparsed = pg_query_deparse_protobuf(tree) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":443 * deparsed = pg_query_deparse_protobuf(tree) * * try: # <<<<<<<<<<<<<< * if deparsed.error: * message = deparsed.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":444 * * try: * if deparsed.error: # <<<<<<<<<<<<<< * message = deparsed.error.message.decode('utf8') * raise DeparseError(message, deparsed.error.cursorpos) */ __pyx_t_2 = (__pyx_v_deparsed.error != 0); if (unlikely(__pyx_t_2)) { /* "pglast/parser.pyx":445 * try: * if deparsed.error: * message = deparsed.error.message.decode('utf8') # <<<<<<<<<<<<<< * raise DeparseError(message, deparsed.error.cursorpos) * */ __pyx_t_3 = __pyx_v_deparsed.error->message; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 445, __pyx_L7_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 445, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_v_message = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pglast/parser.pyx":446 * if deparsed.error: * message = deparsed.error.message.decode('utf8') * raise DeparseError(message, deparsed.error.cursorpos) # <<<<<<<<<<<<<< * * return deparsed.query.decode('utf-8') */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_DeparseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 446, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_deparsed.error->cursorpos); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 446, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_message, __pyx_t_7}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 446, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(1, 446, __pyx_L7_error) /* "pglast/parser.pyx":444 * * try: * if deparsed.error: # <<<<<<<<<<<<<< * message = deparsed.error.message.decode('utf8') * raise DeparseError(message, deparsed.error.cursorpos) */ } /* "pglast/parser.pyx":448 * raise DeparseError(message, deparsed.error.cursorpos) * * return deparsed.query.decode('utf-8') # <<<<<<<<<<<<<< * finally: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_v_deparsed.query; __pyx_t_4 = __Pyx_ssize_strlen(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 448, __pyx_L7_error) __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_3, 0, __pyx_t_4, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 448, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_r = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L6_return; } /* "pglast/parser.pyx":450 * return deparsed.query.decode('utf-8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_deparse_result(deparsed) * */ /*finally:*/ { __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_1 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":451 * finally: * with nogil: * pg_query_free_deparse_result(deparsed) # <<<<<<<<<<<<<< * * */ pg_query_free_deparse_result(__pyx_v_deparsed); } /* "pglast/parser.pyx":450 * return deparsed.query.decode('utf-8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_deparse_result(deparsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L14; } __pyx_L14:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L1_error; } __pyx_L6_return: { __pyx_t_17 = __pyx_r; __pyx_r = 0; { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":451 * finally: * with nogil: * pg_query_free_deparse_result(deparsed) # <<<<<<<<<<<<<< * * */ pg_query_free_deparse_result(__pyx_v_deparsed); } /* "pglast/parser.pyx":450 * return deparsed.query.decode('utf-8') * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_deparse_result(deparsed) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } __pyx_r = __pyx_t_17; __pyx_t_17 = 0; goto __pyx_L0; } } /* "pglast/parser.pyx":433 * * * def deparse_protobuf(bytes protobuf): # <<<<<<<<<<<<<< * "Convert the ``protobuf`` serialized parse tree into an equivalent ``SQL`` statement." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.deparse_protobuf", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pglast/parser.pyx":457 * * * def scan(str query): # <<<<<<<<<<<<<< * "Lexify the given ``SQL`` `query` and return a list of its lexical tokens." * */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_17scan(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ PyDoc_STRVAR(__pyx_doc_6pglast_6parser_16scan, "Lexify the given ``SQL`` `query` and return a list of its lexical tokens."); static PyMethodDef __pyx_mdef_6pglast_6parser_17scan = {"scan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_17scan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pglast_6parser_16scan}; static PyObject *__pyx_pw_6pglast_6parser_17scan(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_query = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scan (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 457, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "scan") < 0)) __PYX_ERR(1, 457, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_query = ((PyObject*)values[0]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scan", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 457, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.scan", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(1, 457, __pyx_L1_error) __pyx_r = __pyx_pf_6pglast_6parser_16scan(__pyx_self, __pyx_v_query); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_16scan(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_query) { PgQueryScanResult __pyx_v_scanned; PgQuery__ScanResult *__pyx_v_scan_result; PgQuery__ScanToken *__pyx_v_scan_token; ProtobufCEnumValue const *__pyx_v_tkind; ProtobufCEnumValue const *__pyx_v_kwkind; char const *__pyx_v_cstring; size_t __pyx_v_i; PyObject *__pyx_v_utf8 = NULL; struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v_offset_to_index = NULL; PyObject *__pyx_v_message = NULL; PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_token = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; char *__pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; unsigned int __pyx_t_11; size_t __pyx_t_12; size_t __pyx_t_13; size_t __pyx_t_14; PyObject *__pyx_t_15 = NULL; char const *__pyx_t_16; int __pyx_t_17; int __pyx_t_18; char const *__pyx_t_19; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; PyObject *__pyx_t_24 = NULL; PyObject *__pyx_t_25 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scan", 1); /* "pglast/parser.pyx":468 * cdef size_t i * * utf8 = query.encode('utf-8') # <<<<<<<<<<<<<< * offset_to_index = Displacements(query) * cstring = utf8 */ if (unlikely(__pyx_v_query == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode"); __PYX_ERR(1, 468, __pyx_L1_error) } __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_utf8 = __pyx_t_1; __pyx_t_1 = 0; /* "pglast/parser.pyx":469 * * utf8 = query.encode('utf-8') * offset_to_index = Displacements(query) # <<<<<<<<<<<<<< * cstring = utf8 * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_offset_to_index = ((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":470 * utf8 = query.encode('utf-8') * offset_to_index = Displacements(query) * cstring = utf8 # <<<<<<<<<<<<<< * * with nogil: */ __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_utf8); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 470, __pyx_L1_error) __pyx_v_cstring = __pyx_t_2; /* "pglast/parser.pyx":472 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * scanned = pg_query_scan(cstring) * */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":473 * * with nogil: * scanned = pg_query_scan(cstring) # <<<<<<<<<<<<<< * * try: */ __pyx_v_scanned = pg_query_scan(__pyx_v_cstring); } /* "pglast/parser.pyx":472 * cstring = utf8 * * with nogil: # <<<<<<<<<<<<<< * scanned = pg_query_scan(cstring) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L5; } __pyx_L5:; } } /* "pglast/parser.pyx":475 * scanned = pg_query_scan(cstring) * * try: # <<<<<<<<<<<<<< * if scanned.error: * message = scanned.error.message.decode('utf8') */ /*try:*/ { /* "pglast/parser.pyx":476 * * try: * if scanned.error: # <<<<<<<<<<<<<< * message = scanned.error.message.decode('utf8') * raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) */ __pyx_t_3 = (__pyx_v_scanned.error != 0); if (unlikely(__pyx_t_3)) { /* "pglast/parser.pyx":477 * try: * if scanned.error: * message = scanned.error.message.decode('utf8') # <<<<<<<<<<<<<< * raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) * */ __pyx_t_4 = __pyx_v_scanned.error->message; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 477, __pyx_L7_error) __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_4, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_message = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":478 * if scanned.error: * message = scanned.error.message.decode('utf8') * raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) # <<<<<<<<<<<<<< * * with nogil: */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ParseError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 478, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_long((__pyx_v_scanned.error->cursorpos - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 478, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_9 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 478, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_t_9 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_message, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 478, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 478, __pyx_L7_error) /* "pglast/parser.pyx":476 * * try: * if scanned.error: # <<<<<<<<<<<<<< * message = scanned.error.message.decode('utf8') * raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) */ } /* "pglast/parser.pyx":480 * raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) * * with nogil: # <<<<<<<<<<<<<< * scan_result = pg_query__scan_result__unpack(NULL, scanned.pbuf.len, * scanned.pbuf.data) */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":481 * * with nogil: * scan_result = pg_query__scan_result__unpack(NULL, scanned.pbuf.len, # <<<<<<<<<<<<<< * scanned.pbuf.data) * */ __pyx_v_scan_result = pg_query__scan_result__unpack(NULL, __pyx_v_scanned.pbuf.len, ((uint8_t *)__pyx_v_scanned.pbuf.data)); } /* "pglast/parser.pyx":480 * raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) * * with nogil: # <<<<<<<<<<<<<< * scan_result = pg_query__scan_result__unpack(NULL, scanned.pbuf.len, * scanned.pbuf.data) */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L12; } __pyx_L12:; } } /* "pglast/parser.pyx":484 * scanned.pbuf.data) * * result = PyList_New(scan_result.n_tokens) # <<<<<<<<<<<<<< * * for i in range(scan_result.n_tokens): */ __pyx_t_1 = PyList_New(__pyx_v_scan_result->n_tokens); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":486 * result = PyList_New(scan_result.n_tokens) * * for i in range(scan_result.n_tokens): # <<<<<<<<<<<<<< * scan_token = scan_result.tokens[i] * tkind = protobuf_c_enum_descriptor_get_value(&pg_query__token__descriptor, */ __pyx_t_12 = __pyx_v_scan_result->n_tokens; __pyx_t_13 = __pyx_t_12; for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { __pyx_v_i = __pyx_t_14; /* "pglast/parser.pyx":487 * * for i in range(scan_result.n_tokens): * scan_token = scan_result.tokens[i] # <<<<<<<<<<<<<< * tkind = protobuf_c_enum_descriptor_get_value(&pg_query__token__descriptor, * scan_token.token) */ __pyx_v_scan_token = (__pyx_v_scan_result->tokens[__pyx_v_i]); /* "pglast/parser.pyx":488 * for i in range(scan_result.n_tokens): * scan_token = scan_result.tokens[i] * tkind = protobuf_c_enum_descriptor_get_value(&pg_query__token__descriptor, # <<<<<<<<<<<<<< * scan_token.token) * kwkind = protobuf_c_enum_descriptor_get_value(&pg_query__keyword_kind__descriptor, */ __pyx_v_tkind = protobuf_c_enum_descriptor_get_value((&pg_query__token__descriptor), __pyx_v_scan_token->token); /* "pglast/parser.pyx":490 * tkind = protobuf_c_enum_descriptor_get_value(&pg_query__token__descriptor, * scan_token.token) * kwkind = protobuf_c_enum_descriptor_get_value(&pg_query__keyword_kind__descriptor, # <<<<<<<<<<<<<< * scan_token.keyword_kind) * */ __pyx_v_kwkind = protobuf_c_enum_descriptor_get_value((&pg_query__keyword_kind__descriptor), __pyx_v_scan_token->keyword_kind); /* "pglast/parser.pyx":493 * scan_token.keyword_kind) * * token = Token(offset_to_index(scan_token.start), offset_to_index(scan_token.end-1), # <<<<<<<<<<<<<< * tkind.name.decode('ascii') if tkind != NULL else "UNKNOWN", * kwkind.name.decode('ascii')) */ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Token); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_scan_token->start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_8 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 493, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_t_9 = __Pyx_PyInt_From_long((__pyx_v_scan_token->end - 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF((PyObject *)__pyx_v_offset_to_index); __pyx_t_10 = ((PyObject *)__pyx_v_offset_to_index); __pyx_t_15 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_9}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 493, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } /* "pglast/parser.pyx":494 * * token = Token(offset_to_index(scan_token.start), offset_to_index(scan_token.end-1), * tkind.name.decode('ascii') if tkind != NULL else "UNKNOWN", # <<<<<<<<<<<<<< * kwkind.name.decode('ascii')) * Py_INCREF(token) */ __pyx_t_3 = (__pyx_v_tkind != NULL); if (__pyx_t_3) { __pyx_t_16 = __pyx_v_tkind->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_16); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 494, __pyx_L7_error) __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_16, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 494, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = __pyx_t_9; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __Pyx_INCREF(__pyx_n_u_UNKNOWN); __pyx_t_10 = __pyx_n_u_UNKNOWN; } /* "pglast/parser.pyx":495 * token = Token(offset_to_index(scan_token.start), offset_to_index(scan_token.end-1), * tkind.name.decode('ascii') if tkind != NULL else "UNKNOWN", * kwkind.name.decode('ascii')) # <<<<<<<<<<<<<< * Py_INCREF(token) * PyList_SET_ITEM(result, i, token) */ __pyx_t_16 = __pyx_v_kwkind->name; __pyx_t_5 = __Pyx_ssize_strlen(__pyx_t_16); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 495, __pyx_L7_error) __pyx_t_9 = __Pyx_decode_c_string(__pyx_t_16, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_15 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_11 = 1; } } #endif { PyObject *__pyx_callargs[5] = {__pyx_t_15, __pyx_t_7, __pyx_t_8, __pyx_t_10, __pyx_t_9}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_11, 4+__pyx_t_11); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_1); __pyx_t_1 = 0; /* "pglast/parser.pyx":496 * tkind.name.decode('ascii') if tkind != NULL else "UNKNOWN", * kwkind.name.decode('ascii')) * Py_INCREF(token) # <<<<<<<<<<<<<< * PyList_SET_ITEM(result, i, token) * */ Py_INCREF(__pyx_v_token); /* "pglast/parser.pyx":497 * kwkind.name.decode('ascii')) * Py_INCREF(token) * PyList_SET_ITEM(result, i, token) # <<<<<<<<<<<<<< * * with nogil: */ PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_token); } /* "pglast/parser.pyx":499 * PyList_SET_ITEM(result, i, token) * * with nogil: # <<<<<<<<<<<<<< * pg_query__scan_result__free_unpacked(scan_result, NULL) * finally: */ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":500 * * with nogil: * pg_query__scan_result__free_unpacked(scan_result, NULL) # <<<<<<<<<<<<<< * finally: * with nogil: */ pg_query__scan_result__free_unpacked(__pyx_v_scan_result, NULL); } /* "pglast/parser.pyx":499 * PyList_SET_ITEM(result, i, token) * * with nogil: # <<<<<<<<<<<<<< * pg_query__scan_result__free_unpacked(scan_result, NULL) * finally: */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L17; } __pyx_L17:; } } } /* "pglast/parser.pyx":502 * pg_query__scan_result__free_unpacked(scan_result, NULL) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_scan_result(scanned) * */ /*finally:*/ { /*normal exit:*/{ { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":503 * finally: * with nogil: * pg_query_free_scan_result(scanned) # <<<<<<<<<<<<<< * * return result */ pg_query_free_scan_result(__pyx_v_scanned); } /* "pglast/parser.pyx":502 * pg_query__scan_result__free_unpacked(scan_result, NULL) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_scan_result(scanned) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L20; } __pyx_L20:; } } goto __pyx_L8; } __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); __Pyx_XGOTREF(__pyx_t_20); __Pyx_XGOTREF(__pyx_t_21); __Pyx_XGOTREF(__pyx_t_22); __Pyx_XGOTREF(__pyx_t_23); __Pyx_XGOTREF(__pyx_t_24); __Pyx_XGOTREF(__pyx_t_25); __pyx_t_17 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename; { { #ifdef WITH_THREAD PyThreadState *_save; _save = NULL; Py_UNBLOCK_THREADS __Pyx_FastGIL_Remember(); #endif /*try:*/ { /* "pglast/parser.pyx":503 * finally: * with nogil: * pg_query_free_scan_result(scanned) # <<<<<<<<<<<<<< * * return result */ pg_query_free_scan_result(__pyx_v_scanned); } /* "pglast/parser.pyx":502 * pg_query__scan_result__free_unpacked(scan_result, NULL) * finally: * with nogil: # <<<<<<<<<<<<<< * pg_query_free_scan_result(scanned) * */ /*finally:*/ { /*normal exit:*/{ #ifdef WITH_THREAD __Pyx_FastGIL_Forget(); Py_BLOCK_THREADS #endif goto __pyx_L25; } __pyx_L25:; } } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_23); __Pyx_XGIVEREF(__pyx_t_24); __Pyx_XGIVEREF(__pyx_t_25); __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_24, __pyx_t_25); } __Pyx_XGIVEREF(__pyx_t_20); __Pyx_XGIVEREF(__pyx_t_21); __Pyx_XGIVEREF(__pyx_t_22); __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22); __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_lineno = __pyx_t_17; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19; goto __pyx_L1_error; } __pyx_L8:; } /* "pglast/parser.pyx":505 * pg_query_free_scan_result(scanned) * * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "pglast/parser.pyx":457 * * * def scan(str query): # <<<<<<<<<<<<<< * "Lexify the given ``SQL`` `query` and return a list of its lexical tokens." * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("pglast.parser.scan", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_utf8); __Pyx_XDECREF((PyObject *)__pyx_v_offset_to_index); __Pyx_XDECREF(__pyx_v_message); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_token); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_Displacements(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_6pglast_6parser_19__pyx_unpickle_Displacements(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyMethodDef __pyx_mdef_6pglast_6parser_19__pyx_unpickle_Displacements = {"__pyx_unpickle_Displacements", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_19__pyx_unpickle_Displacements, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_6pglast_6parser_19__pyx_unpickle_Displacements(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_Displacements (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Displacements", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Displacements", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Displacements") < 0)) __PYX_ERR(2, 1, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Displacements", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_AddTraceback("pglast.parser.__pyx_unpickle_Displacements", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_6pglast_6parser_18__pyx_unpickle_Displacements(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_6pglast_6parser_18__pyx_unpickle_Displacements(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Displacements", 1); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x236a782, 0x2e307f9, 0x7645d40): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum */ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple_, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum not in (0x236a782, 0x2e307f9, 0x7645d40): * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum * __pyx_result = Displacements.__new__(__pyx_type) */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v___pyx_PickleError = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum not in (0x236a782, 0x2e307f9, 0x7645d40): * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum # <<<<<<<<<<<<<< * __pyx_result = Displacements.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(2, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x236a782, 0x2e307f9, 0x7645d40): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum * __pyx_result = Displacements.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6pglast_6parser_Displacements), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v___pyx_result = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum * __pyx_result = Displacements.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_2 = (__pyx_v___pyx_state != Py_None); if (__pyx_t_2) { /* "(tree fragment)":9 * __pyx_result = Displacements.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error) __pyx_t_1 = __pyx_f_6pglast_6parser___pyx_unpickle_Displacements__set_state(((struct __pyx_obj_6pglast_6parser_Displacements *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum * __pyx_result = Displacements.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_Displacements(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("pglast.parser.__pyx_unpickle_Displacements", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_6pglast_6parser___pyx_unpickle_Displacements__set_state(struct __pyx_obj_6pglast_6parser_Displacements *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; unsigned long __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; unsigned int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Displacements__set_state", 1); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] # <<<<<<<<<<<<<< * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->displacements); __Pyx_DECREF(__pyx_v___pyx_result->displacements); __pyx_v___pyx_result->displacements = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_unsigned_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v___pyx_result->max_offset = __pyx_t_2; /* "(tree fragment)":13 * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(2, 13, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 > 2); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "(tree fragment)":14 * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(2, 14, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[2]) */ } /* "(tree fragment)":11 * __pyx_unpickle_Displacements__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Displacements__set_state(Displacements __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.displacements = __pyx_state[0]; __pyx_result.max_offset = __pyx_state[1] * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pglast.parser.__pyx_unpickle_Displacements__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_6pglast_6parser_Displacements(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_6pglast_6parser_Displacements *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; #endif p = ((struct __pyx_obj_6pglast_6parser_Displacements *)o); p->displacements = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_6pglast_6parser_Displacements(PyObject *o) { struct __pyx_obj_6pglast_6parser_Displacements *p = (struct __pyx_obj_6pglast_6parser_Displacements *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_6pglast_6parser_Displacements) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->displacements); #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY (*Py_TYPE(o)->tp_free)(o); #else { freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); if (tp_free) tp_free(o); } #endif } static int __pyx_tp_traverse_6pglast_6parser_Displacements(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_6pglast_6parser_Displacements *p = (struct __pyx_obj_6pglast_6parser_Displacements *)o; if (p->displacements) { e = (*v)(p->displacements, a); if (e) return e; } return 0; } static int __pyx_tp_clear_6pglast_6parser_Displacements(PyObject *o) { PyObject* tmp; struct __pyx_obj_6pglast_6parser_Displacements *p = (struct __pyx_obj_6pglast_6parser_Displacements *)o; tmp = ((PyObject*)p->displacements); p->displacements = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_6pglast_6parser_Displacements[] = { {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_13Displacements_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pglast_6parser_13Displacements_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_type_6pglast_6parser_Displacements_slots[] = { {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6pglast_6parser_Displacements}, {Py_tp_call, (void *)__pyx_pw_6pglast_6parser_13Displacements_3__call__}, {Py_tp_doc, (void *)PyDoc_STR("\n Helper class used to find the index of Unicode character from its offset in the\n corresponding UTF-8 encoded array.\n\n Example:\n\n >>> unicode = '\342\202\254 0.01'\n >>> utf8 = unicode.encode('utf-8')\n >>> d = pglast.parser.Displacements(unicode)\n >>> for offset in range(len(utf8)):\n ... print(f'{offset} [{utf8[offset]:2x}] -> {d(offset)} [{unicode[d(offset)]}]')\n ...\n 0 [e2] -> 0 [\342\202\254]\n 1 [82] -> 0 [\342\202\254]\n 2 [ac] -> 0 [\342\202\254]\n 3 [20] -> 1 [ ]\n 4 [30] -> 2 [0]\n 5 [2e] -> 3 [.]\n 6 [30] -> 4 [0]\n 7 [31] -> 5 [1]\n ")}, {Py_tp_traverse, (void *)__pyx_tp_traverse_6pglast_6parser_Displacements}, {Py_tp_clear, (void *)__pyx_tp_clear_6pglast_6parser_Displacements}, {Py_tp_methods, (void *)__pyx_methods_6pglast_6parser_Displacements}, {Py_tp_init, (void *)__pyx_pw_6pglast_6parser_13Displacements_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_6pglast_6parser_Displacements}, {0, 0}, }; static PyType_Spec __pyx_type_6pglast_6parser_Displacements_spec = { "pglast.parser.Displacements", sizeof(struct __pyx_obj_6pglast_6parser_Displacements), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, __pyx_type_6pglast_6parser_Displacements_slots, }; #else static PyTypeObject __pyx_type_6pglast_6parser_Displacements = { PyVarObject_HEAD_INIT(0, 0) "pglast.parser.""Displacements", /*tp_name*/ sizeof(struct __pyx_obj_6pglast_6parser_Displacements), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6pglast_6parser_Displacements, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_6pglast_6parser_13Displacements_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ PyDoc_STR("\n Helper class used to find the index of Unicode character from its offset in the\n corresponding UTF-8 encoded array.\n\n Example:\n\n >>> unicode = '\342\202\254 0.01'\n >>> utf8 = unicode.encode('utf-8')\n >>> d = pglast.parser.Displacements(unicode)\n >>> for offset in range(len(utf8)):\n ... print(f'{offset} [{utf8[offset]:2x}] -> {d(offset)} [{unicode[d(offset)]}]')\n ...\n 0 [e2] -> 0 [\342\202\254]\n 1 [82] -> 0 [\342\202\254]\n 2 [ac] -> 0 [\342\202\254]\n 3 [20] -> 1 [ ]\n 4 [30] -> 2 [0]\n 5 [2e] -> 3 [.]\n 6 [30] -> 4 [0]\n 7 [31] -> 5 [1]\n "), /*tp_doc*/ __pyx_tp_traverse_6pglast_6parser_Displacements, /*tp_traverse*/ __pyx_tp_clear_6pglast_6parser_Displacements, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6pglast_6parser_Displacements, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif __pyx_pw_6pglast_6parser_13Displacements_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6pglast_6parser_Displacements, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif #if __PYX_NEED_TP_PRINT_SLOT == 1 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030C0000 0, /*tp_watched*/ #endif #if PY_VERSION_HEX >= 0x030d00A4 0, /*tp_versions_used*/ #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, /*tp_pypy_flags*/ #endif }; #endif static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif /* #### Code section: pystring_table ### */ static int __Pyx_CreateStringTabAndInitStrings(void) { __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_A_ArrayExpr, __pyx_k_A_ArrayExpr, sizeof(__pyx_k_A_ArrayExpr), 0, 0, 1, 1}, {&__pyx_n_s_A_Const, __pyx_k_A_Const, sizeof(__pyx_k_A_Const), 0, 0, 1, 1}, {&__pyx_n_s_A_Expr, __pyx_k_A_Expr, sizeof(__pyx_k_A_Expr), 0, 0, 1, 1}, {&__pyx_n_u_A_Expr_Kind, __pyx_k_A_Expr_Kind, sizeof(__pyx_k_A_Expr_Kind), 0, 1, 0, 1}, {&__pyx_n_s_A_Indices, __pyx_k_A_Indices, sizeof(__pyx_k_A_Indices), 0, 0, 1, 1}, {&__pyx_n_s_A_Indirection, __pyx_k_A_Indirection, sizeof(__pyx_k_A_Indirection), 0, 0, 1, 1}, {&__pyx_n_s_A_Star, __pyx_k_A_Star, sizeof(__pyx_k_A_Star), 0, 0, 1, 1}, {&__pyx_n_s_AccessPriv, __pyx_k_AccessPriv, sizeof(__pyx_k_AccessPriv), 0, 0, 1, 1}, {&__pyx_n_u_AggSplit, __pyx_k_AggSplit, sizeof(__pyx_k_AggSplit), 0, 1, 0, 1}, {&__pyx_n_s_Aggref, __pyx_k_Aggref, sizeof(__pyx_k_Aggref), 0, 0, 1, 1}, {&__pyx_n_s_Alias, __pyx_k_Alias, sizeof(__pyx_k_Alias), 0, 0, 1, 1}, {&__pyx_n_s_AlterCollationStmt, __pyx_k_AlterCollationStmt, sizeof(__pyx_k_AlterCollationStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterDatabaseRefreshCollStmt, __pyx_k_AlterDatabaseRefreshCollStmt, sizeof(__pyx_k_AlterDatabaseRefreshCollStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterDatabaseSetStmt, __pyx_k_AlterDatabaseSetStmt, sizeof(__pyx_k_AlterDatabaseSetStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterDatabaseStmt, __pyx_k_AlterDatabaseStmt, sizeof(__pyx_k_AlterDatabaseStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterDefaultPrivilegesStmt, __pyx_k_AlterDefaultPrivilegesStmt, sizeof(__pyx_k_AlterDefaultPrivilegesStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterDomainStmt, __pyx_k_AlterDomainStmt, sizeof(__pyx_k_AlterDomainStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterEnumStmt, __pyx_k_AlterEnumStmt, sizeof(__pyx_k_AlterEnumStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterEventTrigStmt, __pyx_k_AlterEventTrigStmt, sizeof(__pyx_k_AlterEventTrigStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterExtensionContentsStmt, __pyx_k_AlterExtensionContentsStmt, sizeof(__pyx_k_AlterExtensionContentsStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterExtensionStmt, __pyx_k_AlterExtensionStmt, sizeof(__pyx_k_AlterExtensionStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterFdwStmt, __pyx_k_AlterFdwStmt, sizeof(__pyx_k_AlterFdwStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterForeignServerStmt, __pyx_k_AlterForeignServerStmt, sizeof(__pyx_k_AlterForeignServerStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterFunctionStmt, __pyx_k_AlterFunctionStmt, sizeof(__pyx_k_AlterFunctionStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterObjectDependsStmt, __pyx_k_AlterObjectDependsStmt, sizeof(__pyx_k_AlterObjectDependsStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterObjectSchemaStmt, __pyx_k_AlterObjectSchemaStmt, sizeof(__pyx_k_AlterObjectSchemaStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterOpFamilyStmt, __pyx_k_AlterOpFamilyStmt, sizeof(__pyx_k_AlterOpFamilyStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterOperatorStmt, __pyx_k_AlterOperatorStmt, sizeof(__pyx_k_AlterOperatorStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterOwnerStmt, __pyx_k_AlterOwnerStmt, sizeof(__pyx_k_AlterOwnerStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterPolicyStmt, __pyx_k_AlterPolicyStmt, sizeof(__pyx_k_AlterPolicyStmt), 0, 0, 1, 1}, {&__pyx_n_u_AlterPublicationAction, __pyx_k_AlterPublicationAction, sizeof(__pyx_k_AlterPublicationAction), 0, 1, 0, 1}, {&__pyx_n_s_AlterPublicationStmt, __pyx_k_AlterPublicationStmt, sizeof(__pyx_k_AlterPublicationStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterRoleSetStmt, __pyx_k_AlterRoleSetStmt, sizeof(__pyx_k_AlterRoleSetStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterRoleStmt, __pyx_k_AlterRoleStmt, sizeof(__pyx_k_AlterRoleStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterSeqStmt, __pyx_k_AlterSeqStmt, sizeof(__pyx_k_AlterSeqStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterStatsStmt, __pyx_k_AlterStatsStmt, sizeof(__pyx_k_AlterStatsStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterSubscriptionStmt, __pyx_k_AlterSubscriptionStmt, sizeof(__pyx_k_AlterSubscriptionStmt), 0, 0, 1, 1}, {&__pyx_n_u_AlterSubscriptionType, __pyx_k_AlterSubscriptionType, sizeof(__pyx_k_AlterSubscriptionType), 0, 1, 0, 1}, {&__pyx_n_s_AlterSystemStmt, __pyx_k_AlterSystemStmt, sizeof(__pyx_k_AlterSystemStmt), 0, 0, 1, 1}, {&__pyx_n_u_AlterTSConfigType, __pyx_k_AlterTSConfigType, sizeof(__pyx_k_AlterTSConfigType), 0, 1, 0, 1}, {&__pyx_n_s_AlterTSConfigurationStmt, __pyx_k_AlterTSConfigurationStmt, sizeof(__pyx_k_AlterTSConfigurationStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterTSDictionaryStmt, __pyx_k_AlterTSDictionaryStmt, sizeof(__pyx_k_AlterTSDictionaryStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterTableCmd, __pyx_k_AlterTableCmd, sizeof(__pyx_k_AlterTableCmd), 0, 0, 1, 1}, {&__pyx_n_s_AlterTableMoveAllStmt, __pyx_k_AlterTableMoveAllStmt, sizeof(__pyx_k_AlterTableMoveAllStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterTableSpaceOptionsStmt, __pyx_k_AlterTableSpaceOptionsStmt, sizeof(__pyx_k_AlterTableSpaceOptionsStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterTableStmt, __pyx_k_AlterTableStmt, sizeof(__pyx_k_AlterTableStmt), 0, 0, 1, 1}, {&__pyx_n_u_AlterTableType, __pyx_k_AlterTableType, sizeof(__pyx_k_AlterTableType), 0, 1, 0, 1}, {&__pyx_n_s_AlterTypeStmt, __pyx_k_AlterTypeStmt, sizeof(__pyx_k_AlterTypeStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlterUserMappingStmt, __pyx_k_AlterUserMappingStmt, sizeof(__pyx_k_AlterUserMappingStmt), 0, 0, 1, 1}, {&__pyx_n_s_AlternativeSubPlan, __pyx_k_AlternativeSubPlan, sizeof(__pyx_k_AlternativeSubPlan), 0, 0, 1, 1}, {&__pyx_n_s_ArrayCoerceExpr, __pyx_k_ArrayCoerceExpr, sizeof(__pyx_k_ArrayCoerceExpr), 0, 0, 1, 1}, {&__pyx_n_s_ArrayExpr, __pyx_k_ArrayExpr, sizeof(__pyx_k_ArrayExpr), 0, 0, 1, 1}, {&__pyx_n_s_BitString, __pyx_k_BitString, sizeof(__pyx_k_BitString), 0, 0, 1, 1}, {&__pyx_n_s_BoolExpr, __pyx_k_BoolExpr, sizeof(__pyx_k_BoolExpr), 0, 0, 1, 1}, {&__pyx_n_u_BoolExprType, __pyx_k_BoolExprType, sizeof(__pyx_k_BoolExprType), 0, 1, 0, 1}, {&__pyx_n_u_BoolTestType, __pyx_k_BoolTestType, sizeof(__pyx_k_BoolTestType), 0, 1, 0, 1}, {&__pyx_n_s_Boolean, __pyx_k_Boolean, sizeof(__pyx_k_Boolean), 0, 0, 1, 1}, {&__pyx_n_s_BooleanTest, __pyx_k_BooleanTest, sizeof(__pyx_k_BooleanTest), 0, 0, 1, 1}, {&__pyx_n_s_CTECycleClause, __pyx_k_CTECycleClause, sizeof(__pyx_k_CTECycleClause), 0, 0, 1, 1}, {&__pyx_n_u_CTEMaterialize, __pyx_k_CTEMaterialize, sizeof(__pyx_k_CTEMaterialize), 0, 1, 0, 1}, {&__pyx_n_s_CTESearchClause, __pyx_k_CTESearchClause, sizeof(__pyx_k_CTESearchClause), 0, 0, 1, 1}, {&__pyx_n_s_CallContext, __pyx_k_CallContext, sizeof(__pyx_k_CallContext), 0, 0, 1, 1}, {&__pyx_n_s_CallStmt, __pyx_k_CallStmt, sizeof(__pyx_k_CallStmt), 0, 0, 1, 1}, {&__pyx_n_s_CaseExpr, __pyx_k_CaseExpr, sizeof(__pyx_k_CaseExpr), 0, 0, 1, 1}, {&__pyx_n_s_CaseTestExpr, __pyx_k_CaseTestExpr, sizeof(__pyx_k_CaseTestExpr), 0, 0, 1, 1}, {&__pyx_n_s_CaseWhen, __pyx_k_CaseWhen, sizeof(__pyx_k_CaseWhen), 0, 0, 1, 1}, {&__pyx_n_s_CheckPointStmt, __pyx_k_CheckPointStmt, sizeof(__pyx_k_CheckPointStmt), 0, 0, 1, 1}, {&__pyx_n_s_ClosePortalStmt, __pyx_k_ClosePortalStmt, sizeof(__pyx_k_ClosePortalStmt), 0, 0, 1, 1}, {&__pyx_n_s_ClusterStmt, __pyx_k_ClusterStmt, sizeof(__pyx_k_ClusterStmt), 0, 0, 1, 1}, {&__pyx_n_u_CmdType, __pyx_k_CmdType, sizeof(__pyx_k_CmdType), 0, 1, 0, 1}, {&__pyx_n_s_CoalesceExpr, __pyx_k_CoalesceExpr, sizeof(__pyx_k_CoalesceExpr), 0, 0, 1, 1}, {&__pyx_n_s_CoerceToDomain, __pyx_k_CoerceToDomain, sizeof(__pyx_k_CoerceToDomain), 0, 0, 1, 1}, {&__pyx_n_s_CoerceToDomainValue, __pyx_k_CoerceToDomainValue, sizeof(__pyx_k_CoerceToDomainValue), 0, 0, 1, 1}, {&__pyx_n_s_CoerceViaIO, __pyx_k_CoerceViaIO, sizeof(__pyx_k_CoerceViaIO), 0, 0, 1, 1}, {&__pyx_n_u_CoercionContext, __pyx_k_CoercionContext, sizeof(__pyx_k_CoercionContext), 0, 1, 0, 1}, {&__pyx_n_u_CoercionForm, __pyx_k_CoercionForm, sizeof(__pyx_k_CoercionForm), 0, 1, 0, 1}, {&__pyx_n_s_CollateClause, __pyx_k_CollateClause, sizeof(__pyx_k_CollateClause), 0, 0, 1, 1}, {&__pyx_n_s_CollateExpr, __pyx_k_CollateExpr, sizeof(__pyx_k_CollateExpr), 0, 0, 1, 1}, {&__pyx_n_s_ColumnDef, __pyx_k_ColumnDef, sizeof(__pyx_k_ColumnDef), 0, 0, 1, 1}, {&__pyx_n_s_ColumnRef, __pyx_k_ColumnRef, sizeof(__pyx_k_ColumnRef), 0, 0, 1, 1}, {&__pyx_n_s_CommentStmt, __pyx_k_CommentStmt, sizeof(__pyx_k_CommentStmt), 0, 0, 1, 1}, {&__pyx_n_s_CommonTableExpr, __pyx_k_CommonTableExpr, sizeof(__pyx_k_CommonTableExpr), 0, 0, 1, 1}, {&__pyx_n_s_CompositeTypeStmt, __pyx_k_CompositeTypeStmt, sizeof(__pyx_k_CompositeTypeStmt), 0, 0, 1, 1}, {&__pyx_n_u_ConstrType, __pyx_k_ConstrType, sizeof(__pyx_k_ConstrType), 0, 1, 0, 1}, {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, {&__pyx_n_s_ConstraintsSetStmt, __pyx_k_ConstraintsSetStmt, sizeof(__pyx_k_ConstraintsSetStmt), 0, 0, 1, 1}, {&__pyx_n_s_ConvertRowtypeExpr, __pyx_k_ConvertRowtypeExpr, sizeof(__pyx_k_ConvertRowtypeExpr), 0, 0, 1, 1}, {&__pyx_n_s_CopyStmt, __pyx_k_CopyStmt, sizeof(__pyx_k_CopyStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateAmStmt, __pyx_k_CreateAmStmt, sizeof(__pyx_k_CreateAmStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateCastStmt, __pyx_k_CreateCastStmt, sizeof(__pyx_k_CreateCastStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateConversionStmt, __pyx_k_CreateConversionStmt, sizeof(__pyx_k_CreateConversionStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateDomainStmt, __pyx_k_CreateDomainStmt, sizeof(__pyx_k_CreateDomainStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateEnumStmt, __pyx_k_CreateEnumStmt, sizeof(__pyx_k_CreateEnumStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateEventTrigStmt, __pyx_k_CreateEventTrigStmt, sizeof(__pyx_k_CreateEventTrigStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateExtensionStmt, __pyx_k_CreateExtensionStmt, sizeof(__pyx_k_CreateExtensionStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateFdwStmt, __pyx_k_CreateFdwStmt, sizeof(__pyx_k_CreateFdwStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateForeignServerStmt, __pyx_k_CreateForeignServerStmt, sizeof(__pyx_k_CreateForeignServerStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateForeignTableStmt, __pyx_k_CreateForeignTableStmt, sizeof(__pyx_k_CreateForeignTableStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateFunctionStmt, __pyx_k_CreateFunctionStmt, sizeof(__pyx_k_CreateFunctionStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateOpClassItem, __pyx_k_CreateOpClassItem, sizeof(__pyx_k_CreateOpClassItem), 0, 0, 1, 1}, {&__pyx_n_s_CreateOpClassStmt, __pyx_k_CreateOpClassStmt, sizeof(__pyx_k_CreateOpClassStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateOpFamilyStmt, __pyx_k_CreateOpFamilyStmt, sizeof(__pyx_k_CreateOpFamilyStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreatePLangStmt, __pyx_k_CreatePLangStmt, sizeof(__pyx_k_CreatePLangStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreatePolicyStmt, __pyx_k_CreatePolicyStmt, sizeof(__pyx_k_CreatePolicyStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreatePublicationStmt, __pyx_k_CreatePublicationStmt, sizeof(__pyx_k_CreatePublicationStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateRangeStmt, __pyx_k_CreateRangeStmt, sizeof(__pyx_k_CreateRangeStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateRoleStmt, __pyx_k_CreateRoleStmt, sizeof(__pyx_k_CreateRoleStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateSchemaStmt, __pyx_k_CreateSchemaStmt, sizeof(__pyx_k_CreateSchemaStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateSeqStmt, __pyx_k_CreateSeqStmt, sizeof(__pyx_k_CreateSeqStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateStatsStmt, __pyx_k_CreateStatsStmt, sizeof(__pyx_k_CreateStatsStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateStmt, __pyx_k_CreateStmt, sizeof(__pyx_k_CreateStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateSubscriptionStmt, __pyx_k_CreateSubscriptionStmt, sizeof(__pyx_k_CreateSubscriptionStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateTableAsStmt, __pyx_k_CreateTableAsStmt, sizeof(__pyx_k_CreateTableAsStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateTableSpaceStmt, __pyx_k_CreateTableSpaceStmt, sizeof(__pyx_k_CreateTableSpaceStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateTransformStmt, __pyx_k_CreateTransformStmt, sizeof(__pyx_k_CreateTransformStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateTrigStmt, __pyx_k_CreateTrigStmt, sizeof(__pyx_k_CreateTrigStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreateUserMappingStmt, __pyx_k_CreateUserMappingStmt, sizeof(__pyx_k_CreateUserMappingStmt), 0, 0, 1, 1}, {&__pyx_n_s_CreatedbStmt, __pyx_k_CreatedbStmt, sizeof(__pyx_k_CreatedbStmt), 0, 0, 1, 1}, {&__pyx_n_s_CurrentOfExpr, __pyx_k_CurrentOfExpr, sizeof(__pyx_k_CurrentOfExpr), 0, 0, 1, 1}, {&__pyx_n_s_DeallocateStmt, __pyx_k_DeallocateStmt, sizeof(__pyx_k_DeallocateStmt), 0, 0, 1, 1}, {&__pyx_n_s_DeclareCursorStmt, __pyx_k_DeclareCursorStmt, sizeof(__pyx_k_DeclareCursorStmt), 0, 0, 1, 1}, {&__pyx_n_s_DefElem, __pyx_k_DefElem, sizeof(__pyx_k_DefElem), 0, 0, 1, 1}, {&__pyx_n_u_DefElemAction, __pyx_k_DefElemAction, sizeof(__pyx_k_DefElemAction), 0, 1, 0, 1}, {&__pyx_n_s_DefineStmt, __pyx_k_DefineStmt, sizeof(__pyx_k_DefineStmt), 0, 0, 1, 1}, {&__pyx_n_s_DeleteStmt, __pyx_k_DeleteStmt, sizeof(__pyx_k_DeleteStmt), 0, 0, 1, 1}, {&__pyx_n_s_DeparseError, __pyx_k_DeparseError, sizeof(__pyx_k_DeparseError), 0, 0, 1, 1}, {&__pyx_n_s_DeparseError___str, __pyx_k_DeparseError___str, sizeof(__pyx_k_DeparseError___str), 0, 0, 1, 1}, {&__pyx_n_u_DiscardMode, __pyx_k_DiscardMode, sizeof(__pyx_k_DiscardMode), 0, 1, 0, 1}, {&__pyx_n_s_DiscardStmt, __pyx_k_DiscardStmt, sizeof(__pyx_k_DiscardStmt), 0, 0, 1, 1}, {&__pyx_n_s_Displacements, __pyx_k_Displacements, sizeof(__pyx_k_Displacements), 0, 0, 1, 1}, {&__pyx_n_s_Displacements___reduce_cython, __pyx_k_Displacements___reduce_cython, sizeof(__pyx_k_Displacements___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_Displacements___setstate_cython, __pyx_k_Displacements___setstate_cython, sizeof(__pyx_k_Displacements___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_DoStmt, __pyx_k_DoStmt, sizeof(__pyx_k_DoStmt), 0, 0, 1, 1}, {&__pyx_n_u_DropBehavior, __pyx_k_DropBehavior, sizeof(__pyx_k_DropBehavior), 0, 1, 0, 1}, {&__pyx_n_s_DropOwnedStmt, __pyx_k_DropOwnedStmt, sizeof(__pyx_k_DropOwnedStmt), 0, 0, 1, 1}, {&__pyx_n_s_DropRoleStmt, __pyx_k_DropRoleStmt, sizeof(__pyx_k_DropRoleStmt), 0, 0, 1, 1}, {&__pyx_n_s_DropStmt, __pyx_k_DropStmt, sizeof(__pyx_k_DropStmt), 0, 0, 1, 1}, {&__pyx_n_s_DropSubscriptionStmt, __pyx_k_DropSubscriptionStmt, sizeof(__pyx_k_DropSubscriptionStmt), 0, 0, 1, 1}, {&__pyx_n_s_DropTableSpaceStmt, __pyx_k_DropTableSpaceStmt, sizeof(__pyx_k_DropTableSpaceStmt), 0, 0, 1, 1}, {&__pyx_n_s_DropUserMappingStmt, __pyx_k_DropUserMappingStmt, sizeof(__pyx_k_DropUserMappingStmt), 0, 0, 1, 1}, {&__pyx_n_s_DropdbStmt, __pyx_k_DropdbStmt, sizeof(__pyx_k_DropdbStmt), 0, 0, 1, 1}, {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, {&__pyx_kp_s_Exception_representing_the_error, __pyx_k_Exception_representing_the_error, sizeof(__pyx_k_Exception_representing_the_error), 0, 0, 1, 0}, {&__pyx_kp_s_Exception_representing_the_error_2, __pyx_k_Exception_representing_the_error_2, sizeof(__pyx_k_Exception_representing_the_error_2), 0, 0, 1, 0}, {&__pyx_n_s_ExecuteStmt, __pyx_k_ExecuteStmt, sizeof(__pyx_k_ExecuteStmt), 0, 0, 1, 1}, {&__pyx_n_s_ExplainStmt, __pyx_k_ExplainStmt, sizeof(__pyx_k_ExplainStmt), 0, 0, 1, 1}, {&__pyx_n_u_FetchDirection, __pyx_k_FetchDirection, sizeof(__pyx_k_FetchDirection), 0, 1, 0, 1}, {&__pyx_n_s_FetchStmt, __pyx_k_FetchStmt, sizeof(__pyx_k_FetchStmt), 0, 0, 1, 1}, {&__pyx_n_s_FieldSelect, __pyx_k_FieldSelect, sizeof(__pyx_k_FieldSelect), 0, 0, 1, 1}, {&__pyx_n_s_FieldStore, __pyx_k_FieldStore, sizeof(__pyx_k_FieldStore), 0, 0, 1, 1}, {&__pyx_n_s_Float, __pyx_k_Float, sizeof(__pyx_k_Float), 0, 0, 1, 1}, {&__pyx_n_s_FromExpr, __pyx_k_FromExpr, sizeof(__pyx_k_FromExpr), 0, 0, 1, 1}, {&__pyx_n_s_FuncCall, __pyx_k_FuncCall, sizeof(__pyx_k_FuncCall), 0, 0, 1, 1}, {&__pyx_n_s_FuncExpr, __pyx_k_FuncExpr, sizeof(__pyx_k_FuncExpr), 0, 0, 1, 1}, {&__pyx_n_s_FunctionParameter, __pyx_k_FunctionParameter, sizeof(__pyx_k_FunctionParameter), 0, 0, 1, 1}, {&__pyx_n_u_FunctionParameterMode, __pyx_k_FunctionParameterMode, sizeof(__pyx_k_FunctionParameterMode), 0, 1, 0, 1}, {&__pyx_n_s_GrantRoleStmt, __pyx_k_GrantRoleStmt, sizeof(__pyx_k_GrantRoleStmt), 0, 0, 1, 1}, {&__pyx_n_s_GrantStmt, __pyx_k_GrantStmt, sizeof(__pyx_k_GrantStmt), 0, 0, 1, 1}, {&__pyx_n_u_GrantTargetType, __pyx_k_GrantTargetType, sizeof(__pyx_k_GrantTargetType), 0, 1, 0, 1}, {&__pyx_n_s_GroupingFunc, __pyx_k_GroupingFunc, sizeof(__pyx_k_GroupingFunc), 0, 0, 1, 1}, {&__pyx_n_s_GroupingSet, __pyx_k_GroupingSet, sizeof(__pyx_k_GroupingSet), 0, 0, 1, 1}, {&__pyx_n_u_GroupingSetKind, __pyx_k_GroupingSetKind, sizeof(__pyx_k_GroupingSetKind), 0, 1, 0, 1}, {&__pyx_n_s_ImportForeignSchemaStmt, __pyx_k_ImportForeignSchemaStmt, sizeof(__pyx_k_ImportForeignSchemaStmt), 0, 0, 1, 1}, {&__pyx_n_u_ImportForeignSchemaType, __pyx_k_ImportForeignSchemaType, sizeof(__pyx_k_ImportForeignSchemaType), 0, 1, 0, 1}, {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0}, {&__pyx_n_s_IndexElem, __pyx_k_IndexElem, sizeof(__pyx_k_IndexElem), 0, 0, 1, 1}, {&__pyx_n_s_IndexStmt, __pyx_k_IndexStmt, sizeof(__pyx_k_IndexStmt), 0, 0, 1, 1}, {&__pyx_n_s_InferClause, __pyx_k_InferClause, sizeof(__pyx_k_InferClause), 0, 0, 1, 1}, {&__pyx_n_s_InferenceElem, __pyx_k_InferenceElem, sizeof(__pyx_k_InferenceElem), 0, 0, 1, 1}, {&__pyx_n_s_InlineCodeBlock, __pyx_k_InlineCodeBlock, sizeof(__pyx_k_InlineCodeBlock), 0, 0, 1, 1}, {&__pyx_n_s_InsertStmt, __pyx_k_InsertStmt, sizeof(__pyx_k_InsertStmt), 0, 0, 1, 1}, {&__pyx_n_s_Integer, __pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 0, 1, 1}, {&__pyx_n_s_IntoClause, __pyx_k_IntoClause, sizeof(__pyx_k_IntoClause), 0, 0, 1, 1}, {&__pyx_n_s_JoinExpr, __pyx_k_JoinExpr, sizeof(__pyx_k_JoinExpr), 0, 0, 1, 1}, {&__pyx_n_u_JoinType, __pyx_k_JoinType, sizeof(__pyx_k_JoinType), 0, 1, 0, 1}, {&__pyx_n_s_JsonAggConstructor, __pyx_k_JsonAggConstructor, sizeof(__pyx_k_JsonAggConstructor), 0, 0, 1, 1}, {&__pyx_n_s_JsonArgument, __pyx_k_JsonArgument, sizeof(__pyx_k_JsonArgument), 0, 0, 1, 1}, {&__pyx_n_s_JsonArrayAgg, __pyx_k_JsonArrayAgg, sizeof(__pyx_k_JsonArrayAgg), 0, 0, 1, 1}, {&__pyx_n_s_JsonArrayConstructor, __pyx_k_JsonArrayConstructor, sizeof(__pyx_k_JsonArrayConstructor), 0, 0, 1, 1}, {&__pyx_n_s_JsonArrayQueryConstructor, __pyx_k_JsonArrayQueryConstructor, sizeof(__pyx_k_JsonArrayQueryConstructor), 0, 0, 1, 1}, {&__pyx_n_s_JsonBehavior, __pyx_k_JsonBehavior, sizeof(__pyx_k_JsonBehavior), 0, 0, 1, 1}, {&__pyx_n_u_JsonBehaviorType, __pyx_k_JsonBehaviorType, sizeof(__pyx_k_JsonBehaviorType), 0, 1, 0, 1}, {&__pyx_n_s_JsonConstructorExpr, __pyx_k_JsonConstructorExpr, sizeof(__pyx_k_JsonConstructorExpr), 0, 0, 1, 1}, {&__pyx_n_u_JsonConstructorType, __pyx_k_JsonConstructorType, sizeof(__pyx_k_JsonConstructorType), 0, 1, 0, 1}, {&__pyx_n_u_JsonEncoding, __pyx_k_JsonEncoding, sizeof(__pyx_k_JsonEncoding), 0, 1, 0, 1}, {&__pyx_n_s_JsonExpr, __pyx_k_JsonExpr, sizeof(__pyx_k_JsonExpr), 0, 0, 1, 1}, {&__pyx_n_u_JsonExprOp, __pyx_k_JsonExprOp, sizeof(__pyx_k_JsonExprOp), 0, 1, 0, 1}, {&__pyx_n_s_JsonFormat, __pyx_k_JsonFormat, sizeof(__pyx_k_JsonFormat), 0, 0, 1, 1}, {&__pyx_n_u_JsonFormatType, __pyx_k_JsonFormatType, sizeof(__pyx_k_JsonFormatType), 0, 1, 0, 1}, {&__pyx_n_s_JsonFuncExpr, __pyx_k_JsonFuncExpr, sizeof(__pyx_k_JsonFuncExpr), 0, 0, 1, 1}, {&__pyx_n_s_JsonIsPredicate, __pyx_k_JsonIsPredicate, sizeof(__pyx_k_JsonIsPredicate), 0, 0, 1, 1}, {&__pyx_n_s_JsonKeyValue, __pyx_k_JsonKeyValue, sizeof(__pyx_k_JsonKeyValue), 0, 0, 1, 1}, {&__pyx_n_s_JsonObjectAgg, __pyx_k_JsonObjectAgg, sizeof(__pyx_k_JsonObjectAgg), 0, 0, 1, 1}, {&__pyx_n_s_JsonObjectConstructor, __pyx_k_JsonObjectConstructor, sizeof(__pyx_k_JsonObjectConstructor), 0, 0, 1, 1}, {&__pyx_n_s_JsonOutput, __pyx_k_JsonOutput, sizeof(__pyx_k_JsonOutput), 0, 0, 1, 1}, {&__pyx_n_s_JsonParseExpr, __pyx_k_JsonParseExpr, sizeof(__pyx_k_JsonParseExpr), 0, 0, 1, 1}, {&__pyx_n_u_JsonQuotes, __pyx_k_JsonQuotes, sizeof(__pyx_k_JsonQuotes), 0, 1, 0, 1}, {&__pyx_n_s_JsonReturning, __pyx_k_JsonReturning, sizeof(__pyx_k_JsonReturning), 0, 0, 1, 1}, {&__pyx_n_s_JsonScalarExpr, __pyx_k_JsonScalarExpr, sizeof(__pyx_k_JsonScalarExpr), 0, 0, 1, 1}, {&__pyx_n_s_JsonSerializeExpr, __pyx_k_JsonSerializeExpr, sizeof(__pyx_k_JsonSerializeExpr), 0, 0, 1, 1}, {&__pyx_n_s_JsonTable, __pyx_k_JsonTable, sizeof(__pyx_k_JsonTable), 0, 0, 1, 1}, {&__pyx_n_s_JsonTableColumn, __pyx_k_JsonTableColumn, sizeof(__pyx_k_JsonTableColumn), 0, 0, 1, 1}, {&__pyx_n_u_JsonTableColumnType, __pyx_k_JsonTableColumnType, sizeof(__pyx_k_JsonTableColumnType), 0, 1, 0, 1}, {&__pyx_n_s_JsonTablePathSpec, __pyx_k_JsonTablePathSpec, sizeof(__pyx_k_JsonTablePathSpec), 0, 0, 1, 1}, {&__pyx_n_s_JsonValueExpr, __pyx_k_JsonValueExpr, sizeof(__pyx_k_JsonValueExpr), 0, 0, 1, 1}, {&__pyx_n_u_JsonValueType, __pyx_k_JsonValueType, sizeof(__pyx_k_JsonValueType), 0, 1, 0, 1}, {&__pyx_n_u_JsonWrapper, __pyx_k_JsonWrapper, sizeof(__pyx_k_JsonWrapper), 0, 1, 0, 1}, {&__pyx_n_s_LONG_MAX, __pyx_k_LONG_MAX, sizeof(__pyx_k_LONG_MAX), 0, 0, 1, 1}, {&__pyx_n_u_LimitOption, __pyx_k_LimitOption, sizeof(__pyx_k_LimitOption), 0, 1, 0, 1}, {&__pyx_n_s_ListenStmt, __pyx_k_ListenStmt, sizeof(__pyx_k_ListenStmt), 0, 0, 1, 1}, {&__pyx_n_s_LoadStmt, __pyx_k_LoadStmt, sizeof(__pyx_k_LoadStmt), 0, 0, 1, 1}, {&__pyx_n_u_LockClauseStrength, __pyx_k_LockClauseStrength, sizeof(__pyx_k_LockClauseStrength), 0, 1, 0, 1}, {&__pyx_n_s_LockStmt, __pyx_k_LockStmt, sizeof(__pyx_k_LockStmt), 0, 0, 1, 1}, {&__pyx_n_u_LockWaitPolicy, __pyx_k_LockWaitPolicy, sizeof(__pyx_k_LockWaitPolicy), 0, 1, 0, 1}, {&__pyx_n_s_LockingClause, __pyx_k_LockingClause, sizeof(__pyx_k_LockingClause), 0, 0, 1, 1}, {&__pyx_n_s_MergeAction, __pyx_k_MergeAction, sizeof(__pyx_k_MergeAction), 0, 0, 1, 1}, {&__pyx_n_u_MergeMatchKind, __pyx_k_MergeMatchKind, sizeof(__pyx_k_MergeMatchKind), 0, 1, 0, 1}, {&__pyx_n_s_MergeStmt, __pyx_k_MergeStmt, sizeof(__pyx_k_MergeStmt), 0, 0, 1, 1}, {&__pyx_n_s_MergeSupportFunc, __pyx_k_MergeSupportFunc, sizeof(__pyx_k_MergeSupportFunc), 0, 0, 1, 1}, {&__pyx_n_s_MergeWhenClause, __pyx_k_MergeWhenClause, sizeof(__pyx_k_MergeWhenClause), 0, 0, 1, 1}, {&__pyx_n_s_MinMaxExpr, __pyx_k_MinMaxExpr, sizeof(__pyx_k_MinMaxExpr), 0, 0, 1, 1}, {&__pyx_n_u_MinMaxOp, __pyx_k_MinMaxOp, sizeof(__pyx_k_MinMaxOp), 0, 1, 0, 1}, {&__pyx_n_s_MultiAssignRef, __pyx_k_MultiAssignRef, sizeof(__pyx_k_MultiAssignRef), 0, 0, 1, 1}, {&__pyx_n_s_NamedArgExpr, __pyx_k_NamedArgExpr, sizeof(__pyx_k_NamedArgExpr), 0, 0, 1, 1}, {&__pyx_n_s_NotifyStmt, __pyx_k_NotifyStmt, sizeof(__pyx_k_NotifyStmt), 0, 0, 1, 1}, {&__pyx_n_s_NullTest, __pyx_k_NullTest, sizeof(__pyx_k_NullTest), 0, 0, 1, 1}, {&__pyx_n_u_NullTestType, __pyx_k_NullTestType, sizeof(__pyx_k_NullTestType), 0, 1, 0, 1}, {&__pyx_n_u_ObjectType, __pyx_k_ObjectType, sizeof(__pyx_k_ObjectType), 0, 1, 0, 1}, {&__pyx_n_s_ObjectWithArgs, __pyx_k_ObjectWithArgs, sizeof(__pyx_k_ObjectWithArgs), 0, 0, 1, 1}, {&__pyx_n_u_OnCommitAction, __pyx_k_OnCommitAction, sizeof(__pyx_k_OnCommitAction), 0, 1, 0, 1}, {&__pyx_n_u_OnConflictAction, __pyx_k_OnConflictAction, sizeof(__pyx_k_OnConflictAction), 0, 1, 0, 1}, {&__pyx_n_s_OnConflictClause, __pyx_k_OnConflictClause, sizeof(__pyx_k_OnConflictClause), 0, 0, 1, 1}, {&__pyx_n_s_OnConflictExpr, __pyx_k_OnConflictExpr, sizeof(__pyx_k_OnConflictExpr), 0, 0, 1, 1}, {&__pyx_n_s_OpExpr, __pyx_k_OpExpr, sizeof(__pyx_k_OpExpr), 0, 0, 1, 1}, {&__pyx_n_u_OverridingKind, __pyx_k_OverridingKind, sizeof(__pyx_k_OverridingKind), 0, 1, 0, 1}, {&__pyx_n_s_PLAssignStmt, __pyx_k_PLAssignStmt, sizeof(__pyx_k_PLAssignStmt), 0, 0, 1, 1}, {&__pyx_n_s_Param, __pyx_k_Param, sizeof(__pyx_k_Param), 0, 0, 1, 1}, {&__pyx_n_u_ParamKind, __pyx_k_ParamKind, sizeof(__pyx_k_ParamKind), 0, 1, 0, 1}, {&__pyx_n_s_ParamRef, __pyx_k_ParamRef, sizeof(__pyx_k_ParamRef), 0, 0, 1, 1}, {&__pyx_n_s_ParseError, __pyx_k_ParseError, sizeof(__pyx_k_ParseError), 0, 0, 1, 1}, {&__pyx_n_s_ParseError___str, __pyx_k_ParseError___str, sizeof(__pyx_k_ParseError___str), 0, 0, 1, 1}, {&__pyx_n_s_PartitionBoundSpec, __pyx_k_PartitionBoundSpec, sizeof(__pyx_k_PartitionBoundSpec), 0, 0, 1, 1}, {&__pyx_n_s_PartitionCmd, __pyx_k_PartitionCmd, sizeof(__pyx_k_PartitionCmd), 0, 0, 1, 1}, {&__pyx_n_s_PartitionElem, __pyx_k_PartitionElem, sizeof(__pyx_k_PartitionElem), 0, 0, 1, 1}, {&__pyx_n_s_PartitionRangeDatum, __pyx_k_PartitionRangeDatum, sizeof(__pyx_k_PartitionRangeDatum), 0, 0, 1, 1}, {&__pyx_n_u_PartitionRangeDatumKind, __pyx_k_PartitionRangeDatumKind, sizeof(__pyx_k_PartitionRangeDatumKind), 0, 1, 0, 1}, {&__pyx_n_s_PartitionSpec, __pyx_k_PartitionSpec, sizeof(__pyx_k_PartitionSpec), 0, 0, 1, 1}, {&__pyx_n_u_PartitionStrategy, __pyx_k_PartitionStrategy, sizeof(__pyx_k_PartitionStrategy), 0, 1, 0, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_PrepareStmt, __pyx_k_PrepareStmt, sizeof(__pyx_k_PrepareStmt), 0, 0, 1, 1}, {&__pyx_n_s_PublicationObjSpec, __pyx_k_PublicationObjSpec, sizeof(__pyx_k_PublicationObjSpec), 0, 0, 1, 1}, {&__pyx_n_u_PublicationObjSpecType, __pyx_k_PublicationObjSpecType, sizeof(__pyx_k_PublicationObjSpecType), 0, 1, 0, 1}, {&__pyx_n_s_PublicationTable, __pyx_k_PublicationTable, sizeof(__pyx_k_PublicationTable), 0, 0, 1, 1}, {&__pyx_n_s_Query, __pyx_k_Query, sizeof(__pyx_k_Query), 0, 0, 1, 1}, {&__pyx_n_u_QuerySource, __pyx_k_QuerySource, sizeof(__pyx_k_QuerySource), 0, 1, 0, 1}, {&__pyx_n_u_RTEKind, __pyx_k_RTEKind, sizeof(__pyx_k_RTEKind), 0, 1, 0, 1}, {&__pyx_n_s_RTEPermissionInfo, __pyx_k_RTEPermissionInfo, sizeof(__pyx_k_RTEPermissionInfo), 0, 0, 1, 1}, {&__pyx_n_s_RangeFunction, __pyx_k_RangeFunction, sizeof(__pyx_k_RangeFunction), 0, 0, 1, 1}, {&__pyx_n_s_RangeSubselect, __pyx_k_RangeSubselect, sizeof(__pyx_k_RangeSubselect), 0, 0, 1, 1}, {&__pyx_n_s_RangeTableFunc, __pyx_k_RangeTableFunc, sizeof(__pyx_k_RangeTableFunc), 0, 0, 1, 1}, {&__pyx_n_s_RangeTableFuncCol, __pyx_k_RangeTableFuncCol, sizeof(__pyx_k_RangeTableFuncCol), 0, 0, 1, 1}, {&__pyx_n_s_RangeTableSample, __pyx_k_RangeTableSample, sizeof(__pyx_k_RangeTableSample), 0, 0, 1, 1}, {&__pyx_n_s_RangeTblEntry, __pyx_k_RangeTblEntry, sizeof(__pyx_k_RangeTblEntry), 0, 0, 1, 1}, {&__pyx_n_s_RangeTblFunction, __pyx_k_RangeTblFunction, sizeof(__pyx_k_RangeTblFunction), 0, 0, 1, 1}, {&__pyx_n_s_RangeTblRef, __pyx_k_RangeTblRef, sizeof(__pyx_k_RangeTblRef), 0, 0, 1, 1}, {&__pyx_n_s_RangeVar, __pyx_k_RangeVar, sizeof(__pyx_k_RangeVar), 0, 0, 1, 1}, {&__pyx_n_s_RawStmt, __pyx_k_RawStmt, sizeof(__pyx_k_RawStmt), 0, 0, 1, 1}, {&__pyx_n_s_ReassignOwnedStmt, __pyx_k_ReassignOwnedStmt, sizeof(__pyx_k_ReassignOwnedStmt), 0, 0, 1, 1}, {&__pyx_n_s_RefreshMatViewStmt, __pyx_k_RefreshMatViewStmt, sizeof(__pyx_k_RefreshMatViewStmt), 0, 0, 1, 1}, {&__pyx_n_u_ReindexObjectType, __pyx_k_ReindexObjectType, sizeof(__pyx_k_ReindexObjectType), 0, 1, 0, 1}, {&__pyx_n_s_ReindexStmt, __pyx_k_ReindexStmt, sizeof(__pyx_k_ReindexStmt), 0, 0, 1, 1}, {&__pyx_n_s_RelabelType, __pyx_k_RelabelType, sizeof(__pyx_k_RelabelType), 0, 0, 1, 1}, {&__pyx_n_s_RenameStmt, __pyx_k_RenameStmt, sizeof(__pyx_k_RenameStmt), 0, 0, 1, 1}, {&__pyx_n_s_ReplicaIdentityStmt, __pyx_k_ReplicaIdentityStmt, sizeof(__pyx_k_ReplicaIdentityStmt), 0, 0, 1, 1}, {&__pyx_n_s_ResTarget, __pyx_k_ResTarget, sizeof(__pyx_k_ResTarget), 0, 0, 1, 1}, {&__pyx_n_s_ReturnStmt, __pyx_k_ReturnStmt, sizeof(__pyx_k_ReturnStmt), 0, 0, 1, 1}, {&__pyx_n_s_RoleSpec, __pyx_k_RoleSpec, sizeof(__pyx_k_RoleSpec), 0, 0, 1, 1}, {&__pyx_n_u_RoleSpecType, __pyx_k_RoleSpecType, sizeof(__pyx_k_RoleSpecType), 0, 1, 0, 1}, {&__pyx_n_u_RoleStmtType, __pyx_k_RoleStmtType, sizeof(__pyx_k_RoleStmtType), 0, 1, 0, 1}, {&__pyx_n_s_RowCompareExpr, __pyx_k_RowCompareExpr, sizeof(__pyx_k_RowCompareExpr), 0, 0, 1, 1}, {&__pyx_n_u_RowCompareType, __pyx_k_RowCompareType, sizeof(__pyx_k_RowCompareType), 0, 1, 0, 1}, {&__pyx_n_s_RowExpr, __pyx_k_RowExpr, sizeof(__pyx_k_RowExpr), 0, 0, 1, 1}, {&__pyx_n_s_RowMarkClause, __pyx_k_RowMarkClause, sizeof(__pyx_k_RowMarkClause), 0, 0, 1, 1}, {&__pyx_n_s_RuleStmt, __pyx_k_RuleStmt, sizeof(__pyx_k_RuleStmt), 0, 0, 1, 1}, {&__pyx_n_s_SQLValueFunction, __pyx_k_SQLValueFunction, sizeof(__pyx_k_SQLValueFunction), 0, 0, 1, 1}, {&__pyx_n_u_SQLValueFunctionOp, __pyx_k_SQLValueFunctionOp, sizeof(__pyx_k_SQLValueFunctionOp), 0, 1, 0, 1}, {&__pyx_n_s_ScalarArrayOpExpr, __pyx_k_ScalarArrayOpExpr, sizeof(__pyx_k_ScalarArrayOpExpr), 0, 0, 1, 1}, {&__pyx_n_s_SecLabelStmt, __pyx_k_SecLabelStmt, sizeof(__pyx_k_SecLabelStmt), 0, 0, 1, 1}, {&__pyx_n_s_SelectStmt, __pyx_k_SelectStmt, sizeof(__pyx_k_SelectStmt), 0, 0, 1, 1}, {&__pyx_n_u_SetOperation, __pyx_k_SetOperation, sizeof(__pyx_k_SetOperation), 0, 1, 0, 1}, {&__pyx_n_s_SetOperationStmt, __pyx_k_SetOperationStmt, sizeof(__pyx_k_SetOperationStmt), 0, 0, 1, 1}, {&__pyx_n_s_SetToDefault, __pyx_k_SetToDefault, sizeof(__pyx_k_SetToDefault), 0, 0, 1, 1}, {&__pyx_n_s_SinglePartitionSpec, __pyx_k_SinglePartitionSpec, sizeof(__pyx_k_SinglePartitionSpec), 0, 0, 1, 1}, {&__pyx_n_s_SortBy, __pyx_k_SortBy, sizeof(__pyx_k_SortBy), 0, 0, 1, 1}, {&__pyx_n_u_SortByDir, __pyx_k_SortByDir, sizeof(__pyx_k_SortByDir), 0, 1, 0, 1}, {&__pyx_n_u_SortByNulls, __pyx_k_SortByNulls, sizeof(__pyx_k_SortByNulls), 0, 1, 0, 1}, {&__pyx_n_s_SortGroupClause, __pyx_k_SortGroupClause, sizeof(__pyx_k_SortGroupClause), 0, 0, 1, 1}, {&__pyx_n_s_StatsElem, __pyx_k_StatsElem, sizeof(__pyx_k_StatsElem), 0, 0, 1, 1}, {&__pyx_n_s_String, __pyx_k_String, sizeof(__pyx_k_String), 0, 0, 1, 1}, {&__pyx_n_s_SubLink, __pyx_k_SubLink, sizeof(__pyx_k_SubLink), 0, 0, 1, 1}, {&__pyx_n_u_SubLinkType, __pyx_k_SubLinkType, sizeof(__pyx_k_SubLinkType), 0, 1, 0, 1}, {&__pyx_n_s_SubPlan, __pyx_k_SubPlan, sizeof(__pyx_k_SubPlan), 0, 0, 1, 1}, {&__pyx_n_s_SubscriptingRef, __pyx_k_SubscriptingRef, sizeof(__pyx_k_SubscriptingRef), 0, 0, 1, 1}, {&__pyx_n_s_TableFunc, __pyx_k_TableFunc, sizeof(__pyx_k_TableFunc), 0, 0, 1, 1}, {&__pyx_n_u_TableFuncType, __pyx_k_TableFuncType, sizeof(__pyx_k_TableFuncType), 0, 1, 0, 1}, {&__pyx_n_s_TableLikeClause, __pyx_k_TableLikeClause, sizeof(__pyx_k_TableLikeClause), 0, 0, 1, 1}, {&__pyx_n_s_TableSampleClause, __pyx_k_TableSampleClause, sizeof(__pyx_k_TableSampleClause), 0, 0, 1, 1}, {&__pyx_n_s_TargetEntry, __pyx_k_TargetEntry, sizeof(__pyx_k_TargetEntry), 0, 0, 1, 1}, {&__pyx_n_s_Token, __pyx_k_Token, sizeof(__pyx_k_Token), 0, 0, 1, 1}, {&__pyx_n_u_Token, __pyx_k_Token, sizeof(__pyx_k_Token), 0, 1, 0, 1}, {&__pyx_n_s_TransactionStmt, __pyx_k_TransactionStmt, sizeof(__pyx_k_TransactionStmt), 0, 0, 1, 1}, {&__pyx_n_u_TransactionStmtKind, __pyx_k_TransactionStmtKind, sizeof(__pyx_k_TransactionStmtKind), 0, 1, 0, 1}, {&__pyx_n_s_TriggerTransition, __pyx_k_TriggerTransition, sizeof(__pyx_k_TriggerTransition), 0, 0, 1, 1}, {&__pyx_n_s_TruncateStmt, __pyx_k_TruncateStmt, sizeof(__pyx_k_TruncateStmt), 0, 0, 1, 1}, {&__pyx_n_s_TypeCast, __pyx_k_TypeCast, sizeof(__pyx_k_TypeCast), 0, 0, 1, 1}, {&__pyx_n_s_TypeName, __pyx_k_TypeName, sizeof(__pyx_k_TypeName), 0, 0, 1, 1}, {&__pyx_n_u_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 1, 0, 1}, {&__pyx_kp_u_Unhandled_tag_s, __pyx_k_Unhandled_tag_s, sizeof(__pyx_k_Unhandled_tag_s), 0, 1, 0, 0}, {&__pyx_n_s_UnlistenStmt, __pyx_k_UnlistenStmt, sizeof(__pyx_k_UnlistenStmt), 0, 0, 1, 1}, {&__pyx_n_s_UpdateStmt, __pyx_k_UpdateStmt, sizeof(__pyx_k_UpdateStmt), 0, 0, 1, 1}, {&__pyx_n_s_VacuumRelation, __pyx_k_VacuumRelation, sizeof(__pyx_k_VacuumRelation), 0, 0, 1, 1}, {&__pyx_n_s_VacuumStmt, __pyx_k_VacuumStmt, sizeof(__pyx_k_VacuumStmt), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_Var, __pyx_k_Var, sizeof(__pyx_k_Var), 0, 0, 1, 1}, {&__pyx_n_u_VariableSetKind, __pyx_k_VariableSetKind, sizeof(__pyx_k_VariableSetKind), 0, 1, 0, 1}, {&__pyx_n_s_VariableSetStmt, __pyx_k_VariableSetStmt, sizeof(__pyx_k_VariableSetStmt), 0, 0, 1, 1}, {&__pyx_n_s_VariableShowStmt, __pyx_k_VariableShowStmt, sizeof(__pyx_k_VariableShowStmt), 0, 0, 1, 1}, {&__pyx_n_u_ViewCheckOption, __pyx_k_ViewCheckOption, sizeof(__pyx_k_ViewCheckOption), 0, 1, 0, 1}, {&__pyx_n_s_ViewStmt, __pyx_k_ViewStmt, sizeof(__pyx_k_ViewStmt), 0, 0, 1, 1}, {&__pyx_n_u_WCOKind, __pyx_k_WCOKind, sizeof(__pyx_k_WCOKind), 0, 1, 0, 1}, {&__pyx_n_s_WindowClause, __pyx_k_WindowClause, sizeof(__pyx_k_WindowClause), 0, 0, 1, 1}, {&__pyx_n_s_WindowDef, __pyx_k_WindowDef, sizeof(__pyx_k_WindowDef), 0, 0, 1, 1}, {&__pyx_n_s_WindowFunc, __pyx_k_WindowFunc, sizeof(__pyx_k_WindowFunc), 0, 0, 1, 1}, {&__pyx_n_s_WindowFuncRunCondition, __pyx_k_WindowFuncRunCondition, sizeof(__pyx_k_WindowFuncRunCondition), 0, 0, 1, 1}, {&__pyx_n_s_WithCheckOption, __pyx_k_WithCheckOption, sizeof(__pyx_k_WithCheckOption), 0, 0, 1, 1}, {&__pyx_n_s_WithClause, __pyx_k_WithClause, sizeof(__pyx_k_WithClause), 0, 0, 1, 1}, {&__pyx_n_s_XmlExpr, __pyx_k_XmlExpr, sizeof(__pyx_k_XmlExpr), 0, 0, 1, 1}, {&__pyx_n_u_XmlExprOp, __pyx_k_XmlExprOp, sizeof(__pyx_k_XmlExprOp), 0, 1, 0, 1}, {&__pyx_n_u_XmlOptionType, __pyx_k_XmlOptionType, sizeof(__pyx_k_XmlOptionType), 0, 1, 0, 1}, {&__pyx_n_s_XmlSerialize, __pyx_k_XmlSerialize, sizeof(__pyx_k_XmlSerialize), 0, 0, 1, 1}, {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1}, {&__pyx_n_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_ast, __pyx_k_ast, sizeof(__pyx_k_ast), 0, 0, 1, 1}, {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, {&__pyx_kp_u_at_index, __pyx_k_at_index, sizeof(__pyx_k_at_index), 0, 1, 0, 0}, {&__pyx_kp_u_at_position, __pyx_k_at_position, sizeof(__pyx_k_at_position), 0, 1, 0, 0}, {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_cstring, __pyx_k_cstring, sizeof(__pyx_k_cstring), 0, 0, 1, 1}, {&__pyx_n_s_cur_offset, __pyx_k_cur_offset, sizeof(__pyx_k_cur_offset), 0, 0, 1, 1}, {&__pyx_n_s_cursorpos, __pyx_k_cursorpos, sizeof(__pyx_k_cursorpos), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_deparse_protobuf, __pyx_k_deparse_protobuf, sizeof(__pyx_k_deparse_protobuf), 0, 0, 1, 1}, {&__pyx_n_s_deparsed, __pyx_k_deparsed, sizeof(__pyx_k_deparsed), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_u_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 1, 0, 1}, {&__pyx_n_s_enums, __pyx_k_enums, sizeof(__pyx_k_enums), 0, 0, 1, 1}, {&__pyx_n_s_fingerprint, __pyx_k_fingerprint, sizeof(__pyx_k_fingerprint), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, {&__pyx_n_s_get_postgresql_version, __pyx_k_get_postgresql_version, sizeof(__pyx_k_get_postgresql_version), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, {&__pyx_n_u_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 1, 0, 1}, {&__pyx_n_s_kwkind, __pyx_k_kwkind, sizeof(__pyx_k_kwkind), 0, 0, 1, 1}, {&__pyx_n_s_location, __pyx_k_location, sizeof(__pyx_k_location), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1}, {&__pyx_n_s_mctx, __pyx_k_mctx, sizeof(__pyx_k_mctx), 0, 0, 1, 1}, {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1}, {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_offset_to_index, __pyx_k_offset_to_index, sizeof(__pyx_k_offset_to_index), 0, 0, 1, 1}, {&__pyx_n_s_only_slices, __pyx_k_only_slices, sizeof(__pyx_k_only_slices), 0, 0, 1, 1}, {&__pyx_n_s_parse_plpgsql_json, __pyx_k_parse_plpgsql_json, sizeof(__pyx_k_parse_plpgsql_json), 0, 0, 1, 1}, {&__pyx_n_s_parse_sql, __pyx_k_parse_sql, sizeof(__pyx_k_parse_sql), 0, 0, 1, 1}, {&__pyx_n_s_parse_sql_json, __pyx_k_parse_sql_json, sizeof(__pyx_k_parse_sql_json), 0, 0, 1, 1}, {&__pyx_n_s_parse_sql_protobuf, __pyx_k_parse_sql_protobuf, sizeof(__pyx_k_parse_sql_protobuf), 0, 0, 1, 1}, {&__pyx_n_s_parsed, __pyx_k_parsed, sizeof(__pyx_k_parsed), 0, 0, 1, 1}, {&__pyx_n_s_pglast, __pyx_k_pglast, sizeof(__pyx_k_pglast), 0, 0, 1, 1}, {&__pyx_n_s_pglast_parser, __pyx_k_pglast_parser, sizeof(__pyx_k_pglast_parser), 0, 0, 1, 1}, {&__pyx_kp_s_pglast_parser_pyx, __pyx_k_pglast_parser_pyx, sizeof(__pyx_k_pglast_parser_pyx), 0, 0, 1, 0}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_prev_offset, __pyx_k_prev_offset, sizeof(__pyx_k_prev_offset), 0, 0, 1, 1}, {&__pyx_n_s_protobuf, __pyx_k_protobuf, sizeof(__pyx_k_protobuf), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Displacements, __pyx_k_pyx_unpickle_Displacements, sizeof(__pyx_k_pyx_unpickle_Displacements), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_scan, __pyx_k_scan, sizeof(__pyx_k_scan), 0, 0, 1, 1}, {&__pyx_n_s_scan_result, __pyx_k_scan_result, sizeof(__pyx_k_scan_result), 0, 0, 1, 1}, {&__pyx_n_s_scan_token, __pyx_k_scan_token, sizeof(__pyx_k_scan_token), 0, 0, 1, 1}, {&__pyx_n_s_scanned, __pyx_k_scanned, sizeof(__pyx_k_scanned), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_splitted, __pyx_k_splitted, sizeof(__pyx_k_splitted), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_u_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 1, 0, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stmt, __pyx_k_stmt, sizeof(__pyx_k_stmt), 0, 0, 1, 1}, {&__pyx_n_s_stmts, __pyx_k_stmts, sizeof(__pyx_k_stmts), 0, 0, 1, 1}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_tkind, __pyx_k_tkind, sizeof(__pyx_k_tkind), 0, 0, 1, 1}, {&__pyx_n_s_token, __pyx_k_token, sizeof(__pyx_k_token), 0, 0, 1, 1}, {&__pyx_n_s_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1}, {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_with_parser, __pyx_k_with_parser, sizeof(__pyx_k_with_parser), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; return __Pyx_InitStrings(__pyx_string_tab); } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 36, __pyx_L1_error) __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 274, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 2844, __pyx_L1_error) __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(1, 225, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: cached_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum not in (0x236a782, 0x2e307f9, 0x7645d40): # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x236a782, 0x2e307f9, 0x7645d40) = (displacements, max_offset))" % __pyx_checksum */ __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_37136258, __pyx_int_48433145, __pyx_int_124017984); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "pglast/parser.pyx":28 * "Exception representing the error state returned by the PG parser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_location); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_str, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 28, __pyx_L1_error) /* "pglast/parser.pyx":40 * "Exception representing the error state returned by the PG deparser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_str, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 40, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(2, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Displacements__set_state(self, __pyx_state) */ __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(2, 16, __pyx_L1_error) /* "pglast/parser.pyx":241 * * * def get_postgresql_version(): # <<<<<<<<<<<<<< * "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)." * */ __pyx_tuple__11 = PyTuple_Pack(3, __pyx_n_s_version, __pyx_n_s_major, __pyx_n_s_minor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_get_postgresql_version, 241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 241, __pyx_L1_error) /* "pglast/parser.pyx":249 * * * def parse_sql(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its abstract syntax tree." * */ __pyx_tuple__13 = PyTuple_Pack(10, __pyx_n_s_query, __pyx_n_s_parsed, __pyx_n_s_mctx, __pyx_n_s_i, __pyx_n_s_cstring, __pyx_n_s_utf8, __pyx_n_s_offset_to_index, __pyx_n_s_stmts, __pyx_n_s_item, __pyx_n_s_message); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_parse_sql, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 249, __pyx_L1_error) /* "pglast/parser.pyx":283 * * * def parse_sql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``JSON`` encoded syntax tree." * */ __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_query, __pyx_n_s_parsed, __pyx_n_s_cstring, __pyx_n_s_utf8, __pyx_n_s_message, __pyx_n_s_offset_to_index); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_parse_sql_json, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 283, __pyx_L1_error) /* "pglast/parser.pyx":307 * * * def parse_sql_protobuf(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``protobuf`` encoded syntax tree." * */ __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_query, __pyx_n_s_parsed, __pyx_n_s_cstring, __pyx_n_s_utf8, __pyx_n_s_message, __pyx_n_s_cursorpos, __pyx_n_s_offset_to_index); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_parse_sql_protobuf, 307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 307, __pyx_L1_error) /* "pglast/parser.pyx":332 * * * def parse_plpgsql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``pgpgsql`` `query` and return its ``JSON`` encoded syntax tree." * */ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_parse_plpgsql_json, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 332, __pyx_L1_error) /* "pglast/parser.pyx":356 * * * def fingerprint(str query): # <<<<<<<<<<<<<< * "Compute and return a *signature* of the given ``SQL`` `query`." * */ __pyx_tuple__20 = PyTuple_Pack(6, __pyx_n_s_query, __pyx_n_s_result, __pyx_n_s_cstring, __pyx_n_s_utf8, __pyx_n_s_message, __pyx_n_s_offset_to_index); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_fingerprint, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 356, __pyx_L1_error) /* "pglast/parser.pyx":380 * * * def split(str stmts, bint with_parser=True, bint only_slices=False): # <<<<<<<<<<<<<< * """Split the given `stmts` string into a sequence of the single ``SQL`` statements. * */ __pyx_tuple__22 = PyTuple_Pack(15, __pyx_n_s_stmts, __pyx_n_s_with_parser, __pyx_n_s_only_slices, __pyx_n_s_splitted, __pyx_n_s_cstring, __pyx_n_s_i, __pyx_n_s_prev_offset, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_utf8, __pyx_n_s_message, __pyx_n_s_offset_to_index, __pyx_n_s_result, __pyx_n_s_stmt, __pyx_n_s_cur_offset); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_split, 380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 380, __pyx_L1_error) /* "pglast/parser.pyx":433 * * * def deparse_protobuf(bytes protobuf): # <<<<<<<<<<<<<< * "Convert the ``protobuf`` serialized parse tree into an equivalent ``SQL`` statement." * */ __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_protobuf, __pyx_n_s_tree, __pyx_n_s_deparsed, __pyx_n_s_message); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_deparse_protobuf, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 433, __pyx_L1_error) /* "pglast/parser.pyx":454 * * * Token = namedtuple('Token', ('start', 'end', 'name', 'kind')) # <<<<<<<<<<<<<< * * */ __pyx_tuple__26 = PyTuple_Pack(4, __pyx_n_u_start, __pyx_n_u_end, __pyx_n_u_name_2, __pyx_n_u_kind); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_u_Token, __pyx_tuple__26); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "pglast/parser.pyx":457 * * * def scan(str query): # <<<<<<<<<<<<<< * "Lexify the given ``SQL`` `query` and return a list of its lexical tokens." * */ __pyx_tuple__28 = PyTuple_Pack(13, __pyx_n_s_query, __pyx_n_s_scanned, __pyx_n_s_scan_result, __pyx_n_s_scan_token, __pyx_n_s_tkind, __pyx_n_s_kwkind, __pyx_n_s_cstring, __pyx_n_s_i, __pyx_n_s_utf8, __pyx_n_s_offset_to_index, __pyx_n_s_message, __pyx_n_s_result, __pyx_n_s_token); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pglast_parser_pyx, __pyx_n_s_scan, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 457, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_Displacements(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Displacements, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } /* #### Code section: init_constants ### */ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_umethod_PyUnicode_Type_index.type = (PyObject*)&PyUnicode_Type; __pyx_umethod_PyUnicode_Type_index.method_name = &__pyx_n_s_index; if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_37136258 = PyInt_FromLong(37136258L); if (unlikely(!__pyx_int_37136258)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_48433145 = PyInt_FromLong(48433145L); if (unlikely(!__pyx_int_48433145)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_int_124017984 = PyInt_FromLong(124017984L); if (unlikely(!__pyx_int_124017984)) __PYX_ERR(1, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } /* #### Code section: init_globals ### */ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { return 0; } /* #### Code section: init_module ### */ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS __pyx_ptype_6pglast_6parser_Displacements = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6pglast_6parser_Displacements_spec, NULL); if (unlikely(!__pyx_ptype_6pglast_6parser_Displacements)) __PYX_ERR(1, 177, __pyx_L1_error) if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6pglast_6parser_Displacements_spec, __pyx_ptype_6pglast_6parser_Displacements) < 0) __PYX_ERR(1, 177, __pyx_L1_error) #else __pyx_ptype_6pglast_6parser_Displacements = &__pyx_type_6pglast_6parser_Displacements; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS if (__Pyx_PyType_Ready(__pyx_ptype_6pglast_6parser_Displacements) < 0) __PYX_ERR(1, 177, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_6pglast_6parser_Displacements->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6pglast_6parser_Displacements->tp_dictoffset && __pyx_ptype_6pglast_6parser_Displacements->tp_getattro == PyObject_GenericGetAttr)) { __pyx_ptype_6pglast_6parser_Displacements->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Displacements, (PyObject *) __pyx_ptype_6pglast_6parser_Displacements) < 0) __PYX_ERR(1, 177, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_6pglast_6parser_Displacements) < 0) __PYX_ERR(1, 177, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), #else sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_parser(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_parser}, {0, NULL} }; #endif #ifdef __cplusplus namespace { struct PyModuleDef __pyx_moduledef = #else static struct PyModuleDef __pyx_moduledef = #endif { PyModuleDef_HEAD_INIT, "parser", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE sizeof(__pyx_mstate), /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif #if CYTHON_USE_MODULE_STATE __pyx_m_traverse, /* m_traverse */ __pyx_m_clear, /* m_clear */ NULL /* m_free */ #else NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ #endif }; #ifdef __cplusplus } /* anonymous namespace */ #endif #endif #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initparser(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initparser(void) #else __Pyx_PyMODINIT_FUNC PyInit_parser(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_parser(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) #else static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { #if CYTHON_COMPILING_IN_LIMITED_API result = PyModule_AddObject(module, to_name, value); #else result = PyDict_SetItemString(moddict, to_name, value); #endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; #if CYTHON_COMPILING_IN_LIMITED_API moddict = module; #else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; #endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_module) #endif #endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'parser' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("parser", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "parser" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif #endif CYTHON_UNUSED_VAR(__pyx_t_1); __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_parser(void)", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS PyEval_InitThreads(); #endif /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pglast__parser) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pglast.parser")) { if (unlikely((PyDict_SetItemString(modules, "pglast.parser", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "pglast/parser.pyx":12 * * from . cimport structs * from . import Error # <<<<<<<<<<<<<< * * from cpython.bytes cimport PyBytes_AsStringAndSize, PyBytes_FromStringAndSize */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Error); __Pyx_GIVEREF(__pyx_n_s_Error); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Error)) __PYX_ERR(1, 12, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s__3, __pyx_t_2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_2) < 0) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":19 * from libc cimport limits * * from collections import namedtuple # <<<<<<<<<<<<<< * * */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_namedtuple); __Pyx_GIVEREF(__pyx_n_s_namedtuple); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_namedtuple)) __PYX_ERR(1, 19, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_3) < 0) __PYX_ERR(1, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/ast.pyx":13 * from cpython.tuple cimport PyTuple_New, PyTuple_SET_ITEM * * from pglast import ast, enums # <<<<<<<<<<<<<< * from pglast cimport structs * */ __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_ast); __Pyx_GIVEREF(__pyx_n_s_ast); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ast)) __PYX_ERR(0, 13, __pyx_L1_error); __Pyx_INCREF(__pyx_n_s_enums); __Pyx_GIVEREF(__pyx_n_s_enums); if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_enums)) __PYX_ERR(0, 13, __pyx_L1_error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pglast, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ast, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_enums, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":25 * * * class ParseError(Error): # <<<<<<<<<<<<<< * "Exception representing the error state returned by the PG parser." * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_ParseError, __pyx_n_s_ParseError, (PyObject *) NULL, __pyx_n_s_pglast_parser, __pyx_kp_s_Exception_representing_the_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(1, 25, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/parser.pyx":28 * "Exception representing the error state returned by the PG parser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_10ParseError_1__str__, 0, __pyx_n_s_ParseError___str, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_str, __pyx_t_2) < 0) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/parser.pyx":25 * * * class ParseError(Error): # <<<<<<<<<<<<<< * "Exception representing the error state returned by the PG parser." * */ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_ParseError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParseError, __pyx_t_2) < 0) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":37 * * * class DeparseError(Error): # <<<<<<<<<<<<<< * "Exception representing the error state returned by the PG deparser." * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_DeparseError, __pyx_n_s_DeparseError, (PyObject *) NULL, __pyx_n_s_pglast_parser, __pyx_kp_s_Exception_representing_the_error_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(1, 37, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pglast/parser.pyx":40 * "Exception representing the error state returned by the PG deparser." * * def __str__(self): # <<<<<<<<<<<<<< * message = self.args[0] * if len(self.args) > 1: */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_12DeparseError_1__str__, 0, __pyx_n_s_DeparseError___str, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(1, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pglast/parser.pyx":37 * * * class DeparseError(Error): # <<<<<<<<<<<<<< * "Exception representing the error state returned by the PG deparser." * */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_DeparseError, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeparseError, __pyx_t_4) < 0) __PYX_ERR(1, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":174 * * * LONG_MAX = limits.LONG_MAX # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyInt_From_long(LONG_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LONG_MAX, __pyx_t_3) < 0) __PYX_ERR(1, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_13Displacements_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Displacements___reduce_cython, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6pglast_6parser_Displacements, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_6pglast_6parser_Displacements); /* "(tree fragment)":16 * else: * return __pyx_unpickle_Displacements, (type(self), 0x236a782, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Displacements__set_state(self, __pyx_state) */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_13Displacements_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Displacements___setstate_cython, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6pglast_6parser_Displacements, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(2, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_6pglast_6parser_Displacements); /* "pglast/parser.pyx":241 * * * def get_postgresql_version(): # <<<<<<<<<<<<<< * "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)." * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_1get_postgresql_version, 0, __pyx_n_s_get_postgresql_version, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_postgresql_version, __pyx_t_3) < 0) __PYX_ERR(1, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":249 * * * def parse_sql(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its abstract syntax tree." * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_3parse_sql, 0, __pyx_n_s_parse_sql, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_sql, __pyx_t_3) < 0) __PYX_ERR(1, 249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":283 * * * def parse_sql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``JSON`` encoded syntax tree." * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_5parse_sql_json, 0, __pyx_n_s_parse_sql_json, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_sql_json, __pyx_t_3) < 0) __PYX_ERR(1, 283, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":307 * * * def parse_sql_protobuf(str query): # <<<<<<<<<<<<<< * "Parse the given ``SQL`` `query` and return its ``protobuf`` encoded syntax tree." * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_7parse_sql_protobuf, 0, __pyx_n_s_parse_sql_protobuf, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_sql_protobuf, __pyx_t_3) < 0) __PYX_ERR(1, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":332 * * * def parse_plpgsql_json(str query): # <<<<<<<<<<<<<< * "Parse the given ``pgpgsql`` `query` and return its ``JSON`` encoded syntax tree." * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_9parse_plpgsql_json, 0, __pyx_n_s_parse_plpgsql_json, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_plpgsql_json, __pyx_t_3) < 0) __PYX_ERR(1, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":356 * * * def fingerprint(str query): # <<<<<<<<<<<<<< * "Compute and return a *signature* of the given ``SQL`` `query`." * */ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_11fingerprint, 0, __pyx_n_s_fingerprint, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_fingerprint, __pyx_t_3) < 0) __PYX_ERR(1, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pglast/parser.pyx":380 * * * def split(str stmts, bint with_parser=True, bint only_slices=False): # <<<<<<<<<<<<<< * """Split the given `stmts` string into a sequence of the single ``SQL`` statements. * */ __pyx_t_3 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(1, 380, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_13split, 0, __pyx_n_s_split, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_split, __pyx_t_5) < 0) __PYX_ERR(1, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pglast/parser.pyx":433 * * * def deparse_protobuf(bytes protobuf): # <<<<<<<<<<<<<< * "Convert the ``protobuf`` serialized parse tree into an equivalent ``SQL`` statement." * */ __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_15deparse_protobuf, 0, __pyx_n_s_deparse_protobuf, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_d, __pyx_n_s_deparse_protobuf, __pyx_t_5) < 0) __PYX_ERR(1, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "pglast/parser.pyx":454 * * * Token = namedtuple('Token', ('start', 'end', 'name', 'kind')) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_Token, __pyx_t_2) < 0) __PYX_ERR(1, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/parser.pyx":457 * * * def scan(str query): # <<<<<<<<<<<<<< * "Lexify the given ``SQL`` `query` and return a list of its lexical tokens." * */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_17scan, 0, __pyx_n_s_scan, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_scan, __pyx_t_2) < 0) __PYX_ERR(1, 457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_Displacements(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6pglast_6parser_19__pyx_unpickle_Displacements, 0, __pyx_n_s_pyx_unpickle_Displacements, NULL, __pyx_n_s_pglast_parser, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Displacements, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pglast/parser.pyx":1 * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< * # :Project: pglast Cython interface with libpg_query * # :Created: mer 02 ago 2017 15:12:49 CEST */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init pglast.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); #else Py_DECREF(__pyx_m); if (pystate_addmodule_run) { PyObject *tp, *value, *tb; PyErr_Fetch(&tp, &value, &tb); PyState_RemoveModule(&__pyx_moduledef); PyErr_Restore(tp, value, tb); } #endif } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pglast.parser"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ /* #### Code section: utility_code_pragmas ### */ #ifdef _MSC_VER #pragma warning( push ) /* Warning 4127: conditional expression is constant * Cython uses constant conditional expressions to allow in inline functions to be optimized at * compile-time, so this warning is not useful */ #pragma warning( disable : 4127 ) #endif /* #### Code section: utility_code_def ### */ /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030C00A6 PyObject *current_exception = tstate->current_exception; if (unlikely(!current_exception)) return 0; exc_type = (PyObject*) Py_TYPE(current_exception); if (exc_type == err) return 1; #else exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; #endif #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(exc_type); #endif if (unlikely(PyTuple_Check(err))) { result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); } else { result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(exc_type); #endif return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject *tmp_value; assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); if (value) { #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) #endif PyException_SetTraceback(value, tb); } tmp_value = tstate->current_exception; tstate->current_exception = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyObject* exc_value; exc_value = tstate->current_exception; tstate->current_exception = 0; *value = exc_value; *type = NULL; *tb = NULL; if (exc_value) { *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); #if CYTHON_COMPILING_IN_CPYTHON *tb = ((PyBaseExceptionObject*) exc_value)->traceback; Py_XINCREF(*tb); #else *tb = PyException_GetTraceback(exc_value); #endif } #else *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; #endif } /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #elif CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } result = PyObject_GetAttr(__pyx_m, name); if (likely(result)) { return result; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { return NULL; } #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } #endif if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); #if PY_MAJOR_VERSION < 3 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; argstuple = PyTuple_New((Py_ssize_t)nargs); if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: Py_DECREF(argstuple); return result; } #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) return __Pyx_PyObject_CallMethO(func, NULL); } else if (nargs == 1 && kwargs == NULL) { if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) return __Pyx_PyObject_CallMethO(func, args[0]); } #endif #if PY_VERSION_HEX < 0x030800B1 #if CYTHON_FAST_PYCCALL if (PyCFunction_Check(func)) { if (kwargs) { return _PyCFunction_FastCallDict(func, args, nargs, kwargs); } else { return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); } #endif #endif if (kwargs == NULL) { #if CYTHON_VECTORCALL #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else vectorcallfunc f = PyVectorcall_Function(func); #endif if (f) { return f(func, args, (size_t)nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } #endif } if (nargs == 0) { return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); #else return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); #endif } /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyObjectCallOneArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *args[2] = {NULL, arg}; return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { __Pyx_PyThreadState_declare CYTHON_UNUSED_VAR(cause); Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); #elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #else PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* TupleAndListFromArray */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { Py_INCREF(__pyx_empty_tuple); return __pyx_empty_tuple; } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); return res; } static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { return PyList_New(0); } res = PyList_New(n); if (unlikely(res == NULL)) return NULL; __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); return res; } #endif /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* fastcall */ #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); for (i = 0; i < n; i++) { if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; } for (i = 0; i < n; i++) { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject *const *kwvalues, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); while (1) { Py_XDECREF(key); key = NULL; Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); if (size < 0) goto bad; #endif if (pos >= size) break; #if CYTHON_AVOID_BORROWED_REFS key = __Pyx_PySequence_ITEM(kwds, pos); if (!key) goto bad; #elif CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kwds, pos); #else key = PyTuple_GetItem(kwds, pos); if (!key) goto bad; #endif value = kwvalues[pos]; pos++; } else { if (!PyDict_Next(kwds, &pos, &key, &value)) break; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif } name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS Py_INCREF(value); Py_DECREF(key); #endif key = NULL; value = NULL; continue; } #if !CYTHON_AVOID_BORROWED_REFS Py_INCREF(key); #endif Py_INCREF(value); name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS value = NULL; #endif break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } Py_XDECREF(key); Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: Py_XDECREF(key); Py_XDECREF(value); return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { PyObject *r, *key = PyInt_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); return r; } if (likely(sm && sm->sq_item)) { if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { Py_ssize_t l = sm->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return sm->sq_item(o, i); } } #else if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* unicode_iter */ static CYTHON_INLINE int __Pyx_init_unicode_iteration( PyObject* ustring, Py_ssize_t *length, void** data, int *kind) { #if CYTHON_COMPILING_IN_LIMITED_API *kind = 0; *length = PyUnicode_GetLength(ustring); *data = (void*)ustring; #elif CYTHON_PEP393_ENABLED if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1; *kind = PyUnicode_KIND(ustring); *length = PyUnicode_GET_LENGTH(ustring); *data = PyUnicode_DATA(ustring); #else *kind = 0; *length = PyUnicode_GET_SIZE(ustring); *data = (void*)PyUnicode_AS_UNICODE(ustring); #endif return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; __Pyx_PyErr_Clear(); return 0; } return 0; } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } return __Pyx_IterFinish(); } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kw, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0)) goto invalid_keyword; return 1; #else if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) { Py_ssize_t kwsize; #if CYTHON_ASSUME_SAFE_MACROS kwsize = PyTuple_GET_SIZE(kw); #else kwsize = PyTuple_Size(kw); if (kwsize < 0) return 0; #endif if (unlikely(kwsize == 0)) return 1; if (!kw_allowed) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, 0); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif goto invalid_keyword; } #if PY_VERSION_HEX < 0x03090000 for (pos = 0; pos < kwsize; pos++) { #if CYTHON_ASSUME_SAFE_MACROS key = PyTuple_GET_ITEM(kw, pos); #else key = PyTuple_GetItem(kw, pos); if (!key) return 0; #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } #endif return 1; } while (PyDict_Next(kw, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if (!kw_allowed && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: #if PY_MAJOR_VERSION < 3 PyErr_Format(PyExc_TypeError, "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* GetAttr3 */ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } #endif static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r; #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 int res = PyObject_GetOptionalAttr(o, n, &r); return (res != 0) ? r : __Pyx_NewRef(d); #else #if CYTHON_USE_TYPE_SLOTS if (likely(PyString_Check(n))) { r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (unlikely(!r) && likely(!PyErr_Occurred())) { r = __Pyx_NewRef(d); } return r; } #endif r = PyObject_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); #endif } /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type = NULL, *local_value, *local_tb = NULL; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030C00A6 local_value = tstate->current_exception; tstate->current_exception = 0; if (likely(local_value)) { local_type = (PyObject*) Py_TYPE(local_value); Py_INCREF(local_type); local_tb = PyException_GetTraceback(local_value); } #else local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #endif #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 if (unlikely(tstate->current_exception)) #elif CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; #if PY_VERSION_HEX >= 0x030B00a4 tmp_value = exc_info->exc_value; exc_info->exc_value = local_value; tmp_type = NULL; tmp_tb = NULL; Py_XDECREF(local_type); Py_XDECREF(local_tb); #else tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; #endif } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; tmp_value = exc_info->exc_value; exc_info->exc_value = *value; if (tmp_value == NULL || tmp_value == Py_None) { Py_XDECREF(tmp_value); tmp_value = NULL; tmp_type = NULL; tmp_tb = NULL; } else { tmp_type = (PyObject*) Py_TYPE(tmp_value); Py_INCREF(tmp_type); #if CYTHON_COMPILING_IN_CPYTHON tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; Py_XINCREF(tmp_tb); #else tmp_tb = PyException_GetTraceback(tmp_value); #endif } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); PyObject *exc_value = exc_info->exc_value; if (exc_value == NULL || exc_value == Py_None) { *value = NULL; *type = NULL; *tb = NULL; } else { *value = exc_value; Py_INCREF(*value); *type = (PyObject*) Py_TYPE(exc_value); Py_INCREF(*type); *tb = PyException_GetTraceback(exc_value); } #elif CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); #endif } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = tstate->exc_info; PyObject *tmp_value = exc_info->exc_value; exc_info->exc_value = value; Py_XDECREF(tmp_value); Py_XDECREF(type); Py_XDECREF(tb); #else PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #endif } #endif /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #else CYTHON_UNUSED_VAR(wraparound); #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #else CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); bad: return NULL; } /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } static PyMethodDef __Pyx_UnboundCMethod_Def = { "CythonUnboundCMethod", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), METH_VARARGS | METH_KEYWORDS, NULL }; static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #else if (likely(!__Pyx_CyOrPyCFunction_Check(method))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } else #endif #if CYTHON_COMPILING_IN_PYPY #else if (PyCFunction_Check(method)) #endif { PyObject *self; int self_found; #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY self = PyObject_GetAttrString(method, "__self__"); if (!self) { PyErr_Clear(); } #else self = PyCFunction_GET_SELF(method); #endif self_found = (self && self != Py_None); #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY Py_XDECREF(self); #endif if (self_found) { PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); if (unlikely(!unbound_method)) return -1; Py_DECREF(method); target->method = unbound_method; } } return 0; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + (unsigned long)b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif if (unlikely(__Pyx_PyLong_IsZero(op1))) { return __Pyx_NewRef(op2); } if (likely(__Pyx_PyLong_IsCompact(op1))) { a = __Pyx_PyLong_CompactValue(op1); } else { const digit* digits = __Pyx_PyLong_Digits(op1); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; #if CYTHON_COMPILING_IN_LIMITED_API double a = __pyx_PyFloat_AsDouble(op1); #else double a = PyFloat_AS_DOUBLE(op1); #endif double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (unlikely(!py_import)) goto bad; if (!from_list) { empty_list = PyList_New(0); if (unlikely(!empty_list)) goto bad; from_list = empty_list; } #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, 1); if (unlikely(!module)) { if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (unlikely(!py_level)) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, __pyx_d, empty_dict, from_list, level); #endif } } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { const char* module_name_str = 0; PyObject* module_name = 0; PyObject* module_dot = 0; PyObject* full_name = 0; PyErr_Clear(); module_name_str = PyModule_GetName(module); if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) goto modbad; value = PyObject_GetItem(modules, full_name); } #else value = PyImport_GetModule(full_name); #endif modbad: Py_XDECREF(full_name); Py_XDECREF(module_dot); Py_XDECREF(module_name); } if (unlikely(!value)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (!r) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); CYTHON_UNUSED_VAR(type); #else const PyType_Slot *slot = spec->slots; while (slot && slot->slot && slot->slot != Py_tp_members) slot++; if (slot && slot->slot == Py_tp_members) { int changed = 0; #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) const #endif PyMemberDef *memb = (PyMemberDef*) slot->pfunc; while (memb && memb->name) { if (memb->name[0] == '_' && memb->name[1] == '_') { #if PY_VERSION_HEX < 0x030900b1 if (strcmp(memb->name, "__weaklistoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_weaklistoffset = memb->offset; changed = 1; } else if (strcmp(memb->name, "__dictoffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); type->tp_dictoffset = memb->offset; changed = 1; } #if CYTHON_METH_FASTCALL else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { assert(memb->type == T_PYSSIZET); assert(memb->flags == READONLY); #if PY_VERSION_HEX >= 0x030800b4 type->tp_vectorcall_offset = memb->offset; #else type->tp_print = (printfunc) memb->offset; #endif changed = 1; } #endif #else if ((0)); #endif #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON else if (strcmp(memb->name, "__module__") == 0) { PyObject *descr; assert(memb->type == T_OBJECT); assert(memb->flags == 0 || memb->flags == READONLY); descr = PyDescr_NewMember(type, memb); if (unlikely(!descr)) return -1; if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { Py_DECREF(descr); return -1; } Py_DECREF(descr); changed = 1; } #endif } memb++; } if (changed) PyType_Modified(type); } #endif return 0; } #endif /* PyObjectCallNoArg */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { PyObject *arg[2] = {NULL, NULL}; return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP __Pyx_TypeName type_name; PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) #elif PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (likely(descr != NULL)) { *method = descr; return 0; } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(name)); #endif __Pyx_DECREF_TypeName(type_name); return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* ValidateBasesTuple */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; #if CYTHON_ASSUME_SAFE_MACROS n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); if (n < 0) return -1; #endif for (i = 1; i < n; i++) { #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; #elif CYTHON_ASSUME_SAFE_MACROS PyObject *b0 = PyTuple_GET_ITEM(bases, i); #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; #endif PyTypeObject *b; #if PY_MAJOR_VERSION < 3 if (PyClass_Check(b0)) { PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); __Pyx_DECREF_TypeName(b_name); #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); if (!py_b_dictoffset) goto dictoffset_return; b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); Py_DECREF(py_b_dictoffset); if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; #endif if (b_dictoffset) { { __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); PyErr_Format(PyExc_TypeError, "extension type '%.200s' has no __dict__ slot, " "but base type '" __Pyx_FMT_TYPENAME "' has: " "either add 'cdef dict __dict__' to the extension type " "or add '__slots__ = [...]' to the base type", type_name, b_name); __Pyx_DECREF_TypeName(b_name); } #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif return -1; } } #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif } return 0; } #endif /* PyType_Ready */ static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS (void)__Pyx_validate_bases_tuple; #endif return PyType_Ready(t); #else int r; PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 gc_was_enabled = PyGC_Disable(); (void)__Pyx_PyObject_CallMethod0; #else PyObject *ret, *py_status; PyObject *gc = NULL; #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) gc = PyImport_GetModule(__pyx_kp_u_gc); #endif if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); if (unlikely(!gc)) return -1; py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; } gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; } Py_DECREF(ret); } else if (unlikely(gc_was_enabled == -1)) { Py_DECREF(gc); return -1; } #endif t->tp_flags |= Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A0000 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; #endif #else (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) PyGC_Enable(); #else if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); } else { Py_XDECREF(tp); Py_XDECREF(v); Py_XDECREF(tb); r = -1; } } Py_DECREF(gc); #endif } #endif return r; #endif } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, attr_name); #else "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", type_name, PyString_AS_STRING(attr_name)); #endif __Pyx_DECREF_TypeName(type_name); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_getstate = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; PyObject *getstate = NULL; #if CYTHON_USE_PYTYPE_LOOKUP getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); #else getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); if (!getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (getstate) { #if CYTHON_USE_PYTYPE_LOOKUP object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); #else object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); if (!object_getstate && PyErr_Occurred()) { goto __PYX_BAD; } #endif if (object_getstate != getstate) { goto __PYX_GOOD; } } #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) { __Pyx_TypeName type_obj_name = __Pyx_PyType_GetName((PyTypeObject*)type_obj); PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); __Pyx_DECREF_TypeName(type_obj_name); } ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); Py_XDECREF(object_getstate); Py_XDECREF(getstate); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType_3_0_12 #define __PYX_HAVE_RT_ImportType_3_0_12 static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #if !CYTHON_COMPILING_IN_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; py_itemsize = PyObject_GetAttrString(result, "__itemsize__"); if (!py_itemsize) goto bad; itemsize = PyLong_AsSsize_t(py_itemsize); Py_DECREF(py_itemsize); py_itemsize = 0; if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if (itemsize) { if (size % alignment) { alignment = size % alignment; } if (itemsize < (Py_ssize_t)alignment) itemsize = (Py_ssize_t)alignment; } if ((size_t)(basicsize + itemsize) < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize+itemsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd-%zd from PyObject", module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Py3UpdateBases */ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; PyObject *base, *meth, *new_base, *result, *new_bases = NULL; size_bases = PyTuple_GET_SIZE(bases); for (i = 0; i < size_bases; i++) { base = PyTuple_GET_ITEM(bases, i); if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } if (!meth) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { goto error; } } continue; } new_base = __Pyx_PyObject_CallOneArg(meth, bases); Py_DECREF(meth); if (!new_base) { goto error; } if (!PyTuple_Check(new_base)) { PyErr_SetString(PyExc_TypeError, "__mro_entries__ must return a tuple"); Py_DECREF(new_base); goto error; } if (!new_bases) { if (!(new_bases = PyList_New(i))) { goto error; } for (j = 0; j < i; j++) { base = PyTuple_GET_ITEM(bases, j); PyList_SET_ITEM(new_bases, j, base); Py_INCREF(base); } } j = PyList_GET_SIZE(new_bases); if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } Py_DECREF(new_base); } if (!new_bases) { Py_INCREF(bases); return bases; } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); return result; error: Py_XDECREF(new_bases); return NULL; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; #if CYTHON_ASSUME_SAFE_MACROS nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); if (nbases < 0) return NULL; #endif for (i=0; i < nbases; i++) { PyTypeObject *tmptype; #if CYTHON_ASSUME_SAFE_MACROS PyObject *tmp = PyTuple_GET_ITEM(bases, i); #else PyObject *tmp = PyTuple_GetItem(bases, i); if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); } /* FetchCommonType */ static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { if (!PyType_Check(cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", name); return -1; } if (basicsize != expected_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", name); return -1; } return 0; } #if !CYTHON_USE_TYPE_SPECS static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* abi_module; const char* object_name; PyTypeObject *cached_type = NULL; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; object_name = strrchr(type->tp_name, '.'); object_name = object_name ? object_name+1 : type->tp_name; cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); if (cached_type) { if (__Pyx_VerifyCachedType( (PyObject *)cached_type, object_name, cached_type->tp_basicsize, type->tp_basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) goto bad; Py_INCREF(type); cached_type = type; done: Py_DECREF(abi_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #else static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { PyObject *abi_module, *cached_type = NULL; const char* object_name = strrchr(spec->name, '.'); object_name = object_name ? object_name+1 : spec->name; abi_module = __Pyx_FetchSharedCythonABIModule(); if (!abi_module) return NULL; cached_type = PyObject_GetAttrString(abi_module, object_name); if (cached_type) { Py_ssize_t basicsize; #if CYTHON_COMPILING_IN_LIMITED_API PyObject *py_basicsize; py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); if (unlikely(!py_basicsize)) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; #else basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; #endif if (__Pyx_VerifyCachedType( cached_type, object_name, basicsize, spec->basicsize) < 0) { goto bad; } goto done; } if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); CYTHON_UNUSED_VAR(module); cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); if (unlikely(!cached_type)) goto bad; if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; done: Py_DECREF(abi_module); assert(cached_type == NULL || PyType_Check(cached_type)); return (PyTypeObject *) cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } #endif /* PyVectorcallFastCallDict */ #if CYTHON_METH_FASTCALL static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; PyObject *kwnames; PyObject **newargs; PyObject **kwvalues; Py_ssize_t i, pos; size_t j; PyObject *key, *value; unsigned long keys_are_strings; Py_ssize_t nkw = PyDict_GET_SIZE(kw); newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); return NULL; } for (j = 0; j < nargs; j++) newargs[j] = args[j]; kwnames = PyTuple_New(nkw); if (unlikely(kwnames == NULL)) { PyMem_Free(newargs); return NULL; } kwvalues = newargs + nargs; pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { keys_are_strings &= Py_TYPE(key)->tp_flags; Py_INCREF(key); Py_INCREF(value); PyTuple_SET_ITEM(kwnames, i, key); kwvalues[i] = value; i++; } if (unlikely(!keys_are_strings)) { PyErr_SetString(PyExc_TypeError, "keywords must be strings"); goto cleanup; } res = vc(func, newargs, nargs, kwnames); cleanup: Py_DECREF(kwnames); for (i = 0; i < nkw; i++) Py_DECREF(kwvalues[i]); PyMem_Free(newargs); return res; } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { return vc(func, args, nargs, NULL); } return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; } return 0; } #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API __Pyx_Py_XDECREF_SET( __Pyx_CyFunction_GetClassObj(f), ((classobj) ? __Pyx_NewRef(classobj) : NULL)); #else __Pyx_Py_XDECREF_SET( ((PyCMethodObject *) (f))->mm_class, (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); #endif } static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) { CYTHON_UNUSED_VAR(closure); if (unlikely(op->func_doc == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #else op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } #endif } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (value == NULL) { value = Py_None; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_doc, value); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); #elif PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_name, value); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_qualname, value); return 0; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->func_dict, value); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(op); CYTHON_UNUSED_VAR(context); Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; CYTHON_UNUSED_VAR(context); Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_tuple; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value) { value = Py_None; } else if (unlikely(value != Py_None && !PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " "currently affect the values used in function calls", 1); Py_INCREF(value); __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->defaults_kwdict; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { if (op->defaults_getter) { if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); if (!value || value == Py_None) { value = NULL; } else if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); __Pyx_Py_XDECREF_SET(op->func_annotations, value); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { PyObject* result = op->func_annotations; CYTHON_UNUSED_VAR(context); if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyObject * __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { int is_coroutine; CYTHON_UNUSED_VAR(context); if (op->func_is_coroutine) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; #if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); #if CYTHON_ASSUME_SAFE_MACROS PyList_SET_ITEM(fromlist, 0, marker); #else if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { Py_DECREF(marker); Py_DECREF(fromlist); return NULL; } #endif module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); Py_DECREF(module); if (likely(op->func_is_coroutine)) { return __Pyx_NewRef(op->func_is_coroutine); } ignore: PyErr_Clear(); } #endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_GetAttrString(op->func, "__module__"); } static int __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { CYTHON_UNUSED_VAR(context); return PyObject_SetAttrString(op->func, "__module__", value); } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL #if CYTHON_BACKPORT_VECTORCALL {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else #if !CYTHON_COMPILING_IN_LIMITED_API {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif #endif #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); #if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; #else return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { #if !CYTHON_COMPILING_IN_LIMITED_API PyCFunctionObject *cf = (PyCFunctionObject*) op; #endif if (unlikely(op == NULL)) return NULL; #if CYTHON_COMPILING_IN_LIMITED_API op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); if (unlikely(!op->func)) return NULL; #endif op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; #if !CYTHON_COMPILING_IN_LIMITED_API cf->m_ml = ml; cf->m_self = (PyObject *) op; #endif Py_XINCREF(closure); op->func_closure = closure; #if !CYTHON_COMPILING_IN_LIMITED_API Py_XINCREF(module); cf->m_module = module; #endif op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API op->func_classobj = NULL; #else ((PyCMethodObject*)op)->mm_class = NULL; #endif op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; op->func_is_coroutine = NULL; #if CYTHON_METH_FASTCALL switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { case METH_NOARGS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; break; case METH_O: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; break; case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; break; case METH_FASTCALL | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; break; case METH_VARARGS | METH_KEYWORDS: __Pyx_CyFunction_func_vectorcall(op) = NULL; break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); Py_DECREF(op); return NULL; } #endif return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_CLEAR(m->func); #else Py_CLEAR(((PyCFunctionObject*)m)->m_module); #endif Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x030900B1 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); #else { PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; ((PyCMethodObject *) (m))->mm_class = NULL; Py_XDECREF(cls); } #endif #endif Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); __Pyx_PyHeapTypeObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); #else Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); if (unlikely(!meth)) return NULL; flags = PyCFunction_GetFlags(f); if (unlikely(flags < 0)) return NULL; #else PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; int flags = f->m_ml->ml_flags; #endif Py_ssize_t size; switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 0)) return (*meth)(self, NULL); #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { #if CYTHON_ASSUME_SAFE_MACROS size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); if (unlikely(size < 0)) return NULL; #endif if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", py_name, size); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); #endif return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } #if CYTHON_COMPILING_IN_LIMITED_API py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); if (!py_name) return NULL; PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", py_name); Py_DECREF(py_name); #else PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); #endif return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *self, *result; #if CYTHON_COMPILING_IN_LIMITED_API self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); if (unlikely(!self) && PyErr_Occurred()) return NULL; #else self = ((PyCFunctionObject*)func)->m_self; #endif result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); return result; } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; #if CYTHON_METH_FASTCALL __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { #if CYTHON_ASSUME_SAFE_MACROS return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; return PyVectorcall_Call(func, args, kw); #endif } #endif if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; #if CYTHON_ASSUME_SAFE_MACROS argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); if (unlikely(!argc) < 0) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); #if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); #else PyErr_SetString(PyExc_TypeError, "unbound method needs an argument"); #endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } #if CYTHON_METH_FASTCALL static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } ret = 1; } if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); return -1; } return ret; } static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 0)) { PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } if (unlikely(nargs != 1)) { PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", def->ml_name, nargs); return NULL; } return def->ml_meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; args += 1; nargs -= 1; break; case 0: self = ((PyCFunctionObject*)cyfunc)->m_self; break; default: return NULL; } return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS static PyType_Slot __pyx_CyFunctionType_slots[] = { {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, {Py_tp_methods, (void *)__pyx_CyFunction_methods}, {Py_tp_members, (void *)__pyx_CyFunction_members}, {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, {0, 0}, }; static PyType_Spec __pyx_CyFunctionType_spec = { __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; #else static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, #if !CYTHON_METH_FASTCALL 0, #elif CYTHON_BACKPORT_VECTORCALL (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), #else offsetof(PyCFunctionObject, vectorcall), #endif 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL _Py_TPFLAGS_HAVE_VECTORCALL | #endif Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_PyMethod_New, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif #if __PYX_NEED_TP_PRINT_SLOT 0, #endif #if PY_VERSION_HEX >= 0x030C0000 0, #endif #if PY_VERSION_HEX >= 0x030d00A4 0, #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 0, #endif }; #endif static int __pyx_CyFunction_init(PyObject *module) { #if CYTHON_USE_TYPE_SPECS __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else CYTHON_UNUSED_VAR(module); __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCall2Args */ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args[3] = {NULL, arg1, arg2}; return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #endif /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_DECREF(prep); } else { if (unlikely(PyErr_Occurred())) return NULL; ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; #if PY_VERSION_HEX >= 0x03030000 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; #else CYTHON_MAYBE_UNUSED_VAR(qualname); #endif if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS static int __Pyx_SetNamesPEP487(PyObject *type_obj) { PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *names_to_set, *key, *value, *set_name, *tmp; Py_ssize_t i = 0; #if CYTHON_USE_TYPE_SLOTS names_to_set = PyDict_Copy(type->tp_dict); #else { PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); names_to_set = NULL; if (likely(d)) { PyObject *names_to_set = PyDict_New(); int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; Py_DECREF(d); if (unlikely(ret < 0)) Py_CLEAR(names_to_set); } } #endif if (unlikely(names_to_set == NULL)) goto bad; while (PyDict_Next(names_to_set, &i, &key, &value)) { set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); if (unlikely(set_name != NULL)) { tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); Py_DECREF(set_name); if (unlikely(tmp == NULL)) { __Pyx_TypeName value_type_name = __Pyx_PyType_GetName(Py_TYPE(value)); __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); PyErr_Format(PyExc_RuntimeError, #if PY_MAJOR_VERSION >= 3 "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", value_type_name, key, type_name); #else "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", value_type_name, PyString_Check(key) ? PyString_AS_STRING(key) : "?", type_name); #endif goto bad; } else { Py_DECREF(tmp); } } else if (unlikely(PyErr_Occurred())) { goto bad; } } Py_DECREF(names_to_set); return 0; bad: Py_XDECREF(names_to_set); return -1; } static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyTypeObject *type = (PyTypeObject*) type_obj; PyObject *mro = type->tp_mro; Py_ssize_t i, nbases; if (unlikely(!mro)) goto done; (void) &__Pyx_GetBuiltinName; Py_INCREF(mro); nbases = PyTuple_GET_SIZE(mro); assert(PyTuple_GET_ITEM(mro, 0) == type_obj); for (i = 1; i < nbases-1; i++) { PyObject *base, *dict, *meth; base = PyTuple_GET_ITEM(mro, i); dict = ((PyTypeObject *)base)->tp_dict; meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); if (unlikely(meth)) { descrgetfunc f = Py_TYPE(meth)->tp_descr_get; PyObject *res; Py_INCREF(meth); if (likely(f)) { res = f(meth, NULL, type_obj); Py_DECREF(meth); if (unlikely(!res)) goto bad; meth = res; } res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); Py_DECREF(meth); if (unlikely(!res)) goto bad; Py_DECREF(res); goto done; } else if (unlikely(PyErr_Occurred())) { goto bad; } } done: Py_XDECREF(mro); return type_obj; bad: Py_XDECREF(mro); Py_DECREF(type_obj); return NULL; #else PyObject *super_type, *super, *func, *res; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); #else super_type = (PyObject*) &PySuper_Type; (void) &__Pyx_GetBuiltinName; #endif super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) Py_XDECREF(super_type); #endif if (unlikely(!super)) { Py_CLEAR(type_obj); goto done; } func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); Py_DECREF(super); if (likely(!func)) { if (unlikely(PyErr_Occurred())) Py_CLEAR(type_obj); goto done; } res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); Py_DECREF(func); if (unlikely(!res)) Py_CLEAR(type_obj); Py_XDECREF(res); done: return type_obj; #endif } #endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result; PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, #if PY_VERSION_HEX < 0x030600A4 (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw #else mkw #endif ); Py_XDECREF(owned_metaclass); #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS if (likely(result) && likely(PyType_Check(result))) { if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { Py_CLEAR(result); } else { result = __Pyx_InitSubclassPEP487(result, mkw); } } #else (void) &__Pyx_GetBuiltinName; #endif return result; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } #endif /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif #if CYTHON_COMPILING_IN_LIMITED_API static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, PyObject *firstlineno, PyObject *name) { PyObject *replace = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { PyObject *result; result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); #if __PYX_LIMITED_VERSION_HEX < 0x030780000 { PyObject *compiled = NULL, *result = NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; compiled = Py_CompileString( "out = type(code)(\n" " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" " code.co_lnotab)\n", "", Py_file_input); if (!compiled) return NULL; result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); Py_DECREF(compiled); if (!result) PyErr_Print(); Py_DECREF(result); result = PyDict_GetItemString(scratch_dict, "out"); if (result) Py_INCREF(result); return result; } #else return NULL; #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; PyObject *replace = NULL, *getframe = NULL, *frame = NULL; PyObject *exc_type, *exc_value, *exc_traceback; int success = 0; if (c_line) { (void) __pyx_cfilenm; (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); code_object = Py_CompileString("_getframe()", filename, Py_eval_input); if (unlikely(!code_object)) goto bad; py_py_line = PyLong_FromLong(py_line); if (unlikely(!py_py_line)) goto bad; py_funcname = PyUnicode_FromString(funcname); if (unlikely(!py_funcname)) goto bad; dict = PyDict_New(); if (unlikely(!dict)) goto bad; { PyObject *old_code_object = code_object; code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); Py_DECREF(old_code_object); } if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; frame = PyEval_EvalCode(code_object, dict, dict); if (unlikely(!frame) || frame == Py_None) goto bad; success = 1; bad: PyErr_Restore(exc_type, exc_value, exc_traceback); Py_XDECREF(code_object); Py_XDECREF(py_py_line); Py_XDECREF(py_funcname); Py_XDECREF(dict); Py_XDECREF(replace); if (success) { PyTraceBack_Here( (struct _frame*)frame); } Py_XDECREF(frame); } #else static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; #if PY_MAJOR_VERSION < 3 PyObject *py_srcfile = NULL; py_srcfile = PyString_FromString(filename); if (!py_srcfile) goto bad; #endif if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; #endif } #if PY_MAJOR_VERSION < 3 py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_srcfile); #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject *ptype, *pvalue, *ptraceback; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) { /* If the code object creation fails, then we should clear the fetched exception references and propagate the new exception */ Py_XDECREF(ptype); Py_XDECREF(pvalue); Py_XDECREF(ptraceback); goto bad; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #endif /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } static PyObject* __pyx_convert__to_py_Node(Node s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(1); if (unlikely(!res)) return NULL; member = __Pyx_PyInt_From_int(s.type); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_type, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(unsigned long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(unsigned long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned long) val; } } #endif if (unlikely(!PyLong_Check(x))) { unsigned long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned long) -1; val = __Pyx_PyInt_As_unsigned_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT)) { return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 3: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT)) { return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 4: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT)) { return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(unsigned long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 2: if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -3: if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 3: if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -4: if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 4: if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; } } #endif if ((sizeof(unsigned long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(unsigned long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { unsigned long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (unsigned long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (unsigned long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (unsigned long) -1; } else { stepval = v; } v = NULL; val = (unsigned long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(unsigned long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((unsigned long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(unsigned long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((unsigned long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((unsigned long) 1) << (sizeof(unsigned long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (unsigned long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned long"); return (unsigned long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(long) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } #endif if (unlikely(!PyLong_Check(x))) { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(long) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } } #endif if ((sizeof(long) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { long val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (long) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (long) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (long) -1; } else { stepval = v; } v = NULL; val = (long) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((long) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((long) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (long) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(int) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } #endif if (unlikely(!PyLong_Check(x))) { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(int) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } } #endif if ((sizeof(int) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { int val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (int) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (int) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (int) -1; } else { stepval = v; } v = NULL; val = (int) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((int) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((int) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (int) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CmdType(CmdType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const CmdType neg_one = (CmdType) -1, const_zero = (CmdType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(CmdType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(CmdType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CmdType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(CmdType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CmdType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(CmdType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(CmdType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_QuerySource(QuerySource value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const QuerySource neg_one = (QuerySource) -1, const_zero = (QuerySource) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(QuerySource) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(QuerySource) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(QuerySource) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(QuerySource) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(QuerySource) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(QuerySource), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(QuerySource)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_bool(bool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const bool neg_one = (bool) -1, const_zero = (bool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(bool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(bool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(bool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(bool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(bool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(bool), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(bool)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_OverridingKind(OverridingKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const OverridingKind neg_one = (OverridingKind) -1, const_zero = (OverridingKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(OverridingKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(OverridingKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(OverridingKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(OverridingKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(OverridingKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(OverridingKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(OverridingKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_LimitOption(LimitOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const LimitOption neg_one = (LimitOption) -1, const_zero = (LimitOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(LimitOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(LimitOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(LimitOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(LimitOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(LimitOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(LimitOption), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(LimitOption)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ParseLoc(ParseLoc value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ParseLoc neg_one = (ParseLoc) -1, const_zero = (ParseLoc) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ParseLoc) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ParseLoc) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ParseLoc) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ParseLoc) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ParseLoc) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ParseLoc), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ParseLoc)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_A_Expr_Kind(A_Expr_Kind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const A_Expr_Kind neg_one = (A_Expr_Kind) -1, const_zero = (A_Expr_Kind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(A_Expr_Kind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(A_Expr_Kind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(A_Expr_Kind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(A_Expr_Kind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(A_Expr_Kind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(A_Expr_Kind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(A_Expr_Kind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RoleSpecType(RoleSpecType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const RoleSpecType neg_one = (RoleSpecType) -1, const_zero = (RoleSpecType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(RoleSpecType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(RoleSpecType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RoleSpecType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(RoleSpecType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RoleSpecType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(RoleSpecType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(RoleSpecType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CoercionForm(CoercionForm value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const CoercionForm neg_one = (CoercionForm) -1, const_zero = (CoercionForm) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(CoercionForm) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(CoercionForm) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CoercionForm) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(CoercionForm) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CoercionForm) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(CoercionForm), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(CoercionForm)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SortByDir(SortByDir value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SortByDir neg_one = (SortByDir) -1, const_zero = (SortByDir) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SortByDir) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SortByDir) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SortByDir) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SortByDir) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SortByDir) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SortByDir), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SortByDir)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SortByNulls(SortByNulls value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SortByNulls neg_one = (SortByNulls) -1, const_zero = (SortByNulls) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SortByNulls) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SortByNulls) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SortByNulls) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SortByNulls) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SortByNulls) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SortByNulls), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SortByNulls)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const char neg_one = (char) -1, const_zero = (char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(char) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(char) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(char) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(char), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DefElemAction(DefElemAction value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DefElemAction neg_one = (DefElemAction) -1, const_zero = (DefElemAction) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DefElemAction) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DefElemAction) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DefElemAction) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DefElemAction) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DefElemAction) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(DefElemAction), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DefElemAction)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_LockClauseStrength(LockClauseStrength value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const LockClauseStrength neg_one = (LockClauseStrength) -1, const_zero = (LockClauseStrength) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(LockClauseStrength) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(LockClauseStrength) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(LockClauseStrength) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(LockClauseStrength) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(LockClauseStrength) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(LockClauseStrength), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(LockClauseStrength)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_LockWaitPolicy(LockWaitPolicy value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const LockWaitPolicy neg_one = (LockWaitPolicy) -1, const_zero = (LockWaitPolicy) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(LockWaitPolicy) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(LockWaitPolicy) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(LockWaitPolicy) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(LockWaitPolicy) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(LockWaitPolicy) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(LockWaitPolicy), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(LockWaitPolicy)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_XmlOptionType(XmlOptionType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const XmlOptionType neg_one = (XmlOptionType) -1, const_zero = (XmlOptionType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(XmlOptionType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(XmlOptionType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(XmlOptionType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(XmlOptionType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(XmlOptionType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(XmlOptionType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(XmlOptionType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PartitionStrategy(PartitionStrategy value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PartitionStrategy neg_one = (PartitionStrategy) -1, const_zero = (PartitionStrategy) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PartitionStrategy) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PartitionStrategy) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PartitionStrategy) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PartitionStrategy) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PartitionStrategy) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(PartitionStrategy), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PartitionStrategy)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PartitionRangeDatumKind(PartitionRangeDatumKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PartitionRangeDatumKind neg_one = (PartitionRangeDatumKind) -1, const_zero = (PartitionRangeDatumKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PartitionRangeDatumKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PartitionRangeDatumKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PartitionRangeDatumKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PartitionRangeDatumKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PartitionRangeDatumKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(PartitionRangeDatumKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PartitionRangeDatumKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RTEKind(RTEKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const RTEKind neg_one = (RTEKind) -1, const_zero = (RTEKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(RTEKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(RTEKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RTEKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(RTEKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RTEKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(RTEKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(RTEKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(unsigned int), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JoinType(JoinType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JoinType neg_one = (JoinType) -1, const_zero = (JoinType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JoinType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JoinType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JoinType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JoinType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JoinType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JoinType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JoinType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(uint64_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_WCOKind(WCOKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const WCOKind neg_one = (WCOKind) -1, const_zero = (WCOKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(WCOKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(WCOKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(WCOKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(WCOKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(WCOKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(WCOKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(WCOKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GroupingSetKind(GroupingSetKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const GroupingSetKind neg_one = (GroupingSetKind) -1, const_zero = (GroupingSetKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(GroupingSetKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(GroupingSetKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(GroupingSetKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(GroupingSetKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(GroupingSetKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(GroupingSetKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(GroupingSetKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_OnConflictAction(OnConflictAction value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const OnConflictAction neg_one = (OnConflictAction) -1, const_zero = (OnConflictAction) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(OnConflictAction) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(OnConflictAction) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(OnConflictAction) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(OnConflictAction) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(OnConflictAction) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(OnConflictAction), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(OnConflictAction)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CTEMaterialize(CTEMaterialize value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const CTEMaterialize neg_one = (CTEMaterialize) -1, const_zero = (CTEMaterialize) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(CTEMaterialize) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(CTEMaterialize) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CTEMaterialize) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(CTEMaterialize) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CTEMaterialize) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(CTEMaterialize), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(CTEMaterialize)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MergeMatchKind(MergeMatchKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MergeMatchKind neg_one = (MergeMatchKind) -1, const_zero = (MergeMatchKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MergeMatchKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MergeMatchKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MergeMatchKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MergeMatchKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MergeMatchKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(MergeMatchKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MergeMatchKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonExprOp(JsonExprOp value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonExprOp neg_one = (JsonExprOp) -1, const_zero = (JsonExprOp) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonExprOp) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonExprOp) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonExprOp) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonExprOp) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonExprOp) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonExprOp), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonExprOp)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonWrapper(JsonWrapper value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonWrapper neg_one = (JsonWrapper) -1, const_zero = (JsonWrapper) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonWrapper) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonWrapper) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonWrapper) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonWrapper) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonWrapper) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonWrapper), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonWrapper)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonQuotes(JsonQuotes value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonQuotes neg_one = (JsonQuotes) -1, const_zero = (JsonQuotes) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonQuotes) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonQuotes) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonQuotes) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonQuotes) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonQuotes) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonQuotes), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonQuotes)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonTableColumnType(JsonTableColumnType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonTableColumnType neg_one = (JsonTableColumnType) -1, const_zero = (JsonTableColumnType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonTableColumnType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonTableColumnType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonTableColumnType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonTableColumnType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonTableColumnType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonTableColumnType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonTableColumnType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SetOperation(SetOperation value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SetOperation neg_one = (SetOperation) -1, const_zero = (SetOperation) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SetOperation) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SetOperation) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SetOperation) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SetOperation) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SetOperation) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SetOperation), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SetOperation)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ObjectType(ObjectType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ObjectType neg_one = (ObjectType) -1, const_zero = (ObjectType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ObjectType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ObjectType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ObjectType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ObjectType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ObjectType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ObjectType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ObjectType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterTableType(AlterTableType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const AlterTableType neg_one = (AlterTableType) -1, const_zero = (AlterTableType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(AlterTableType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(AlterTableType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterTableType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(AlterTableType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterTableType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(AlterTableType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AlterTableType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(int16_t), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DropBehavior(DropBehavior value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DropBehavior neg_one = (DropBehavior) -1, const_zero = (DropBehavior) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DropBehavior) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DropBehavior) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DropBehavior) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DropBehavior) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DropBehavior) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(DropBehavior), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DropBehavior)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GrantTargetType(GrantTargetType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const GrantTargetType neg_one = (GrantTargetType) -1, const_zero = (GrantTargetType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(GrantTargetType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(GrantTargetType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(GrantTargetType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(GrantTargetType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(GrantTargetType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(GrantTargetType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(GrantTargetType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VariableSetKind(VariableSetKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const VariableSetKind neg_one = (VariableSetKind) -1, const_zero = (VariableSetKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(VariableSetKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(VariableSetKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(VariableSetKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(VariableSetKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(VariableSetKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(VariableSetKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(VariableSetKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_OnCommitAction(OnCommitAction value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const OnCommitAction neg_one = (OnCommitAction) -1, const_zero = (OnCommitAction) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(OnCommitAction) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(OnCommitAction) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(OnCommitAction) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(OnCommitAction) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(OnCommitAction) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(OnCommitAction), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(OnCommitAction)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ConstrType(ConstrType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ConstrType neg_one = (ConstrType) -1, const_zero = (ConstrType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ConstrType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ConstrType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ConstrType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ConstrType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ConstrType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ConstrType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ConstrType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ImportForeignSchemaType(ImportForeignSchemaType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ImportForeignSchemaType neg_one = (ImportForeignSchemaType) -1, const_zero = (ImportForeignSchemaType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ImportForeignSchemaType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ImportForeignSchemaType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ImportForeignSchemaType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ImportForeignSchemaType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ImportForeignSchemaType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ImportForeignSchemaType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ImportForeignSchemaType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RoleStmtType(RoleStmtType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const RoleStmtType neg_one = (RoleStmtType) -1, const_zero = (RoleStmtType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(RoleStmtType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(RoleStmtType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RoleStmtType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(RoleStmtType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RoleStmtType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(RoleStmtType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(RoleStmtType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_FetchDirection(FetchDirection value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const FetchDirection neg_one = (FetchDirection) -1, const_zero = (FetchDirection) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(FetchDirection) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(FetchDirection) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(FetchDirection) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(FetchDirection) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(FetchDirection) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(FetchDirection), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(FetchDirection)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_FunctionParameterMode(FunctionParameterMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const FunctionParameterMode neg_one = (FunctionParameterMode) -1, const_zero = (FunctionParameterMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(FunctionParameterMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(FunctionParameterMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(FunctionParameterMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(FunctionParameterMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(FunctionParameterMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(FunctionParameterMode), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(FunctionParameterMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TransactionStmtKind(TransactionStmtKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TransactionStmtKind neg_one = (TransactionStmtKind) -1, const_zero = (TransactionStmtKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TransactionStmtKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TransactionStmtKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TransactionStmtKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TransactionStmtKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TransactionStmtKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(TransactionStmtKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TransactionStmtKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ViewCheckOption(ViewCheckOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ViewCheckOption neg_one = (ViewCheckOption) -1, const_zero = (ViewCheckOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ViewCheckOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ViewCheckOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ViewCheckOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ViewCheckOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ViewCheckOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ViewCheckOption), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ViewCheckOption)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DiscardMode(DiscardMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DiscardMode neg_one = (DiscardMode) -1, const_zero = (DiscardMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DiscardMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DiscardMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DiscardMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DiscardMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DiscardMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(DiscardMode), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(DiscardMode)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ReindexObjectType(ReindexObjectType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ReindexObjectType neg_one = (ReindexObjectType) -1, const_zero = (ReindexObjectType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ReindexObjectType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ReindexObjectType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ReindexObjectType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ReindexObjectType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ReindexObjectType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ReindexObjectType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ReindexObjectType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CoercionContext(CoercionContext value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const CoercionContext neg_one = (CoercionContext) -1, const_zero = (CoercionContext) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(CoercionContext) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(CoercionContext) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CoercionContext) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(CoercionContext) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(CoercionContext) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(CoercionContext), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(CoercionContext)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterTSConfigType(AlterTSConfigType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const AlterTSConfigType neg_one = (AlterTSConfigType) -1, const_zero = (AlterTSConfigType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(AlterTSConfigType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(AlterTSConfigType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterTSConfigType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(AlterTSConfigType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterTSConfigType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(AlterTSConfigType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AlterTSConfigType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PublicationObjSpecType(PublicationObjSpecType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PublicationObjSpecType neg_one = (PublicationObjSpecType) -1, const_zero = (PublicationObjSpecType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PublicationObjSpecType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PublicationObjSpecType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PublicationObjSpecType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PublicationObjSpecType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PublicationObjSpecType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(PublicationObjSpecType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(PublicationObjSpecType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterPublicationAction(AlterPublicationAction value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const AlterPublicationAction neg_one = (AlterPublicationAction) -1, const_zero = (AlterPublicationAction) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(AlterPublicationAction) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(AlterPublicationAction) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterPublicationAction) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(AlterPublicationAction) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterPublicationAction) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(AlterPublicationAction), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AlterPublicationAction)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AlterSubscriptionType(AlterSubscriptionType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const AlterSubscriptionType neg_one = (AlterSubscriptionType) -1, const_zero = (AlterSubscriptionType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(AlterSubscriptionType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(AlterSubscriptionType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterSubscriptionType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(AlterSubscriptionType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AlterSubscriptionType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(AlterSubscriptionType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AlterSubscriptionType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TableFuncType(TableFuncType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TableFuncType neg_one = (TableFuncType) -1, const_zero = (TableFuncType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TableFuncType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TableFuncType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TableFuncType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TableFuncType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TableFuncType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(TableFuncType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(TableFuncType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ParamKind(ParamKind value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ParamKind neg_one = (ParamKind) -1, const_zero = (ParamKind) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ParamKind) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ParamKind) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ParamKind) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ParamKind) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ParamKind) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(ParamKind), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ParamKind)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_AggSplit(AggSplit value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const AggSplit neg_one = (AggSplit) -1, const_zero = (AggSplit) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(AggSplit) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(AggSplit) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AggSplit) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(AggSplit) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(AggSplit) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(AggSplit), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(AggSplit)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_BoolExprType(BoolExprType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const BoolExprType neg_one = (BoolExprType) -1, const_zero = (BoolExprType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(BoolExprType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(BoolExprType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(BoolExprType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(BoolExprType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(BoolExprType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(BoolExprType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(BoolExprType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SubLinkType(SubLinkType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SubLinkType neg_one = (SubLinkType) -1, const_zero = (SubLinkType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SubLinkType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SubLinkType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SubLinkType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SubLinkType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SubLinkType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SubLinkType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SubLinkType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_RowCompareType(RowCompareType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const RowCompareType neg_one = (RowCompareType) -1, const_zero = (RowCompareType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(RowCompareType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(RowCompareType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RowCompareType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(RowCompareType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(RowCompareType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(RowCompareType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(RowCompareType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MinMaxOp(MinMaxOp value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MinMaxOp neg_one = (MinMaxOp) -1, const_zero = (MinMaxOp) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MinMaxOp) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MinMaxOp) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MinMaxOp) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MinMaxOp) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MinMaxOp) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(MinMaxOp), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(MinMaxOp)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SQLValueFunctionOp(SQLValueFunctionOp value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SQLValueFunctionOp neg_one = (SQLValueFunctionOp) -1, const_zero = (SQLValueFunctionOp) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SQLValueFunctionOp) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SQLValueFunctionOp) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SQLValueFunctionOp) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SQLValueFunctionOp) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SQLValueFunctionOp) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(SQLValueFunctionOp), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(SQLValueFunctionOp)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_XmlExprOp(XmlExprOp value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const XmlExprOp neg_one = (XmlExprOp) -1, const_zero = (XmlExprOp) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(XmlExprOp) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(XmlExprOp) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(XmlExprOp) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(XmlExprOp) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(XmlExprOp) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(XmlExprOp), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(XmlExprOp)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonFormatType(JsonFormatType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonFormatType neg_one = (JsonFormatType) -1, const_zero = (JsonFormatType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonFormatType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonFormatType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonFormatType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonFormatType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonFormatType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonFormatType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonFormatType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonEncoding(JsonEncoding value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonEncoding neg_one = (JsonEncoding) -1, const_zero = (JsonEncoding) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonEncoding) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonEncoding) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonEncoding) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonEncoding) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonEncoding) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonEncoding), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonEncoding)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonConstructorType(JsonConstructorType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonConstructorType neg_one = (JsonConstructorType) -1, const_zero = (JsonConstructorType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonConstructorType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonConstructorType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonConstructorType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonConstructorType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonConstructorType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonConstructorType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonConstructorType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonValueType(JsonValueType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonValueType neg_one = (JsonValueType) -1, const_zero = (JsonValueType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonValueType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonValueType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonValueType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonValueType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonValueType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonValueType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonValueType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_JsonBehaviorType(JsonBehaviorType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const JsonBehaviorType neg_one = (JsonBehaviorType) -1, const_zero = (JsonBehaviorType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(JsonBehaviorType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(JsonBehaviorType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonBehaviorType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(JsonBehaviorType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(JsonBehaviorType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(JsonBehaviorType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(JsonBehaviorType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NullTestType(NullTestType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const NullTestType neg_one = (NullTestType) -1, const_zero = (NullTestType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(NullTestType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(NullTestType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NullTestType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(NullTestType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NullTestType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(NullTestType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(NullTestType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_BoolTestType(BoolTestType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const BoolTestType neg_one = (BoolTestType) -1, const_zero = (BoolTestType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(BoolTestType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(BoolTestType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(BoolTestType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(BoolTestType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(BoolTestType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { unsigned char *bytes = (unsigned char *)&value; #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4 if (is_unsigned) { return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1); } else { return PyLong_FromNativeBytes(bytes, sizeof(value), -1); } #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 int one = 1; int little = (int)*(unsigned char *)&one; return _PyLong_FromByteArray(bytes, sizeof(BoolTestType), little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; PyObject *from_bytes, *result = NULL; PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(BoolTestType)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; arg_tuple = PyTuple_Pack(2, py_bytes, order_str); if (!arg_tuple) goto limited_bad; if (!is_unsigned) { kwds = PyDict_New(); if (!kwds) goto limited_bad; if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; } result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); return result; #endif } } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if ((sizeof(size_t) < sizeof(long))) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } #endif if (unlikely(!PyLong_Check(x))) { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS if (unlikely(__Pyx_PyLong_IsNeg(x))) { goto raise_neg_overflow; } else if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_DigitCount(x)) { case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } } #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if ((sizeof(size_t) <= sizeof(unsigned long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS if (__Pyx_PyLong_IsCompact(x)) { __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) } else { const digit* digits = __Pyx_PyLong_Digits(x); assert(__Pyx_PyLong_DigitCount(x) > 1); switch (__Pyx_PyLong_SignedDigitCount(x)) { case -2: if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } } #endif if ((sizeof(size_t) <= sizeof(long))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { size_t val; int ret = -1; #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t bytes_copied = PyLong_AsNativeBytes( x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0)); if (unlikely(bytes_copied == -1)) { } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) { goto raise_overflow; } else { ret = 0; } #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; ret = _PyLong_AsByteArray((PyLongObject *)x, bytes, sizeof(val), is_little, !is_unsigned); #else PyObject *v; PyObject *stepval = NULL, *mask = NULL, *shift = NULL; int bits, remaining_bits, is_negative = 0; int chunk_size = (sizeof(long) < 8) ? 30 : 62; if (likely(PyLong_CheckExact(x))) { v = __Pyx_NewRef(x); } else { v = PyNumber_Long(x); if (unlikely(!v)) return (size_t) -1; assert(PyLong_CheckExact(v)); } { int result = PyObject_RichCompareBool(v, Py_False, Py_LT); if (unlikely(result < 0)) { Py_DECREF(v); return (size_t) -1; } is_negative = result == 1; } if (is_unsigned && unlikely(is_negative)) { Py_DECREF(v); goto raise_neg_overflow; } else if (is_negative) { stepval = PyNumber_Invert(v); Py_DECREF(v); if (unlikely(!stepval)) return (size_t) -1; } else { stepval = v; } v = NULL; val = (size_t) 0; mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { PyObject *tmp, *digit; long idigit; digit = PyNumber_And(stepval, mask); if (unlikely(!digit)) goto done; idigit = PyLong_AsLong(digit); Py_DECREF(digit); if (unlikely(idigit < 0)) goto done; val |= ((size_t) idigit) << bits; tmp = PyNumber_Rshift(stepval, shift); if (unlikely(!tmp)) goto done; Py_DECREF(stepval); stepval = tmp; } Py_DECREF(shift); shift = NULL; Py_DECREF(mask); mask = NULL; { long idigit = PyLong_AsLong(stepval); if (unlikely(idigit < 0)) goto done; remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); if (unlikely(idigit >= (1L << remaining_bits))) goto raise_overflow; val |= ((size_t) idigit) << bits; } if (!is_unsigned) { if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) goto raise_overflow; if (is_negative) val = ~val; } ret = 0; done: Py_XDECREF(shift); Py_XDECREF(mask); Py_XDECREF(stepval); #endif if (unlikely(ret)) return (size_t) -1; return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* FormatTypeName */ #if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); name = __Pyx_NewRef(__pyx_n_s__32); } return name; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (cls == a || cls == b) return 1; mro = cls->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { PyObject *base = PyTuple_GET_ITEM(mro, i); if (base == (PyObject *)a || base == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); } else { return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else const char* rt_version = Py_GetVersion(); unsigned long version = 0; unsigned long factor = 0x01000000UL; unsigned int digit = 0; int i = 0; while (factor) { while ('0' <= rt_version[i] && rt_version[i] <= '9') { digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); ++i; } version += factor * digit; if (rt_version[i] != '.') break; digit = 0; factor >>= 8; ++i; } return version; #endif } static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) return 0; if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) return 1; { char message[200]; PyOS_snprintf(message, sizeof(message), "compile time Python version %d.%d " "of module '%.100s' " "%s " "runtime version %d.%d", (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), __Pyx_MODULE_NAME, (allow_newer) ? "was newer than" : "does not match", (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) ); return PyErr_WarnEx(NULL, message, 1); } } /* InitStrings */ #if PY_MAJOR_VERSION >= 3 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { if (t.is_unicode | t.is_str) { if (t.intern) { *str = PyUnicode_InternFromString(t.s); } else if (t.encoding) { *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); } else { *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); } } else { *str = PyBytes_FromStringAndSize(t.s, t.n - 1); } if (!*str) return -1; if (PyObject_Hash(*str) == -1) return -1; return 0; } #endif static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION >= 3 __Pyx_InitString(*t, t->p); #else if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; #endif ++t; } return 0; } #include static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { size_t len = strlen(s); if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "byte string is too long"); return -1; } return (Py_ssize_t) len; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return __Pyx_PyUnicode_FromStringAndSize(c_str, len); } static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { Py_ssize_t len = __Pyx_ssize_strlen(c_str); if (unlikely(len < 0)) return NULL; return PyByteArray_FromStringAndSize(c_str, len); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " "The ability to return an instance of a strict subclass of int is deprecated, " "and may be removed in a future version of Python.", result_type_name)) { __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } __Pyx_DECREF_TypeName(result_type_name); return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", type_name, type_name, result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { return __Pyx_PyLong_CompactValue(b); } else { const digit* digits = __Pyx_PyLong_Digits(b); const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); #if PY_MAJOR_VERSION < 3 } else if (likely(PyInt_CheckExact(o))) { return PyInt_AS_LONG(o); #endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; ival = PyInt_AsLong(x); Py_DECREF(x); return ival; } } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) #endif /* #### Code section: end ### */ #endif /* Py_PYTHON_H */ pglast-7.7/pglast/parser.pyx000066400000000000000000000364341477366773500162540ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Cython interface with libpg_query # :Created: mer 02 ago 2017 15:12:49 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2023, 2024 Lele Gaifax # #cython: language_level=3 from . cimport structs from . import Error from cpython.bytes cimport PyBytes_AsStringAndSize, PyBytes_FromStringAndSize from cpython.list cimport PyList_New, PyList_SET_ITEM from libc.stdint cimport int32_t, uint64_t, uint8_t from libc cimport limits from collections import namedtuple include "ast.pyx" class ParseError(Error): "Exception representing the error state returned by the PG parser." def __str__(self): message = self.args[0] if len(self.args) > 1: location = self.args[1] if location is not None: message += f', at index {location}' return message class DeparseError(Error): "Exception representing the error state returned by the PG deparser." def __str__(self): message = self.args[0] if len(self.args) > 1: location = self.args[1] if location is not None: message += f', at position {location}' return message cdef extern from "pg_query.h" nogil: int PG_VERSION_NUM ctypedef struct PgQueryError: char* message int lineno int cursorpos ctypedef struct PgQueryParseResult: char* parse_tree PgQueryError *error ctypedef struct PgQueryProtobuf: unsigned int len char* data ctypedef struct PgQueryProtobufParseResult: PgQueryProtobuf parse_tree PgQueryError* error; ctypedef struct PgQueryPlpgsqlParseResult: char* plpgsql_funcs PgQueryError* error ctypedef struct PgQueryFingerprintResult: char* fingerprint_str char* stderr_buffer PgQueryError* error ctypedef struct PgQuerySplitStmt: int stmt_location int stmt_len ctypedef struct PgQuerySplitResult: PgQuerySplitStmt** stmts int n_stmts char* stderr_buffer PgQueryError* error ctypedef struct PgQueryDeparseResult: char* query PgQueryError* error ctypedef struct PgQueryScanResult: PgQueryProtobuf pbuf PgQueryError *error PgQueryParseResult pg_query_parse(const char* input) void pg_query_free_parse_result(PgQueryParseResult result) PgQueryProtobufParseResult pg_query_parse_protobuf(const char* input) void pg_query_free_protobuf_parse_result(PgQueryProtobufParseResult result) PgQueryPlpgsqlParseResult pg_query_parse_plpgsql(const char* input) void pg_query_free_plpgsql_parse_result(PgQueryPlpgsqlParseResult result) PgQueryFingerprintResult pg_query_fingerprint(const char* input) void pg_query_free_fingerprint_result(PgQueryFingerprintResult result) PgQueryDeparseResult pg_query_deparse_protobuf(PgQueryProtobuf parse_tree) void pg_query_free_deparse_result(PgQueryDeparseResult result) PgQuerySplitResult pg_query_split_with_scanner(const char* input) PgQuerySplitResult pg_query_split_with_parser(const char* input) void pg_query_free_split_result(PgQuerySplitResult result) PgQueryScanResult pg_query_scan(const char* input) void pg_query_free_scan_result(PgQueryScanResult result) int PG_QUERY_PARSE_DEFAULT cdef extern from "src/pg_query_internal.h" nogil: ctypedef struct PgQueryInternalParsetreeAndError: structs.List* tree char* stderr_buffer PgQueryError* error ctypedef void* MemoryContext MemoryContext pg_query_enter_memory_context() void pg_query_exit_memory_context(MemoryContext ctx) PgQueryInternalParsetreeAndError pg_query_raw_parse(const char* input, int parser_options) cdef extern from "protobuf-c/protobuf-c.h": ctypedef struct ProtobufCEnumDescriptor: pass ctypedef struct ProtobufCEnumValue: const char* name const char* c_name int value ProtobufCEnumValue* protobuf_c_enum_descriptor_get_value(const ProtobufCEnumDescriptor* d, int value) cdef extern from "protobuf/pg_query.pb-c.h" nogil: ctypedef enum PgQuery__Token: pass ctypedef enum PgQuery__KeywordKind: pass ctypedef struct PgQuery__ScanToken: int32_t start int32_t end PgQuery__Token token PgQuery__KeywordKind keyword_kind ctypedef struct PgQuery__ScanResult: size_t n_tokens PgQuery__ScanToken **tokens ProtobufCEnumDescriptor pg_query__token__descriptor ProtobufCEnumDescriptor pg_query__keyword_kind__descriptor PgQuery__ScanResult* pg_query__scan_result__unpack(void* allocator, size_t len, const uint8_t* data) void pg_query__scan_result__free_unpacked(PgQuery__ScanResult* message, void* allocator) LONG_MAX = limits.LONG_MAX cdef class Displacements: """ Helper class used to find the index of Unicode character from its offset in the corresponding UTF-8 encoded array. Example: >>> unicode = '€ 0.01' >>> utf8 = unicode.encode('utf-8') >>> d = pglast.parser.Displacements(unicode) >>> for offset in range(len(utf8)): ... print(f'{offset} [{utf8[offset]:2x}] -> {d(offset)} [{unicode[d(offset)]}]') ... 0 [e2] -> 0 [€] 1 [82] -> 0 [€] 2 [ac] -> 0 [€] 3 [20] -> 1 [ ] 4 [30] -> 2 [0] 5 [2e] -> 3 [.] 6 [30] -> 4 [0] 7 [31] -> 5 [1] """ # Build a sequence of (offset, index) tuples, for each character in the original string # that requires more than one byte once encoded in UTF-8. The sequence is kept in reverse # order, because to compute the index for an arbitrary offset we simply find the first # tuple with an offset less than or equal the given offset. cdef tuple displacements cdef unsigned long max_offset def __init__(self, str s): cdef unsigned long idx = 0 cdef unsigned long ofs = 0 cdef size_t c_len_in_utf8 disps = [] for c in s: c_len_in_utf8 = len(c.encode('utf-8')) if c_len_in_utf8 > 1: while c_len_in_utf8 > 0: disps.append((ofs, idx)) c_len_in_utf8 -= 1 ofs += 1 else: ofs += 1 idx += 1 self.max_offset = ofs - 1 self.displacements = tuple(reversed(disps)) def __call__(self, offset): if not 0 <= offset <= self.max_offset: # It may happen that the error is actually at the very end of the statement, giving # the message "syntax error at end of input", with a position that is beyond the # end of the string. Return None in such case return None for o, i in self.displacements: if o <= offset: return i + (offset - o) return offset def get_postgresql_version(): "Return the ``PostgreSQL`` version as a tuple (`major`, `minor`)." version = PG_VERSION_NUM major, minor = divmod(version, 10_000) return (major, minor) def parse_sql(str query): "Parse the given ``SQL`` `query` and return its abstract syntax tree." cdef PgQueryInternalParsetreeAndError parsed cdef MemoryContext mctx cdef int i cdef const char *cstring utf8 = query.encode('utf-8') offset_to_index = Displacements(query) cstring = utf8 mctx = pg_query_enter_memory_context() with nogil: parsed = pg_query_raw_parse(cstring, PG_QUERY_PARSE_DEFAULT) try: if parsed.tree is not NULL: stmts = PyTuple_New(parsed.tree.length) for i in range(parsed.tree.length): item = create(structs.list_nth(parsed.tree, i), offset_to_index) Py_INCREF(item) PyTuple_SET_ITEM(stmts, i, item) return stmts elif parsed.error is NULL: return () else: message = parsed.error.message.decode('utf8') raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) finally: pg_query_exit_memory_context(mctx); def parse_sql_json(str query): "Parse the given ``SQL`` `query` and return its ``JSON`` encoded syntax tree." cdef PgQueryParseResult parsed cdef const char *cstring utf8 = query.encode('utf-8') cstring = utf8 with nogil: parsed = pg_query_parse(cstring) try: if parsed.error: message = parsed.error.message.decode('utf8') offset_to_index = Displacements(query) raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) return parsed.parse_tree.decode('utf8') finally: with nogil: pg_query_free_parse_result(parsed) def parse_sql_protobuf(str query): "Parse the given ``SQL`` `query` and return its ``protobuf`` encoded syntax tree." cdef PgQueryProtobufParseResult parsed cdef const char *cstring utf8 = query.encode('utf-8') cstring = utf8 with nogil: parsed = pg_query_parse_protobuf(cstring) try: if parsed.error: message = parsed.error.message.decode('utf8') cursorpos = parsed.error.cursorpos offset_to_index = Displacements(query) raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) return PyBytes_FromStringAndSize(parsed.parse_tree.data, parsed.parse_tree.len) finally: with nogil: pg_query_free_protobuf_parse_result(parsed) def parse_plpgsql_json(str query): "Parse the given ``pgpgsql`` `query` and return its ``JSON`` encoded syntax tree." cdef PgQueryPlpgsqlParseResult parsed cdef const char *cstring utf8 = query.encode('utf-8') cstring = utf8 with nogil: parsed = pg_query_parse_plpgsql(cstring) try: if parsed.error: message = parsed.error.message.decode('utf8') offset_to_index = Displacements(query) raise ParseError(message, offset_to_index(parsed.error.cursorpos-1)) return parsed.plpgsql_funcs.decode('utf8') finally: with nogil: pg_query_free_plpgsql_parse_result(parsed) def fingerprint(str query): "Compute and return a *signature* of the given ``SQL`` `query`." cdef PgQueryFingerprintResult result cdef const char *cstring utf8 = query.encode('utf-8') cstring = utf8 with nogil: result = pg_query_fingerprint(cstring) try: if result.error: message = result.error.message.decode('utf8') offset_to_index = Displacements(query) raise ParseError(message, offset_to_index(result.error.cursorpos-1)) return result.fingerprint_str.decode('ascii') finally: with nogil: pg_query_free_fingerprint_result(result) def split(str stmts, bint with_parser=True, bint only_slices=False): """Split the given `stmts` string into a sequence of the single ``SQL`` statements. By default this uses the *parser* to perform the job; when `with_parser` is ``False`` the *scanner* variant is used, indicated when the statements may contain parse errors. When `only_slices` is ``True``, return a sequence of ``slice`` instances, one for each statement, instead of statements text. NB: leading and trailing whitespace are removed from the statements. """ cdef PgQuerySplitResult splitted cdef const char *cstring cdef int i = 0 cdef int prev_offset = 0 cdef int start cdef int end utf8 = stmts.encode('utf-8') cstring = utf8 with nogil: if with_parser: splitted = pg_query_split_with_parser(cstring) else: splitted = pg_query_split_with_scanner(cstring) try: if splitted.error: message = splitted.error.message.decode('utf8') offset_to_index = Displacements(stmts) raise ParseError(message, offset_to_index(splitted.error.cursorpos-1)) result = [] while i < splitted.n_stmts: start = splitted.stmts[i].stmt_location end = splitted.stmts[i].stmt_location + splitted.stmts[i].stmt_len stmt = utf8[start:end].decode('utf-8').strip() if only_slices: # Adjust offsets, we remove leading/trailing whitespace above cur_offset = stmts.index(stmt, prev_offset) result.append(slice(cur_offset, cur_offset + len(stmt))) prev_offset = cur_offset + 1 else: result.append(stmt) i += 1 return tuple(result) finally: with nogil: pg_query_free_split_result(splitted) def deparse_protobuf(bytes protobuf): "Convert the ``protobuf`` serialized parse tree into an equivalent ``SQL`` statement." cdef PgQueryProtobuf tree cdef PgQueryDeparseResult deparsed PyBytes_AsStringAndSize(protobuf, &tree.data, &tree.len) with nogil: deparsed = pg_query_deparse_protobuf(tree) try: if deparsed.error: message = deparsed.error.message.decode('utf8') raise DeparseError(message, deparsed.error.cursorpos) return deparsed.query.decode('utf-8') finally: with nogil: pg_query_free_deparse_result(deparsed) Token = namedtuple('Token', ('start', 'end', 'name', 'kind')) def scan(str query): "Lexify the given ``SQL`` `query` and return a list of its lexical tokens." cdef PgQueryScanResult scanned cdef PgQuery__ScanResult* scan_result cdef PgQuery__ScanToken* scan_token cdef const ProtobufCEnumValue* tkind cdef const ProtobufCEnumValue* kwkind cdef const char* cstring cdef size_t i utf8 = query.encode('utf-8') offset_to_index = Displacements(query) cstring = utf8 with nogil: scanned = pg_query_scan(cstring) try: if scanned.error: message = scanned.error.message.decode('utf8') raise ParseError(message, offset_to_index(scanned.error.cursorpos-1)) with nogil: scan_result = pg_query__scan_result__unpack(NULL, scanned.pbuf.len, scanned.pbuf.data) result = PyList_New(scan_result.n_tokens) for i in range(scan_result.n_tokens): scan_token = scan_result.tokens[i] tkind = protobuf_c_enum_descriptor_get_value(&pg_query__token__descriptor, scan_token.token) kwkind = protobuf_c_enum_descriptor_get_value(&pg_query__keyword_kind__descriptor, scan_token.keyword_kind) token = Token(offset_to_index(scan_token.start), offset_to_index(scan_token.end-1), tkind.name.decode('ascii') if tkind != NULL else "UNKNOWN", kwkind.name.decode('ascii')) Py_INCREF(token) PyList_SET_ITEM(result, i, token) with nogil: pg_query__scan_result__free_unpacked(scan_result, NULL) finally: with nogil: pg_query_free_scan_result(scanned) return result pglast-7.7/pglast/printers/000077500000000000000000000000001477366773500160525ustar00rootroot00000000000000pglast-7.7/pglast/printers/__init__.py000066400000000000000000000142171477366773500201700ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Printer functions for PG parse tree nodes # :Created: sab 05 ago 2017 16:33:14 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2020, 2021, 2022, 2024 Lele Gaifax # from .. import ast from ..error import Error NODE_PRINTERS = {} "Registry of specialized node printers, keyed by their class." SPECIAL_FUNCTIONS = {} "Registry of specialized function printers, keyed by their qualified name." class PrinterAlreadyPresentError(Error): "Exception raised trying to register another function for a tag already present." def get_printer_for_node(node): """Get specific printer implementation for given `node`. If there is a more specific printer for it, when it's inside a particular ancestor, return that instead. """ node_class = type(node) if not issubclass(node_class, ast.Node): raise ValueError('Expected an ast.Node, not a %r' % node_class.__name__) parent = abs(node.ancestors) parent_node_class = None if parent is None else type(parent.node) printer = NODE_PRINTERS.get((parent_node_class, node_class)) if printer is None: printer = NODE_PRINTERS.get(node_class) if printer is None: raise NotImplementedError("Printer for node %r is not implemented yet" % node_class.__name__) return printer def node_printer(*nodes, override=False): r"""Decorator to register a specific printer implementation for a (set of) `nodes`. :param \*nodes: a list of one or two items :param bool override: when ``True`` the function will be registered even if already present in the :data:`NODE_PRINTERS` registry When `nodes` contains a single item then the decorated function is the *generic* one, and it will be registered in :data:`NODE_PRINTERS` with that key alone. Otherwise it must contain two elements: the first may be either a scalar value or a sequence of parent nodes, and the function will be registered under the key ``(parent, node)``. """ n = len(nodes) if n == 1: parent_classes = (None,) node_class = nodes[0] elif n == 2: parent_classes, node_class = nodes if not isinstance(parent_classes, (list, tuple)): parent_classes = (parent_classes,) if not all(isinstance(c, type) and issubclass(c, ast.Node) for c in parent_classes): raise ValueError('Invalid nodes: expected a sequence of ast.Node classes as' ' parents, got %r' % (parent_classes,)) else: raise ValueError('Invalid nodes: must contain one or two items!') if not isinstance(node_class, type) or not issubclass(node_class, ast.Node): raise ValueError('Invalid nodes: expected an ast.Node class,' ' got %r' % node_class) def decorator(impl): for parent_class in parent_classes: key = node_class if parent_class is None else (parent_class, node_class) if not override and key in NODE_PRINTERS: # pragma: no cover raise PrinterAlreadyPresentError("A printer is already registered for tag %r" % key) NODE_PRINTERS[key] = impl return impl return decorator def special_function(name, override=False): """Decorator to declare a particular PostgreSQL function `name` as *special*, with a specific printer. :param str name: the qualified name of the PG function :param bool override: when ``True`` the function will be registered even if already present in the :data:`SPECIAL_FUNCTIONS` registry """ def decorator(impl): if not override and name in SPECIAL_FUNCTIONS: raise PrinterAlreadyPresentError("A printer is already registered for function %r" % name) SPECIAL_FUNCTIONS[name] = impl return impl return decorator get_special_function = SPECIAL_FUNCTIONS.get class IntEnumPrinter: "Helper class used to implement printers for specific enumerated values." enum = None "The enum class this is a printer for." def __init__(self): from enum import IntEnum if not issubclass(self.enum, IntEnum): raise ValueError(f'Given enum {self.enum!r} is not an IntEnum subclass') if len(set(m.value for m in self.enum)) != len(self.enum): # pragma: no cover raise ValueError(f'Given enum {self.enum!r} contains aliased symbols') self.value_to_symbol = {m.value: m.name for m in self.enum} def __call__(self, value, node, output): if value is None: # Should never happen, but better safe than sorry for symbol, member in self.enum.__members__.items(): if member.value == 0: break else: # pragma: no cover raise ValueError(f"Could not determine default value of class {self.enum!r}") elif isinstance(value, self.enum): symbol = self.value_to_symbol.get(value) elif isinstance(value, ast.Integer): symbol = self.value_to_symbol.get(value.ival) else: symbol = value if symbol is None: # pragma: no cover raise ValueError(f"Invalid value {value!r}, not in class {self.enum!r}") method = getattr(self, symbol, None) if method is None: if symbol in self.enum.__members__: raise NotImplementedError(f"Printer for {symbol!r} of {self.enum!r} not" f" implemented yet") else: raise ValueError(f"Invalid symbol {symbol!r}, not in class {self.enum!r}") method(node, output) def get_string_value(lst): "Helper function to get a literal string value, wrapped in a one-sized list." if len(lst) != 1 or not isinstance(lst[0], ast.String): # pragma: no cover raise TypeError('%r does not contain a single String node' % lst) return lst[0].sval from . import ddl, dml, sfuncs # noqa: F401,E402 pglast-7.7/pglast/printers/ddl.py000066400000000000000000003414461477366773500172030ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Printer function for SQL DDL nodes # :Created: gio 09 nov 2017 10:50:30 CET # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Lele Gaifax # import re from .. import ast, enums from . import IntEnumPrinter, get_string_value, node_printer @node_printer(ast.AccessPriv) def access_priv(node, output): if node.priv_name is None: output.write('ALL PRIVILEGES') else: pn = node.priv_name if pn in {'select', 'insert', 'update', 'delete', 'truncate', 'references', 'trigger', 'execute', 'usage', 'create', 'connect', 'temporary', 'temp', 'set', 'alter system'}: pn = pn.upper() output.write(pn) if node.cols is not None: output.write(' ') with output.expression(True): output.print_list(node.cols, ',', are_names=True) OBJECT_NAMES = { enums.ObjectType.OBJECT_ACCESS_METHOD: 'ACCESS METHOD', enums.ObjectType.OBJECT_AGGREGATE: 'AGGREGATE', enums.ObjectType.OBJECT_AMOP: 'AMOP', enums.ObjectType.OBJECT_AMPROC: 'AMPROC', enums.ObjectType.OBJECT_ATTRIBUTE: 'ATTRIBUTE', enums.ObjectType.OBJECT_CAST: 'CAST', enums.ObjectType.OBJECT_COLUMN: 'COLUMN', enums.ObjectType.OBJECT_COLLATION: 'COLLATION', enums.ObjectType.OBJECT_CONVERSION: 'CONVERSION', enums.ObjectType.OBJECT_DATABASE: 'DATABASE', enums.ObjectType.OBJECT_DEFAULT: 'DEFAULT', enums.ObjectType.OBJECT_DEFACL: 'DEFACL', enums.ObjectType.OBJECT_DOMAIN: 'DOMAIN', enums.ObjectType.OBJECT_DOMCONSTRAINT: 'CONSTRAINT', enums.ObjectType.OBJECT_EVENT_TRIGGER: 'EVENT TRIGGER', enums.ObjectType.OBJECT_EXTENSION: 'EXTENSION', enums.ObjectType.OBJECT_FDW: 'FOREIGN DATA WRAPPER', enums.ObjectType.OBJECT_FOREIGN_SERVER: 'SERVER', enums.ObjectType.OBJECT_FOREIGN_TABLE: 'FOREIGN TABLE', enums.ObjectType.OBJECT_FUNCTION: 'FUNCTION', enums.ObjectType.OBJECT_INDEX: 'INDEX', enums.ObjectType.OBJECT_LANGUAGE: 'LANGUAGE', enums.ObjectType.OBJECT_LARGEOBJECT: 'LARGE OBJECT', enums.ObjectType.OBJECT_MATVIEW: 'MATERIALIZED VIEW', enums.ObjectType.OBJECT_OPCLASS: 'OPERATOR CLASS', enums.ObjectType.OBJECT_OPERATOR: 'OPERATOR', enums.ObjectType.OBJECT_OPFAMILY: 'OPERATOR FAMILY', enums.ObjectType.OBJECT_PARAMETER_ACL: 'PARAMETER', enums.ObjectType.OBJECT_POLICY: 'POLICY', enums.ObjectType.OBJECT_PROCEDURE: 'PROCEDURE', enums.ObjectType.OBJECT_PUBLICATION: 'PUBLICATION', enums.ObjectType.OBJECT_PUBLICATION_REL: 'PUBLICATION_REL', enums.ObjectType.OBJECT_ROLE: 'ROLE', enums.ObjectType.OBJECT_ROUTINE: 'ROUTINE', enums.ObjectType.OBJECT_RULE: 'RULE', enums.ObjectType.OBJECT_SCHEMA: 'SCHEMA', enums.ObjectType.OBJECT_SEQUENCE: 'SEQUENCE', enums.ObjectType.OBJECT_SUBSCRIPTION: 'SUBSCRIPTION', enums.ObjectType.OBJECT_STATISTIC_EXT: 'STATISTICS', enums.ObjectType.OBJECT_TABCONSTRAINT: 'CONSTRAINT', enums.ObjectType.OBJECT_TABLE: 'TABLE', enums.ObjectType.OBJECT_TABLESPACE: 'TABLESPACE', enums.ObjectType.OBJECT_TRANSFORM: 'TRANSFORM', enums.ObjectType.OBJECT_TRIGGER: 'TRIGGER', enums.ObjectType.OBJECT_TSCONFIGURATION: 'TEXT SEARCH CONFIGURATION', enums.ObjectType.OBJECT_TSDICTIONARY: 'TEXT SEARCH DICTIONARY', enums.ObjectType.OBJECT_TSPARSER: 'TEXT SEARCH PARSER', enums.ObjectType.OBJECT_TSTEMPLATE: 'TEXT SEARCH TEMPLATE', enums.ObjectType.OBJECT_TYPE: 'TYPE', enums.ObjectType.OBJECT_USER_MAPPING: 'USER_MAPPING', enums.ObjectType.OBJECT_VIEW: 'VIEW', } @node_printer(ast.AlterCollationStmt) def alter_collation_stmt(node, output): output.write('ALTER COLLATION ') output.print_name(node.collname) output.write(' REFRESH VERSION') @node_printer(ast.AlterDatabaseStmt) def alter_database_stmt(node, output): output.write('ALTER DATABASE ') output.print_name(node.dbname) output.print_list(node.options, ' ') @node_printer(ast.AlterDatabaseSetStmt) def alter_database_set_stmt(node, output): output.write('ALTER DATABASE ') output.print_name(node.dbname) output.print_node(node.setstmt) @node_printer(ast.AlterExtensionStmt) def alter_extension_stmt(node, output): output.write('ALTER EXTENSION ') output.print_name(node.extname) output.print_list(node.options, '') @node_printer(ast.AlterExtensionStmt, ast.DefElem) def alter_extension_stmt_def_elem(node, output): option = node.defname if option == 'new_version': output.write('UPDATE TO ') output.print_node(node.arg) else: raise NotImplementedError('Option not implemented: %s' % option) @node_printer(ast.AlterExtensionContentsStmt) def alter_extension_contents_stmt(node, output): output.write('ALTER EXTENSION ') output.print_name(node.extname) if node.action == -1: output.write(' DROP ') else: output.write(' ADD ') output.write(OBJECT_NAMES[node.objtype]) output.write(' ') output.print_node(node.object) @node_printer(ast.AlterEnumStmt) def alter_enum_stmt(node, output): output.write('ALTER TYPE ') output.print_name(node.typeName) if node.newVal: if node.oldVal: output.write('RENAME VALUE ') output.write_quoted_string(node.oldVal) output.write('TO ') else: output.write('ADD VALUE ') if node.skipIfNewValExists: output.write('IF NOT EXISTS ') output.write_quoted_string(node.newVal) if node.newValNeighbor: if node.newValIsAfter: output.write(' AFTER ') else: output.write(' BEFORE ') output.write_quoted_string(node.newValNeighbor) @node_printer(ast.AlterDefaultPrivilegesStmt) def alter_default_privileges_stmt(node, output): output.writes('ALTER DEFAULT PRIVILEGES') roles = None schemas = None if node.options is not None: for opt in node.options: optname = opt.defname if optname == 'roles': roles = opt.arg elif optname == 'schemas': schemas = opt.arg else: # pragma: no cover raise NotImplementedError('Option not implemented: %s' % optname) if roles is not None: output.newline() with output.push_indent(2): output.write('FOR ROLE ') output.print_list(roles, ',') if schemas is not None: output.newline() with output.push_indent(2): output.write('IN SCHEMA ') output.print_list(schemas, ',', are_names=True) action = node.action output.newline() with output.push_indent(2): if action.is_grant: output.write('GRANT ') preposition = 'TO' else: output.write('REVOKE ') preposition = 'FROM' if action.grant_option: output.write('GRANT OPTION FOR ') if action.privileges: output.print_list(action.privileges, ',') else: output.write('ALL PRIVILEGES') output.write(' ON ') output.write(OBJECT_NAMES[action.objtype]) output.write('S ') output.writes(preposition) output.print_list(action.grantees, ',') if action.behavior == enums.DropBehavior.DROP_CASCADE: output.newline() output.write('CASCADE') @node_printer(ast.AlterFunctionStmt) def alter_function_stmt(node, output): output.write('ALTER ') if node.objtype == enums.ObjectType.OBJECT_PROCEDURE: output.write('PROCEDURE ') else: output.write('FUNCTION ') output.print_node(node.func) output.print_list(node.actions, ' ') @node_printer(ast.AlterObjectSchemaStmt) def alter_object_schema_stmt(node, output): OT = enums.ObjectType objtype = node.objectType output.write('ALTER ') output.writes(OBJECT_NAMES[objtype]) if node.missing_ok: output.write(' IF EXISTS ') if objtype in {OT.OBJECT_FOREIGN_TABLE, OT.OBJECT_MATVIEW, OT.OBJECT_SEQUENCE, OT.OBJECT_TABLE, OT.OBJECT_VIEW}: output.print_name(node.relation) else: if objtype in (OT.OBJECT_OPCLASS, OT.OBJECT_OPFAMILY): method, *name = node.object output.print_name(name) output.write(' USING ') output.print_symbol(method) else: output.print_name(node.object) output.write(' SET SCHEMA ') output.print_name(node.newschema) @node_printer(ast.AlterOperatorStmt) def alter_operator_stmt(node, output): output.write('ALTER OPERATOR ') output.print_node(node.opername) output.write(' SET ') with output.expression(True): output.print_list(node.options) @node_printer(ast.AlterOperatorStmt, ast.DefElem) def alter_operator_stmt_def_elem(node, output): if node.defnamespace: # FIXME: find a way to get here output.print_name(node.defnamespace) output.write('.') output.print_name(node.defname) output.write(' = ') if node.arg: output.print_symbol(node.arg) else: output.write('NONE') @node_printer(ast.AlterOpFamilyStmt) def alter_op_family_stmt(node, output): output.write('ALTER OPERATOR FAMILY ') output.print_name(node.opfamilyname) output.write(' USING ') output.print_name(node.amname) output.newline() output.space(2) output.write('DROP ' if node.isDrop else 'ADD ') output.print_list(node.items) @node_printer(ast.AlterOwnerStmt) def alter_owner_stmt(node, output): output.write('ALTER ') output.writes(OBJECT_NAMES[node.objectType]) OT = enums.ObjectType if node.objectType in (OT.OBJECT_OPFAMILY, OT.OBJECT_OPCLASS): method, *name = node.object output.print_name(name) output.write(' USING ') output.print_symbol(method) else: output.print_name(node.object) output.write('OWNER TO ') output.print_node(node.newowner) @node_printer(ast.AlterPolicyStmt) def alter_policy_stmt(node, output): output.write('ALTER POLICY ') output.print_name(node.policy_name) output.write(' ON ') output.print_node(node.table) if node.roles: output.write(' TO ') output.print_list(node.roles, ',') if node.qual: output.write(' USING ') with output.expression(True): output.print_node(node.qual) if node.with_check: output.write(' WITH CHECK ') with output.expression(True): output.print_node(node.with_check) @node_printer(ast.AlterRoleStmt) def alter_role_stmt(node, output): if len(node.options) == 1 and node.options[0].defname == 'rolemembers': output.write('ALTER GROUP ') output.print_node(node.role) if node.action == 1: output.write('ADD USER ') elif node.action == -1: output.write('DROP USER ') output.print_list(node.options[0].arg, ',') else: output.write('ALTER ROLE ') output.print_node(node.role) output.print_list(node.options, sep=' ') @node_printer(ast.AlterSeqStmt) def alter_seq_stmt(node, output): output.write('ALTER SEQUENCE ') if node.missing_ok: output.write('IF EXISTS ') output.print_node(node.sequence) if node.options: output.print_list(node.options, '') @node_printer(ast.AlterTableSpaceOptionsStmt) def alter_tablespace_options_stmt(node, output): output.write('ALTER TABLESPACE ') output.print_name(node.tablespacename) if node.isReset: output.swrite('RESET ') else: output.swrite('SET ') with output.expression(True): output.print_list(node.options) @node_printer(ast.AlterTableStmt) def alter_table_stmt(node, output): output.write('ALTER ') output.writes(OBJECT_NAMES[node.objtype]) if node.missing_ok: output.write('IF EXISTS ') output.print_node(node.relation) if len(node.cmds) > 1: output.newline() output.space(4) with output.push_indent(): output.print_list(node.cmds, ',') else: output.print_list(node.cmds, ',', standalone_items=True) def alter_def_elem(node, output): if node: output.write(' OPTIONS ') with output.expression(True): first = True for option in node: if first: first = False else: output.write(', ') if option.defaction == enums.DefElemAction.DEFELEM_UNSPEC: output.print_name(option.defname) output.write(' ') output.print_node(option.arg) elif option.defaction == enums.DefElemAction.DEFELEM_SET: output.write('SET ') output.print_name(option.defname) output.write(' ') output.print_node(option.arg) elif option.defaction == enums.DefElemAction.DEFELEM_ADD: output.write('ADD ') output.print_name(option.defname) output.write(' ') output.print_node(option.arg) elif option.defaction == enums.DefElemAction.DEFELEM_DROP: output.write('DROP ') output.print_name(option.defname) @node_printer(ast.AlterTableStmt, ast.RangeVar) def range_var(node, output): if abs(node.ancestors).node.objtype == enums.ObjectType.OBJECT_TABLE and not node.inh: output.write('ONLY ') if node.schemaname: output.print_name(node.schemaname) output.write('.') output.print_name(node.relname) alias = node.alias if alias: # FIXME: find a way to get here output.write(' AS ') output.print_name(alias) class AlterTableTypePrinter(IntEnumPrinter): enum = enums.AlterTableType def AT_AddColumn(self, node, output): output.write('ADD ') if abs(node.ancestors).node.objtype == enums.ObjectType.OBJECT_TYPE: output.write('ATTRIBUTE ') else: output.write('COLUMN ') if node.missing_ok: output.write('IF NOT EXISTS ') output.print_node(node.def_) def AT_AddConstraint(self, node, output): output.write('ADD ') output.print_node(node.def_) def AT_AddInherit(self, node, output): output.write('INHERIT ') output.print_node(node.def_) def AT_AddOf(self, node, output): output.write('OF ') output.print_node(node.def_) def AT_AlterColumnType(self, node, output): output.write('ALTER ') if abs(node.ancestors).node.objtype == enums.ObjectType.OBJECT_TYPE: output.write('ATTRIBUTE ') else: output.write('COLUMN ') output.print_name(node.name) output.write(' TYPE ') columndef = node.def_ output.print_node(columndef) if columndef.raw_default: output.write('USING ') output.print_node(columndef.raw_default) def AT_AlterConstraint(self, node, output): output.write('ALTER ') output.print_node(node.def_) def AT_AttachPartition(self, node, output): output.write('ATTACH PARTITION ') output.print_node(node.def_) def AT_ChangeOwner(self, node, output): output.write('OWNER TO ') output.print_name(node.newowner) def AT_ClusterOn(self, node, output): output.write('CLUSTER ON ') output.print_name(node.name) def AT_ColumnDefault(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) if node.def_: output.write(' SET DEFAULT ') output.print_node(node.def_) else: output.write(' DROP DEFAULT ') def AT_DetachPartition(self, node, output): output.write('DETACH PARTITION ') output.print_name(node.def_) def AT_DisableRowSecurity(self, node, output): output.write(' DISABLE ROW LEVEL SECURITY ') def AT_DisableTrig(self, node, output): output.write('DISABLE TRIGGER ') output.print_name(node.name) def AT_DropCluster(self, node, output): output.write('SET WITHOUT CLUSTER') def AT_DropColumn(self, node, output): output.write('DROP ') if abs(node.ancestors).node.objtype == enums.ObjectType.OBJECT_TYPE: output.write('ATTRIBUTE ') else: output.write('COLUMN ') if node.missing_ok: output.write('IF EXISTS ') output.print_name(node.name) def AT_DropConstraint(self, node, output): output.write('DROP CONSTRAINT ') if node.missing_ok: output.write('IF EXISTS ') output.print_name(node.name) def AT_DropInherit(self, node, output): output.write('NO INHERIT ') output.print_node(node.def_) def AT_DropNotNull(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write(' DROP NOT NULL ') def AT_DropOf(self, node, output): output.write('NOT OF') def AT_DropOids(self, node, output): output.write('SET WITHOUT OIDS') def AT_EnableRowSecurity(self, node, output): output.write(' ENABLE ROW LEVEL SECURITY ') def AT_EnableTrig(self, node, output): output.write('ENABLE TRIGGER ') output.print_name(node.name) def AT_EnableTrigAll(self, node, output): output.write('ENABLE TRIGGER ALL') def AT_ForceRowSecurity(self, node, output): output.write('FORCE ROW LEVEL SECURITY ') def AT_SetCompression(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write(' SET COMPRESSION ') output.print_name(node.def_) def AT_ReplicaIdentity(self, node, output): output.print_node(node.def_) def AT_ResetOptions(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write(' RESET ') with output.expression(True): with output.push_indent(): output.print_list(node.def_) def AT_ResetRelOptions(self, node, output): output.write('RESET ') with output.expression(True): with output.push_indent(): output.print_list(node.def_) def AT_SetNotNull(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write(' SET NOT NULL') def AT_SetRelOptions(self, node, output): output.write('SET ') with output.expression(True): with output.push_indent(): output.print_list(node.def_) def AT_SetStatistics(self, node, output): output.write('ALTER COLUMN ') if node.name: output.print_name(node.name) elif node.num: output.write(str(node.num)) output.write(' SET STATISTICS ') output.print_node(node.def_) def AT_SetStorage(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write(' SET STORAGE ') output.write(node.def_.sval) def AT_SetUnLogged(self, node, output): output.write('SET UNLOGGED') def AT_SetLogged(self, node, output): output.write('SET LOGGED') def AT_SetOptions(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write(' SET ') with output.expression(True): with output.push_indent(): output.print_list(node.def_) def AT_ValidateConstraint(self, node, output): output.write('VALIDATE CONSTRAINT ') output.print_name(node.name) def AT_AlterColumnGenericOptions(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) alter_def_elem(node.def_, output) def AT_GenericOptions(self, node, output): alter_def_elem(node.def_, output) def AT_SetTableSpace(self, node, output): output.write('SET TABLESPACE ') output.print_name(node.name) def AT_DropExpression(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write('DROP EXPRESSION') if node.missing_ok: output.write(' IF EXISTS') def AT_AddIdentity(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) if node.num > 0: # FIXME: find a way to get here output.print_node(node.num) output.write(' ADD ') if node.def_: output.print_node(node.def_) def AT_DropIdentity(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) if node.num > 0: # FIXME: find a way to get here output.print_node(node.num) output.write(' DROP IDENTITY ') if node.missing_ok: output.write('IF EXISTS ') def AT_NoForceRowSecurity(self, node, output): output.write('NO FORCE ROW LEVEL SECURITY ') def AT_EnableRule(self, node, output): output.write('ENABLE RULE ') output.print_name(node.name) def AT_DisableRule(self, node, output): output.write('DISABLE RULE ') output.print_name(node.name) def AT_EnableReplicaRule(self, node, output): output.write('ENABLE REPLICA RULE ') output.print_name(node.name) def AT_DisableTrigUser(self, node, output): output.write('DISABLE TRIGGER USER') def AT_EnableReplicaTrig(self, node, output): output.write('ENABLE REPLICA TRIGGER ') output.print_name(node.name) def AT_EnableAlwaysTrig(self, node, output): output.write('ENABLE ALWAYS TRIGGER ') output.print_name(node.name) def AT_DisableTrigAll(self, node, output): output.write('DISABLE TRIGGER ALL ') def AT_SetIdentity(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) if node.num > 0: # FIXME: find a way to get here output.print_node(node.num) for elem in node.def_: if elem.defname == 'restart': output.write('RESTART') if elem.arg: output.write(' WITH ') output.print_node(elem.arg) else: output.write(' SET ') if elem.defname == 'cache': output.write('CACHE ') output.print_node(elem.arg) elif elem.defname == 'cycle': if not elem.arg.boolval: output.write('NO ') output.write('CYCLE') elif elem.defname == 'increment': output.write('INCREMENT BY ') output.print_node(elem.arg) elif elem.defname == 'maxvalue': if not elem.arg: output.write('NO ') output.write('MAXVALUE') if elem.arg: output.write(' ') output.print_node(elem.arg) elif elem.defname == 'minvalue': if not elem.arg: output.write('NO ') output.write('MINVALUE') if elem.arg: output.write(' ') output.print_node(elem.arg) elif elem.defname == 'sequence_name': output.write('SEQUENCE NAME ') output.print_name(elem.arg) elif elem.defname == 'start': output.write('START WITH ') output.print_node(elem.arg) elif elem.defname == 'generated': output.write('GENERATED ') if elem.arg.ival == 97: output.write('ALWAYS') elif elem.arg.ival == 100: output.write('BY DEFAULT') def AT_SetAccessMethod(self, node, output): output.write('SET ACCESS METHOD ') if node.name is None: output.write('DEFAULT') else: output.print_name(node.name) def AT_SetExpression(self, node, output): output.write('ALTER COLUMN ') output.print_name(node.name) output.write('SET EXPRESSION AS ') with output.expression(True): output.print_node(node.def_) alter_table_type_printer = AlterTableTypePrinter() @node_printer(ast.AlterTableCmd) def alter_table_cmd(node, output): alter_table_type_printer(node.subtype, node, output) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.swrite('CASCADE') @node_printer((ast.AlterTableCmd, ast.CreatePublicationStmt, ast.CreateStmt, ast.IndexStmt, ast.IntoClause), ast.DefElem) def alter_table_cmd_def_elem(node, output): if node.defnamespace: output.print_name(node.defnamespace) output.write('.') output.print_name(node.defname) if node.arg: output.write(' = ') output.print_node(node.arg) @node_printer(ast.AlterTableMoveAllStmt) def alter_table_move_all_stmt(node, output): output.write(f'ALTER {OBJECT_NAMES[node.objtype]} ALL IN TABLESPACE ') output.print_name(node.orig_tablespacename) if node.roles is not None: output.write(' OWNED BY ') output.print_list(node.roles, are_names=True) output.write(' SET TABLESPACE ') output.print_name(node.new_tablespacename) if node.nowait: output.write(' NOWAIT') class AlterTSConfigTypePrinter(IntEnumPrinter): enum = enums.AlterTSConfigType def print_simple_name(self, node, output): if isinstance(node, tuple): node = node[0] output.write(node.sval) def print_simple_list(self, nodes, output): first = True for node in nodes: if not first: output.write(', ') else: first = False self.print_simple_name(node, output) def ALTER_TSCONFIG_ADD_MAPPING(self, node, output): output.newline() output.space(2) with output.push_indent(): output.write('ADD MAPPING FOR ') self.print_simple_list(node.tokentype, output) output.newline() output.write(' WITH ') self.print_simple_list(node.dicts, output) def ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN(self, node, output): output.newline() output.space(2) with output.push_indent(): output.write('ALTER MAPPING FOR ') self.print_simple_list(node.tokentype, output) output.newline() output.write('WITH ') self.print_simple_list(node.dicts, output) def ALTER_TSCONFIG_REPLACE_DICT(self, node, output): output.newline() output.space(2) with output.push_indent(): output.write('ALTER MAPPING REPLACE ') old, new = node.dicts self.print_simple_name(old, output) output.newline() output.write(' WITH ') self.print_simple_name(new, output) def ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN(self, node, output): output.newline() output.space(2) with output.push_indent(): output.write('ALTER MAPPING FOR ') self.print_simple_list(node.tokentype, output) output.newline() output.write('REPLACE ') old, new = node.dicts self.print_simple_name(old, output) output.newline() output.write(' WITH ') self.print_simple_name(new, output) def ALTER_TSCONFIG_DROP_MAPPING(self, node, output): output.newline() output.space(2) with output.push_indent(): output.write('DROP MAPPING ') if node.missing_ok: output.write('IF EXISTS ') output.write('FOR ') self.print_simple_list(node.tokentype, output) alter_ts_config_type_printer = AlterTSConfigTypePrinter() @node_printer(ast.AlterTSConfigurationStmt) def alter_ts_configuration_stmt(node, output): output.write('ALTER TEXT SEARCH CONFIGURATION ') output.print_name(node.cfgname) output.write(' ') alter_ts_config_type_printer(node.kind, node, output) @node_printer(ast.AlterTSDictionaryStmt) def alter_ts_dictionary_stmt(node, output): output.write('ALTER TEXT SEARCH DICTIONARY ') output.print_name(node.dictname) output.write(' ') with output.expression(True): if len(node.options) > 1: output.newline() output.space(2 if output.comma_at_eoln else 4) output.print_list(node.options) if len(node.options) > 1: output.newline() @node_printer(ast.AlterStatsStmt) def alter_stats_stmt(node, output): output.write('ALTER STATISTICS ') if node.missing_ok: output.write('IF EXISTS ') output.print_name(node.defnames) output.write(' SET STATISTICS ') output.print_node(node.stxstattarget) class AlterSubscriptionTypePrinter(IntEnumPrinter): enum = enums.AlterSubscriptionType def ALTER_SUBSCRIPTION_OPTIONS(self, node, output): output.write('SET ') with output.expression(True): output.print_name(node.options) def ALTER_SUBSCRIPTION_CONNECTION(self, node, output): output.write('CONNECTION ') output.print_node(node.conninfo) def ALTER_SUBSCRIPTION_SET_PUBLICATION(self, node, output): if node.options: output.newline() output.space(2) output.swrite('SET PUBLICATION ') output.print_list(node.publication, ',', are_names=True) if node.options: output.newline() output.space(1) output.write('WITH ') with output.expression(True): output.print_list(node.options) def ALTER_SUBSCRIPTION_ADD_PUBLICATION(self, node, output): if node.options: output.newline() output.space(2) output.write('ADD PUBLICATION ') output.print_list(node.publication, ',', are_names=True) if node.options: output.newline() output.space(1) output.write('WITH ') with output.expression(True): output.print_list(node.options) def ALTER_SUBSCRIPTION_DROP_PUBLICATION(self, node, output): if node.options: output.newline() output.space(1) output.write('DROP PUBLICATION ') output.print_list(node.publication, ',', are_names=True) if node.options: output.newline() output.space(1) output.write('WITH ') with output.expression(True): output.print_list(node.options) def ALTER_SUBSCRIPTION_REFRESH(self, node, output): output.write('REFRESH PUBLICATION') if node.options: output.newline() output.space(1) output.write('WITH ') with output.expression(True): output.print_list(node.options) def ALTER_SUBSCRIPTION_ENABLED(self, node, output): output.write('ENABLE' if node.options[0].arg.boolval else 'DISABLE') def ALTER_SUBSCRIPTION_SKIP(self, node, output): output.write('SKIP ') with output.expression(True): output.print_list(node.options) alter_subscription_type_printer = AlterSubscriptionTypePrinter() @node_printer(ast.AlterSubscriptionStmt) def alter_subscription_stmt(node, output): output.write('ALTER SUBSCRIPTION ') output.print_name(node.subname) alter_subscription_type_printer(node.kind, node, output) class AlterPublicationActionPrinter(IntEnumPrinter): enum = enums.AlterPublicationAction def AP_AddObjects(self, node, output): output.write('ADD') def AP_DropObjects(self, node, output): output.write('DROP') def AP_SetObjects(self, node, output): output.write('SET') alter_publication_action_printer = AlterPublicationActionPrinter() @node_printer(ast.AlterPublicationStmt) def alter_publication_stmt(node, output): output.write('ALTER PUBLICATION ') output.print_name(node.pubname) output.write(' ') if node.pubobjects: alter_publication_action_printer(node.action, node, output) output.write(' ') output.print_list(node.pubobjects) elif node.options: output.write('SET ') with output.expression(True): output.print_list(node.options, ',') @node_printer(ast.AlterFdwStmt) def alter_fdw_stmt(node, output): output.write('ALTER FOREIGN DATA WRAPPER ') output.print_name(node.fdwname) if node.func_options: output.print_list(node.func_options, '') if node.options: alter_def_elem(node.options, output) @node_printer(ast.AlterFdwStmt, ast.DefElem) def alter_fdw_stmt_def_elem(node, output): if node.defname == "handler": if node.arg: output.writes('HANDLER') else: output.writes('NO HANDLER') elif node.defname == "validator": if node.arg: output.writes('VALIDATOR') else: output.writes('NO VALIDATOR') if node.arg: output.print_name(node.arg) @node_printer(ast.AlterForeignServerStmt) def alter_foreign_server_stmt(node, output): output.write('ALTER SERVER ') output.print_name(node.servername) if node.has_version: output.write(' VERSION ') if node.version: output.print_node(node.version) else: output.write('NULL') alter_def_elem(node.options, output) @node_printer(ast.AlterUserMappingStmt) def alter_user_mapping_stmt(node, output): output.write('ALTER USER MAPPING FOR ') role_spec(node.user, output) output.writes(' SERVER ') output.write(node.servername) alter_def_elem(node.options, output) @node_printer(ast.AlterRoleSetStmt) def alter_role_set_stmt(node, output): output.write('ALTER ROLE ') if not node.role: output.write('ALL') else: output.print_node(node.role) output.write(' ') if node.database: output.write('IN DATABASE ') output.print_name(node.database) output.write(' ') output.print_node(node.setstmt) @node_printer(ast.AlterDomainStmt) def alter_domain_stmt(node, output): output.write('ALTER DOMAIN ') output.print_name(node.typeName) if node.subtype == 'T': if node.def_: output.write(' SET DEFAULT ') output.print_node(node.def_) else: output.write(' DROP DEFAULT') elif node.subtype == 'N': output.write(' DROP NOT NULL') elif node.subtype == 'O': output.write(' SET NOT NULL') elif node.subtype == 'C': output.write(' ADD ') output.print_node(node.def_) elif node.subtype == 'X': output.write(' DROP CONSTRAINT ') if node.missing_ok: output.write('IF EXISTS ') output.print_name(node.name) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') elif node.subtype == 'V': output.write(' VALIDATE CONSTRAINT ') output.print_name(node.name) else: raise NotImplementedError @node_printer(ast.AlterEventTrigStmt) def alter_event_trig_stmt(node, output): output.write('ALTER EVENT TRIGGER ') output.print_name(node.trigname) if node.tgenabled == 'O': output.write(' ENABLE') elif node.tgenabled == 'A': output.write(' ENABLE ALWAYS') elif node.tgenabled == 'R': output.write(' ENABLE REPLICA') elif node.tgenabled == 'D': output.write(' DISABLE') @node_printer(ast.AlterTypeStmt) def alter_type_stmt(node, output): output.write('ALTER TYPE ') output.print_name(node.typeName) output.write(' SET ') with output.expression(True): output.print_list(node.options, ',') @node_printer(ast.CheckPointStmt) def check_point_stmt(node, output): output.write('CHECKPOINT') @node_printer(ast.ClusterStmt) def cluster_stmt(node, output): output.write('CLUSTER ') if node.params: assert node.params[0].defname == 'verbose' output.write('VERBOSE ') if node.relation: output.print_name(node.relation) if node.indexname: output.write(' USING ') output.print_name(node.indexname) @node_printer(ast.ColumnDef) def column_def(node, output): if node.colname: output.print_name(node.colname) output.space() if node.typeName: output.print_name(node.typeName) if node.compression: output.write(' COMPRESSION ') output.print_name(node.compression) else: if node.constraints: output.write('WITH OPTIONS ') if node.storage_name: output.write('STORAGE ') output.write(node.storage_name) output.write(' ') if node.fdwoptions: output.write(' OPTIONS ') with output.expression(True): output.print_list(node.fdwoptions, ',') if node.collClause: output.print_node(node.collClause) if node.is_not_null: # pragma: no cover # See issue #150: this flag is currently never set by the underlying libpg_query # parser, it seems some kind of analysis/optimization carried by PG post-parse; should # this ever happen, we shall probably have to rectify ConstrTypePrinter raise NotImplementedError('Unexpected ColumnDef.is_not_null==True') if node.constraints: output.print_list(node.constraints, '', standalone_items=False) @node_printer(ast.CommentStmt) def comment_stmt(node, output): otypes = enums.ObjectType output.write('COMMENT ON ') output.writes(OBJECT_NAMES[node.objtype]) if node.objtype in (otypes.OBJECT_OPCLASS, otypes.OBJECT_OPFAMILY): nodes = list(node.object) using = nodes.pop(0) output.print_name(nodes) output.write(' USING ') output.print_name(using) elif node.objtype in (otypes.OBJECT_TABCONSTRAINT, otypes.OBJECT_POLICY, otypes.OBJECT_RULE, otypes.OBJECT_TRIGGER): nodes = list(node.object) output.print_name(nodes.pop()) output.write(' ON ') output.print_name(nodes) elif node.objtype == otypes.OBJECT_DOMCONSTRAINT: nodes = list(node.object) output.print_name(nodes.pop()) output.write(' ON DOMAIN ') output.print_name(nodes) elif node.objtype == otypes.OBJECT_TRANSFORM: nodes = list(node.object) output.write('FOR ') output.print_name(nodes.pop(0)) output.write(' LANGUAGE ') output.print_name(nodes) elif node.objtype == otypes.OBJECT_AGGREGATE: _object_with_args(node.object, output, empty_placeholder='*') elif isinstance(node.object, tuple): if not isinstance(node.object[0], ast.String): output.write(' ') with output.expression(True): output.print_list(node.object, ' AS ', standalone_items=False) else: output.print_name(node.object) else: output.print_name(node.object) output.newline() output.space(2) output.write('IS ') if node.comment: with output.push_indent(): output.write_quoted_string(node.comment) else: output.write('NULL') @node_printer(ast.CompositeTypeStmt) def composite_type_stmt(node, output): output.write('CREATE TYPE ') output.print_node(node.typevar) output.write(' AS ') with output.expression(True): if node.coldeflist: output.print_list(node.coldeflist, ', ') @node_printer(ast.CompositeTypeStmt, ast.RangeVar) def composite_type_stmt_range_var(node, output): # Ignore the inh attribute, that in the normal implementation emits "ONLY" when it is False if node.schemaname: output.print_name(node.schemaname) output.write('.') output.print_name(node.relname) alias = node.alias if alias: # FIXME: find a way to get here output.write(' AS ') output.print_name(alias) class ConstrTypePrinter(IntEnumPrinter): enum = enums.ConstrType def CONSTR_ATTR_DEFERRABLE(self, node, output): output.swrite('DEFERRABLE') def CONSTR_ATTR_DEFERRED(self, node, output): output.swrite('INITIALLY DEFERRED') def CONSTR_CHECK(self, node, output): output.swrite('CHECK ') with output.expression(True): # From parsenodes.h::ConstrType enum doc: # For constraints that use expressions (CONSTR_CHECK, CONSTR_DEFAULT) # we may have the expression in either "raw" form (an untransformed # parse tree) or "cooked" form (the nodeToString representation of # an executable expression tree), depending on how this Constraint # node was created (by parsing, or by inheritance from an existing # relation). We should never have both in the same node! assert not (node.raw_expr is not None and node.cooked_expr is not None) output.print_node(node.cooked_expr if node.raw_expr is None else node.raw_expr) if node.is_no_inherit: output.swrite('NO INHERIT') def CONSTR_DEFAULT(self, node, output): output.swrite('DEFAULT ') assert not (node.raw_expr is not None and node.cooked_expr is not None) # Handle DEFAULT (1 IN (1,2)) expr = node.cooked_expr if node.raw_expr is None else node.raw_expr need_parens = isinstance(expr, ast.A_Expr) and expr.kind == enums.A_Expr_Kind.AEXPR_IN with output.expression(need_parens): output.print_node(expr) def CONSTR_EXCLUSION(self, node, output): output.swrite('EXCLUDE USING ') if node.access_method: output.print_symbol(node.access_method) output.write(' ') with output.expression(True): first = True for elem, clauses in node.exclusions: if first: first = False else: output.write(', ') output.print_node(elem) output.swrite('WITH OPERATOR') with output.expression(True): output.print_symbol(clauses) if node.where_clause: output.write(' WHERE ') with output.expression(True): output.print_node(node.where_clause) def CONSTR_FOREIGN(self, node, output): if node.fk_attrs: output.swrite('FOREIGN KEY ') with output.expression(True): output.print_name(node.fk_attrs, ',') if node.pktable: output.swrite('REFERENCES ') output.print_name(node.pktable) if node.pk_attrs: output.write(' ') with output.expression(True): output.print_name(node.pk_attrs, ',') if node.fk_matchtype != '\0' and node.fk_matchtype != enums.FKCONSTR_MATCH_SIMPLE: output.write(' MATCH ') if node.fk_matchtype == enums.FKCONSTR_MATCH_FULL: output.write('FULL') elif node.fk_matchtype == enums.FKCONSTR_MATCH_PARTIAL: # pragma: no cover # MATCH PARTIAL not yet implemented output.write('PARTIAL') if node.fk_del_action != '\0' and node.fk_del_action != enums.FKCONSTR_ACTION_NOACTION: output.write(' ON DELETE ') if node.fk_del_action == enums.FKCONSTR_ACTION_RESTRICT: output.write('RESTRICT') elif node.fk_del_action == enums.FKCONSTR_ACTION_CASCADE: output.write('CASCADE') elif node.fk_del_action == enums.FKCONSTR_ACTION_SETNULL: output.write('SET NULL') elif node.fk_del_action == enums.FKCONSTR_ACTION_SETDEFAULT: output.write('SET DEFAULT') if node.fk_del_set_cols is not None: output.write(' ') with output.expression(True): output.print_name(node.fk_del_set_cols, ',') if node.fk_upd_action != '\0' and node.fk_upd_action != enums.FKCONSTR_ACTION_NOACTION: output.write(' ON UPDATE ') if node.fk_upd_action == enums.FKCONSTR_ACTION_RESTRICT: output.write('RESTRICT') elif node.fk_upd_action == enums.FKCONSTR_ACTION_CASCADE: output.write('CASCADE') elif node.fk_upd_action == enums.FKCONSTR_ACTION_SETNULL: output.write('SET NULL') elif node.fk_upd_action == enums.FKCONSTR_ACTION_SETDEFAULT: output.write('SET DEFAULT') def CONSTR_GENERATED(self, node, output): output.swrite('GENERATED ALWAYS AS ') with output.expression(True): output.print_node(node.raw_expr) output.write(' STORED') def CONSTR_IDENTITY(self, node, output): output.swrite('GENERATED ') if node.generated_when == enums.ATTRIBUTE_IDENTITY_ALWAYS: output.write('ALWAYS ') elif node.generated_when == enums.ATTRIBUTE_IDENTITY_BY_DEFAULT: output.write('BY DEFAULT ') output.write('AS IDENTITY') if node.options: output.space() with output.expression(True): output.print_list(node.options, '') def CONSTR_NOTNULL(self, node, output): output.swrite('NOT NULL') def CONSTR_NULL(self, node, output): output.swrite('NULL') def CONSTR_PRIMARY(self, node, output): output.swrite('PRIMARY KEY') def CONSTR_UNIQUE(self, node, output): output.swrite('UNIQUE') if node.nulls_not_distinct: output.write(' NULLS NOT DISTINCT') def CONSTR_ATTR_IMMEDIATE(self, node, output): output.swrite('INITIALLY IMMEDIATE') constr_type_printer = ConstrTypePrinter() @node_printer(ast.Constraint) def constraint(node, output): if node.conname: output.swrite('CONSTRAINT ') output.print_name(node.conname) constr_type_printer(node.contype, node, output) if node.indexname: output.write(' USING INDEX ') output.print_name(node.indexname) # Common to UNIQUE & PRIMARY_KEY if node.keys and node.contype in (enums.ConstrType.CONSTR_UNIQUE, enums.ConstrType.CONSTR_PRIMARY): output.write(' ') with output.expression(True): output.print_name(node.keys, ',') if node.including: output.write(' INCLUDE ') with output.expression(True): output.print_list(node.including, ',', are_names=True) if node.deferrable: output.swrite('DEFERRABLE') if node.initdeferred: output.swrite('INITIALLY DEFERRED') with output.push_indent(): first = True if node.options and node.contype == enums.ConstrType.CONSTR_UNIQUE: output.write(' WITH ') with output.expression(True): firstOption = True for option in node.options: if firstOption: firstOption = False else: output.write(', ') output.print_name(option.defname) output.write(' = ') output.print_node(option.arg) first = False if node.indexspace: if first: first = False else: output.newline() output.write(' USING INDEX TABLESPACE ') output.print_name(node.indexspace) if node.skip_validation: output.write(' NOT VALID') @node_printer(ast.CreateAmStmt) def create_am_stmt(node, output): output.write('CREATE ACCESS METHOD ') output.print_name(node.amname) # Index access method if node.amtype == enums.AMTYPE_INDEX: output.write(' TYPE INDEX HANDLER ') output.print_name(node.handler_name) # Table access method elif node.amtype == enums.AMTYPE_TABLE: output.write(' TYPE TABLE HANDLER ') output.print_name(node.handler_name) else: # pragma: no cover raise NotImplementedError('Unhandled amtype: %s' % node.amtype) @node_printer(ast.CreatedbStmt) def create_db_stmt(node, output): output.write('CREATE DATABASE ') output.print_name(node.dbname) if node.options: output.newline() output.space(2) output.write('WITH ') output.print_list(node.options, '') @node_printer(ast.CreatedbStmt, ast.DefElem) def create_db_stmt_def_elem(node, output): option = node.defname if option == 'connection_limit': output.write('connection limit') else: output.print_symbol(node.defname) if node.arg is not None: output.write(' = ') if isinstance(node.arg, tuple) or option in ('allow_connections', 'is_template'): output.write(node.arg.sval) else: output.print_node(node.arg) @node_printer(ast.CreateCastStmt) def create_cast_stmt(node, output): output.write('CREATE CAST ') with output.expression(True): output.print_node(node.sourcetype) output.write(' AS ') output.print_node(node.targettype) if node.func: output.write(' WITH FUNCTION ') output.print_node(node.func) elif node.inout: output.write(' WITH INOUT') else: output.write(' WITHOUT FUNCTION') if node.context == enums.CoercionContext.COERCION_ASSIGNMENT: output.write(' AS ASSIGNMENT') elif node.context == enums.CoercionContext.COERCION_IMPLICIT: output.write(' AS IMPLICIT') @node_printer(ast.CreateConversionStmt) def create_conversion_stmt(node, output): output.write('CREATE ') if node.def_: output.write('DEFAULT ') output.write('CONVERSION ') output.print_name(node.conversion_name) output.write(" FOR '%s' TO '%s'" % (node.for_encoding_name, node.to_encoding_name)) output.write(' FROM ') output.print_name(node.func_name) @node_printer(ast.CreateDomainStmt) def create_domain_stmt(node, output): output.write('CREATE DOMAIN ') output.print_name(node.domainname) output.write(' AS ') output.print_node(node.typeName) if node.collClause: output.print_node(node.collClause) if node.constraints: output.print_list(node.constraints, '', standalone_items=False) @node_printer(ast.CreateEnumStmt) def create_enum_stmt(node, output): output.write('CREATE TYPE ') output.print_name(node.typeName) output.write('AS ENUM ') with output.expression(True): output.print_list(node.vals) @node_printer(ast.CreateEventTrigStmt) def create_event_trig_stmt(node, output): output.write('CREATE EVENT TRIGGER ') output.print_name(node.trigname) output.write(' ON ') output.print_name(node.eventname) output.newline() with output.push_indent(2): if node.whenclause: output.write('WHEN ') output.print_list(node.whenclause, 'AND', relative_indent=-4) output.newline() output.write('EXECUTE PROCEDURE ') output.print_name(node.funcname) output.write('()') @node_printer(ast.CreateEventTrigStmt, ast.DefElem) def create_event_trig_stmt_def_elem(node, output): output.print_name(node.defname) output.write(' IN ') with output.expression(True): output.print_list(node.arg, standalone_items=False) @node_printer(ast.CreateExtensionStmt) def create_extension_stmt(node, output): output.write('CREATE EXTENSION ') if node.if_not_exists: output.write('IF NOT EXISTS ') output.print_name(node.extname) if node.options: output.newline() output.space(2) output.write('WITH ') output.print_list(node.options, '') @node_printer(ast.CreateExtensionStmt, ast.DefElem) def create_extension_stmt_def_elem(node, output): option = node.defname if option == 'cascade': if node.arg.boolval: output.write('CASCADE') elif option == 'old_version': # FIXME: find a way to get here output.write('FROM ') output.print_node(node.arg) elif option == 'new_version': output.write('VERSION ') output.print_node(node.arg) else: output.write(option.upper()) output.write(' ') if option == 'schema': output.print_name(node.arg) else: # FIXME: find a way to get here output.print_node(node.arg) @node_printer(ast.CreateFdwStmt) def create_fdw_stmt(node, output): output.write('CREATE FOREIGN DATA WRAPPER ') output.print_name(node.fdwname) if node.func_options: output.newline() output.space(2) with output.push_indent(): output.print_list(node.func_options, '') if node.options: output.newline() with output.push_indent(2): output.write('OPTIONS ') with output.expression(True): output.print_list(node.options) @node_printer((ast.ColumnDef, ast.CreateUserMappingStmt, ast.CreateFdwStmt), ast.DefElem) def create_fdw_stmt_def_elem(node, output): if abs(node.ancestors).member in ('options', 'fdwoptions'): if ' ' in node.defname: output.write(f'"{node.defname}"') else: output.write(node.defname) output.write(' ') output.print_node(node.arg) else: output.write(node.defname.upper()) output.write(' ') output.print_name(node.arg) @node_printer(ast.CreateForeignServerStmt) def create_foreign_server_stmt(node, output): output.write('CREATE SERVER ') if node.if_not_exists: output.write('IF NOT EXISTS ') output.print_name(node.servername) if node.servertype: output.write(' TYPE ') output.print_node(node.servertype) if node.version: output.write(' VERSION ') output.print_node(node.version) output.write('FOREIGN DATA WRAPPER ') output.print_name(node.fdwname) if node.options: output.write(' OPTIONS ') with output.expression(True): output.print_list(node.options) @node_printer(ast.CreateForeignTableStmt) def create_foreign_table_stmt(node, output): output.print_node(node.base) if not node.base.tableElts: output.newline() output.write(' ') output.write(' SERVER ') output.print_name(node.servername) if node.options: output.newline() with output.push_indent(2): output.write('OPTIONS ') with output.expression(True): output.print_list(node.options) @node_printer((ast.CreateForeignTableStmt, ast.CreateForeignServerStmt), ast.DefElem) def create_foreign_table_stmt_def_elem(node, output): if ' ' in node.defname: output.write(f'"{node.defname}"') else: output.write(node.defname) output.write(' ') output.print_node(node.arg) @node_printer(ast.CreateFunctionStmt) def create_function_stmt(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') if node.is_procedure: output.write('PROCEDURE ') else: output.write('FUNCTION ') output.print_name(node.funcname) with output.expression(True): if node.parameters is not None: # Functions returning a SETOF needs special care, because the resulting record # definition is intermixed with real parameters: split them into two separated # lists real_params = node.parameters if node.returnType and node.returnType.setof: fpm = enums.FunctionParameterMode record_def = [] real_params = [] for param in node.parameters: if param.mode == fpm.FUNC_PARAM_TABLE: record_def.append(param) else: real_params.append(param) if real_params: output.print_list(real_params) else: record_def = False if node.returnType: output.newline() output.writes('RETURNS') if node.returnType.setof and record_def: # Do not treat them as arguments output.write('TABLE ') with output.expression(True): output.print_list(record_def, ',', standalone_items=False) else: output.print_node(node.returnType) if node.options: for option in node.options: output.print_node(option) if node.sql_body: if node.is_procedure: output.newline() output.write('BEGIN ATOMIC') output.newline() if node.sql_body != (None,): output.space(2) with output.push_indent(): for stmt in node.sql_body[0]: output.print_node(stmt) output.write(';') output.newline() output.write('END') else: output.print_node(node.sql_body) @node_printer((ast.AlterFunctionStmt, ast.CreateFunctionStmt, ast.DoStmt), ast.DefElem) def create_function_option(node, output): option = node.defname if option == 'as': if isinstance(node.arg, tuple) and len(node.arg) > 1: # We are in the weird C case output.write('AS ') output.print_list(node.arg) return if isinstance(abs(node.ancestors).node, ast.CreateFunctionStmt): output.newline() output.write('AS ') # Choose a valid dollar-string delimiter if isinstance(node.arg, tuple): code = node.arg[0].sval else: code = node.arg.sval used_delimiters = set(re.findall(r"\$(\w*)(?=\$)", code)) unique_delimiter = '' while unique_delimiter in used_delimiters: unique_delimiter += '_' # TODO: ideally, when the function is "LANGUAGE SQL", we could reparse # the statement and prettify it... output.write('$' + unique_delimiter + '$') output.write(code) output.write('$' + unique_delimiter + '$') return if option == 'security': if node.arg.boolval: output.swrite('SECURITY DEFINER') else: output.swrite('SECURITY INVOKER') return if option == 'strict': output.swrite('RETURNS NULL ON NULL INPUT' if node.arg.boolval else 'CALLED ON NULL INPUT') return if option == 'volatility': output.separator() output.write(node.arg.sval.upper()) return if option == 'parallel': if node.arg: output.swrite('PARALLEL ') output.print_name(node.arg) else: # pragma: no cover # Backward compatibility, with recent PG the arg is always there output.swrite('PARALLEL SAFE') return if option == 'leakproof': if not node.arg.boolval: output.swrite('NOT') output.swrite('LEAKPROOF') return if option == 'set': output.separator() output.print_node(node.arg) return if option == 'window': output.write('WINDOW') return output.newline() output.writes(node.defname.upper()) output.print_symbol(node.arg) @node_printer(ast.CreateOpClassStmt) def create_opclass_stmt(node, output): output.write('CREATE OPERATOR CLASS ') output.print_name(node.opclassname) if node.isDefault: output.write('DEFAULT ') output.write('FOR TYPE ') output.print_name(node.datatype) output.write('USING ') output.print_name(node.amname) output.write('AS ') output.print_list(node.items, ',') @node_printer(ast.CreateOpClassItem) def create_opclass_item(node, output): if node.itemtype == enums.OPCLASS_ITEM_OPERATOR: output.write('OPERATOR ') output.write('%d ' % node.number) if node.name: _object_with_args(node.name, output, symbol=True, skip_empty_args=True) if node.order_family: output.write(' FOR ORDER BY ') output.print_name(node.order_family) if node.class_args: output.write(' ') with output.expression(True): output.print_list(node.class_args, standalone_items=False) elif node.itemtype == enums.OPCLASS_ITEM_FUNCTION: output.write('FUNCTION ') output.write('%d ' % node.number) if node.class_args: with output.expression(True): output.print_list(node.class_args, standalone_items=False) if node.name: output.space() if node.name: _object_with_args(node.name, output, skip_empty_args=True) elif node.itemtype == enums.OPCLASS_ITEM_STORAGETYPE: output.write('STORAGE ') output.print_name(node.storedtype) else: # pragma: no cover raise NotImplementedError('Unhandled OpClassItem type: %s' % node.itemtype) @node_printer(ast.CreateOpFamilyStmt) def create_op_family_stmt(node, output): output.write('CREATE OPERATOR FAMILY ') output.print_name(node.opfamilyname) output.write(' USING ') output.print_name(node.amname) @node_printer(ast.CreatePLangStmt) def create_plang_stmt(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') if node.pltrusted: output.write('TRUSTED ') output.write('PROCEDURAL LANGUAGE ') output.print_name(node.plname) if node.plhandler: output.newline() with output.push_indent(2): output.write('HANDLER ') output.print_name(node.plhandler) if node.plinline: output.newline() output.write('INLINE ') output.print_name(node.plinline) if node.plvalidator: output.newline() output.write('VALIDATOR ') output.print_name(node.plvalidator) @node_printer(ast.CreatePolicyStmt) def create_policy_stmt(node, output): output.write('CREATE POLICY ') output.print_name(node.policy_name) output.write(' ON ') output.print_node(node.table) if node.permissive: output.write('AS PERMISSIVE ') else: output.write('AS RESTRICTIVE ') if node.cmd_name: output.write('FOR ') output.print_symbol(node.cmd_name) output.write(' TO ') output.print_list(node.roles, ',') if node.qual: output.write(' USING ') with output.expression(True): output.print_node(node.qual) if node.with_check: output.write(' WITH CHECK ') with output.expression(True): output.print_node(node.with_check) @node_printer(ast.CreatePublicationStmt) def create_publication_stmt(node, output): output.write('CREATE PUBLICATION ') output.print_name(node.pubname) output.write(' ') if node.for_all_tables: output.write('FOR ALL TABLES ') elif node.pubobjects is not None: output.newline() output.write(' FOR ') output.print_list(node.pubobjects) if node.options: output.newline() output.swrite(' WITH ') with output.expression(True): output.print_list(node.options, ',') @node_printer(ast.CreateRangeStmt) def create_range_stmt(node, output): output.write('CREATE TYPE ') output.print_name(node.typeName) output.write(' AS RANGE ') with output.expression(True): output.print_list(node.params) class RoleStmtTypePrinter(IntEnumPrinter): enum = enums.RoleStmtType def ROLESTMT_ROLE(self, node, output): output.write('ROLE') def ROLESTMT_USER(self, node, output): output.write('USER') def ROLESTMT_GROUP(self, node, output): output.write('GROUP') role_stmt_type_printer = RoleStmtTypePrinter() @node_printer(ast.CreateRoleStmt) def create_role_stmt(node, output): output.write('CREATE ') role_stmt_type_printer(node.stmt_type, node, output) output.write(' ') output.print_name(node.role) if node.options: output.write(' WITH ') output.print_list(node.options, sep=' ') @node_printer((ast.AlterRoleStmt, ast.CreateRoleStmt), ast.DefElem) def create_or_alter_role_option(node, output): option = node.defname argv = node.arg if option == 'sysid': output.write('SYSID ') output.print_node(argv) elif option == 'adminmembers': output.write('ADMIN ') output.print_list(argv) elif option == 'rolemembers': output.write('ROLE ') output.print_list(argv) elif option == 'addroleto': output.write('IN ROLE ') output.print_list(argv) elif option == 'superuser': output.write('SUPERUSER' if argv.boolval else 'NOSUPERUSER') elif option == 'createdb': output.write('CREATEDB' if argv.boolval else 'NOCREATEDB') elif option == 'createrole': output.write('CREATEROLE' if argv.boolval else 'NOCREATEROLE') elif option == 'canlogin': output.write('LOGIN' if argv.boolval else 'NOLOGIN') elif option == 'connectionlimit': output.write('CONNECTION LIMIT ') output.print_node(argv) elif option == 'validUntil': output.write('VALID UNTIL ') output.print_node(argv) elif option == 'password': output.write('PASSWORD ') if argv: output.print_node(argv) else: output.write('NULL') elif option == 'inherit': output.write('INHERIT' if argv.boolval else 'NOINHERIT') elif option == 'isreplication': output.write('REPLICATION' if argv.boolval else 'NOREPLICATION') elif option == 'bypassrls': output.write('BYPASSRLS' if argv.boolval else 'NOBYPASSRLS') else: raise NotImplementedError('Unhandled option: %s' % option) @node_printer(ast.CreateSchemaStmt) def create_schema_stmt(node, output): output.write('CREATE SCHEMA ') if node.if_not_exists: output.write('IF NOT EXISTS ') if node.schemaname: output.print_name(node.schemaname) if node.authrole: output.swrite('AUTHORIZATION ') output.print_node(node.authrole) if node.schemaElts: output.newline() output.space(2) with output.push_indent(): output.print_list(node.schemaElts, '', standalone_items=True) @node_printer(ast.CreateSeqStmt) def create_seq_stmt(node, output): output.write('CREATE ') if node.sequence.relpersistence == enums.RELPERSISTENCE_TEMP: output.writes('TEMPORARY ') elif node.sequence.relpersistence == enums.RELPERSISTENCE_UNLOGGED: output.writes('UNLOGGED ') output.writes('SEQUENCE') if node.if_not_exists: output.writes('IF NOT EXISTS') if node.sequence.schemaname is not None: output.print_name(node.sequence.schemaname) output.write('.') output.print_name(node.sequence.relname) if node.options: output.newline() output.space(2) with output.push_indent(): output.print_list(node.options, '') @node_printer((ast.Constraint, ast.CreateSeqStmt, ast.AlterSeqStmt), ast.DefElem) def create_seq_stmt_def_elem(node, output): option = node.defname if option == 'cycle': if not node.arg.boolval: output.write('NO ') output.write('CYCLE') elif option == 'increment': output.write('INCREMENT BY ') output.print_node(node.arg) elif option == 'owned_by': output.write('OWNED BY ') output.print_name(node.arg) elif option == 'start': output.write('START WITH ') output.print_node(node.arg) elif option == 'restart': output.write('RESTART') if node.arg: output.write(' WITH ') output.print_node(node.arg) elif option == 'sequence_name': output.write('SEQUENCE NAME ') output.print_name(node.arg) else: if node.arg is None: output.write('NO ') output.write(option.upper()) if node.arg is not None: output.write(' ') output.print_node(node.arg) if node.defaction != enums.DefElemAction.DEFELEM_UNSPEC: # pragma: no cover raise NotImplementedError('Unhandled defaction: %s' % node.defaction) @node_printer(ast.CreateStatsStmt) def create_stats_stmt(node, output): output.write('CREATE STATISTICS ') if node.if_not_exists: output.write('IF NOT EXISTS ') if node.defnames: output.print_name(node.defnames) output.space() if node.stat_types: with output.expression(True): output.print_list(node.stat_types, are_names=True) output.newline() output.space(2) output.write('ON ') output.print_list(node.exprs) output.write(' FROM ') output.print_list(node.relations) @node_printer(ast.CreateStmt) def create_stmt(node, output): output.writes('CREATE') if isinstance(node.ancestors[0], ast.CreateForeignTableStmt): output.writes('FOREIGN') else: if node.relation.relpersistence == enums.RELPERSISTENCE_TEMP: output.writes('TEMPORARY') elif node.relation.relpersistence == enums.RELPERSISTENCE_UNLOGGED: output.writes('UNLOGGED') output.writes('TABLE') if node.if_not_exists: output.writes('IF NOT EXISTS') output.print_node(node.relation) if node.ofTypename: output.write(' OF ') output.print_name(node.ofTypename) if node.partbound: output.write(' PARTITION OF ') output.print_list(node.inhRelations) if node.tableElts: output.write(' ') with output.expression(True): output.newline() output.space(2 if output.comma_at_eoln or len(node.tableElts) == 1 else 4) output.print_list(node.tableElts) output.newline() elif node.partbound: output.newline() output.write(' ') elif not node.ofTypename: output.write(' ()') with output.push_indent(): first = True if node.inhRelations and not node.partbound: output.write(' INHERITS ') with output.expression(True): output.print_list(node.inhRelations) first = False if node.partbound: if first: first = False else: # pragma: no cover output.newline() output.write(' ') output.print_node(node.partbound) if node.partspec: if first: first = False else: output.newline() output.write(' PARTITION BY ') output.print_node(node.partspec) if node.options: if first: first = False else: output.newline() output.write(' WITH ') with output.expression(True): output.print_list(node.options) if node.oncommit != enums.OnCommitAction.ONCOMMIT_NOOP: if first: first = False else: output.newline() output.write(' ON COMMIT ') if node.oncommit == enums.OnCommitAction.ONCOMMIT_PRESERVE_ROWS: output.write('PRESERVE ROWS') elif node.oncommit == enums.OnCommitAction.ONCOMMIT_DELETE_ROWS: output.write('DELETE ROWS') elif node.oncommit == enums.OnCommitAction.ONCOMMIT_DROP: output.write('DROP') if node.tablespacename: if first: first = False else: output.newline() output.write(' TABLESPACE ') output.print_name(node.tablespacename) if node.accessMethod: output.write(' USING ') output.print_name(node.accessMethod) @node_printer(ast.CreateTableAsStmt) def create_table_as_stmt(node, output): output.writes('CREATE') if node.into.rel.relpersistence == enums.RELPERSISTENCE_TEMP: output.writes('TEMPORARY') elif node.into.rel.relpersistence == enums.RELPERSISTENCE_UNLOGGED: output.writes('UNLOGGED') output.writes(OBJECT_NAMES[node.objtype]) if node.if_not_exists: output.writes('IF NOT EXISTS') output.print_node(node.into) output.space(2) output.write('AS ') with output.push_indent(): output.print_node(node.query) if node.into.skipData: output.newline() output.write('WITH NO DATA') @node_printer(ast.CreateTableSpaceStmt) def create_table_space_stmt(node, output): output.write('CREATE TABLESPACE ') output.print_name(node.tablespacename) output.space() if node.owner: output.write('OWNER ') output.print_node(node.owner) output.space() output.write('LOCATION ') output.write_quoted_string(node.location) if node.options: output.write(' WITH ') with output.expression(True): output.print_list(node.options) @node_printer(ast.CreateTrigStmt) def create_trig_stmt(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') if node.isconstraint: output.write('CONSTRAINT ') output.write('TRIGGER ') output.print_name(node.trigname) output.newline() with output.push_indent(2): if node.timing: if node.timing & enums.TRIGGER_TYPE_BEFORE: output.write('BEFORE ') elif node.timing & enums.TRIGGER_TYPE_INSTEAD: output.write('INSTEAD OF ') else: output.write('AFTER ') event_strings = [] for ev in ('INSERT', 'DELETE', 'UPDATE', 'TRUNCATE'): bitmask = getattr(enums, 'TRIGGER_TYPE_%s' % ev) if node.events & bitmask: event_strings.append(ev) output.write(' OR '.join(event_strings)) if node.columns: output.write(' OF ') output.print_list(node.columns, ',', are_names=True) output.newline() output.write('ON ') output.print_node(node.relation) if node.deferrable: output.swrite('DEFERRABLE') if node.initdeferred: output.swrite('INITIALLY DEFERRED') if node.transitionRels: output.swrite('REFERENCING ') output.print_list(node.transitionRels, ' ') if node.constrrel: output.swrite('FROM ') output.print_name(node.constrrel) output.newline() output.write('FOR EACH ') if node.row: output.write('ROW') else: output.write('STATEMENT') output.newline() with output.push_indent(2): if node.whenClause: output.write('WHEN ') with output.expression(True): output.print_node(node.whenClause) output.newline() output.write('EXECUTE PROCEDURE ') output.print_name(node.funcname) with output.expression(True): if node.args: output.print_list(node.args, ',') @node_printer((ast.AlterSubscriptionStmt, ast.CreateSubscriptionStmt), ast.DefElem) def create_subscription_stmt_stmt_def_elem(node, output): output.print_name(node.defname) if node.arg: output.write(' = ') if isinstance(node.arg, ast.String) and node.arg.sval in ('true', 'false'): output.write(node.arg.sval) else: output.print_node(node.arg) @node_printer(ast.CreateSubscriptionStmt) def create_subscription_stmt(node, output): output.write('CREATE SUBSCRIPTION ') output.print_name(node.subname) output.write(' CONNECTION ') if node.conninfo: output.print_node(node.conninfo) else: output.write("''") output.write(' PUBLICATION ') output.print_name(node.publication, ',') output.write(' ') if node.options: output.write('WITH ') with output.expression(True): output.print_name(node.options, ',') @node_printer(ast.CurrentOfExpr) def current_of_expr(node, output): output.write('CURRENT OF ') output.print_name(node.cursor_name) @node_printer(ast.CreateTransformStmt) def create_transform_stmt(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') output.write('TRANSFORM FOR ') output.print_name(node.type_name) output.write('LANGUAGE ') output.print_name(node.lang) output.write(' ') with output.expression(True): output.newline() with output.push_indent(2): if node.fromsql: output.write('FROM SQL WITH FUNCTION ') output.print_node(node.fromsql) if node.tosql: output.write(',') output.newline() if node.tosql: output.write('TO SQL WITH FUNCTION ') output.print_node(node.tosql) @node_printer(ast.ClosePortalStmt) def close_portal_stmt(node, output): output.write('CLOSE ') if node.portalname: output.print_name(node.portalname) else: output.write('ALL') @node_printer(ast.CreateUserMappingStmt) def create_user_mapping_stmt(node, output): output.write('CREATE USER MAPPING ') if node.if_not_exists: output.write('IF NOT EXISTS ') output.write('FOR ') role_spec(node.user, output) output.writes(' SERVER') output.write(node.servername) if node.options: output.write(' OPTIONS ') with output.expression(True): output.print_list(node.options, ',') @node_printer(ast.DeallocateStmt) def deallocate_stmt(node, output): output.write('DEALLOCATE PREPARE ') if node.name: output.print_name(node.name) else: output.write('ALL') @node_printer(ast.DefineStmt) def define_stmt(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') output.writes(OBJECT_NAMES[node.kind]) if node.if_not_exists: output.write('IF NOT EXISTS ') output.print_list(node.defnames, '.', standalone_items=False, are_names=True, is_symbol=node.kind == enums.ObjectType.OBJECT_OPERATOR) if node.args is not None: # args is actually a tuple (list-of-nodes, integer): the integer value, if different # from -1, is the number of nodes representing the actual arguments, remaining are # ORDER BY args, count = node.args count = count.ival output.write(' ') with output.expression(True): if count == -1: # Special case: if it's an aggregate, and the scalar is equal to # None (not is, since it's a Scalar), write a star if ((node.kind == enums.ObjectType.OBJECT_AGGREGATE and args == None)): output.write('*') actual_args = [] orderby_args = [] else: count = len(args) actual_args = args orderby_args = [] else: if count > 0: actual_args = args[:count] else: actual_args = [] # For aggregates, if we have a count != -1 BUT we don't have an arg # for that, add the last arg as an order by arg. if count == len(args): orderby_args = actual_args[-1:] else: orderby_args = args[count:] if actual_args: output.print_list(actual_args, standalone_items=False) if orderby_args: output.write(' ORDER BY ') output.print_list(orderby_args, standalone_items=False) output.write(' ') if ((node.kind == enums.ObjectType.OBJECT_COLLATION and len(node.definition) == 1 and node.definition[0].defname == 'from')): output.write('FROM ') output.print_name(node.definition[0].arg) else: if node.definition: with output.expression(True): output.newline() output.space(2 if output.comma_at_eoln or len(node.definition) == 1 else 4) output.print_list(node.definition) output.newline() @node_printer(ast.DefElem) def def_elem(node, output): output.print_symbol(node.defname) if node.arg is not None: output.write(' = ') output.print_node(node.arg) if node.defaction != enums.DefElemAction.DEFELEM_UNSPEC: # pragma: no cover raise NotImplementedError('Unhandled defaction: %s' % node.defaction) @node_printer(ast.DefineStmt, ast.DefElem) def define_stmt_def_elem(node, output): output.print_name(node.defname) if node.arg is not None: output.write(' = ') if isinstance(node.arg, tuple): is_symbol = node.defname in ('commutator', 'negator') if is_symbol and len(node.arg) > 1: output.write('OPERATOR') with output.expression(True): output.print_symbol(node.arg) else: output.print_symbol(node.arg) else: output.print_node(node.arg) if node.defaction != enums.DefElemAction.DEFELEM_UNSPEC: # pragma: no cover raise NotImplementedError('Unhandled defaction: %s' % node.defaction) class DiscardModePrinter(IntEnumPrinter): enum = enums.DiscardMode def DISCARD_ALL(self, node, output): output.write('ALL') def DISCARD_PLANS(self, node, output): output.write('PLANS') def DISCARD_SEQUENCES(self, node, output): output.write('SEQUENCES') def DISCARD_TEMP(self, node, output): output.write('TEMP') discard_mode_printer = DiscardModePrinter() @node_printer(ast.DiscardStmt) def discard_stmt(node, output): output.write('DISCARD ') discard_mode_printer(node.target, node, output) @node_printer(ast.DoStmt) def do_stmt(node, output): output.write('DO ') output.print_list(node.args, sep=' ', standalone_items=True) @node_printer(ast.DropdbStmt) def drop_db_stmt(node, output): output.write('DROP DATABASE') if node.missing_ok: output.write(' IF EXISTS') output.write(' ') output.print_name(node.dbname) if node.options: output.write(' ') with output.expression(True): output.print_list(node.options) @node_printer(ast.DropOwnedStmt) def drop_owned_stmt(node, output): output.write('DROP OWNED BY ') output.print_list(node.roles, are_names=True) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') elif node.behavior == enums.DropBehavior.DROP_RESTRICT: output.write(' RESTRICT') @node_printer(ast.DropRoleStmt) def drop_role_stmt(node, output): output.write('DROP ROLE') if node.missing_ok: output.write(' IF EXISTS') output.write(' ') output.print_list(node.roles, are_names=True) @node_printer(ast.DropStmt) def drop_stmt(node, output): otypes = enums.ObjectType output.write('DROP ') # Special case functions since they are not special objects output.writes(OBJECT_NAMES[node.removeType]) if node.removeType == otypes.OBJECT_INDEX: if node.concurrent: output.write(' CONCURRENTLY') if node.missing_ok: output.write(' IF EXISTS') output.write(' ') if node.objects: if node.removeType in (otypes.OBJECT_OPCLASS, otypes.OBJECT_OPFAMILY): nodes = list(node.objects[0]) using = nodes.pop(0) output.print_name(nodes) output.write(' USING ') output.print_name(using) elif node.removeType == otypes.OBJECT_TRANSFORM: nodes = list(node.objects[0]) output.write('FOR ') output.print_name(nodes.pop(0)) output.write(' LANGUAGE ') output.print_name(nodes) elif node.removeType in (otypes.OBJECT_POLICY, otypes.OBJECT_RULE, otypes.OBJECT_TRIGGER): nodes = list(node.objects[0]) on = nodes[:-1] output.print_name(nodes[-1]) output.write(' ON ') output.print_name(on) elif node.removeType == otypes.OBJECT_CAST: names = node.objects[0] with output.expression(True): output.print_name(names[0]) output.write(' AS ') output.print_name(names[1]) elif isinstance(node.objects[0], tuple): output.print_lists(node.objects, sep='.', sublist_open='', sublist_close='', standalone_items=False, are_names=True) else: output.print_list(node.objects, ',', standalone_items=False, are_names=True) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.swrite('CASCADE') @node_printer(ast.DropSubscriptionStmt) def drop_subscription_stmt(node, output): output.write('DROP SUBSCRIPTION') if node.missing_ok: output.write(' IF EXISTS') output.write(' ') output.print_name(node.subname) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') elif node.behavior == enums.DropBehavior.DROP_RESTRICT: output.write(' RESTRICT') @node_printer(ast.DropTableSpaceStmt) def drop_table_space_stmt(node, output): output.write('DROP TABLESPACE') if node.missing_ok: output.write(' IF EXISTS') output.write(' ') output.print_name(node.tablespacename) @node_printer(ast.DropUserMappingStmt) def drop_user_mapping_stmt(node, output): output.write('DROP USER MAPPING') if node.missing_ok: output.write(' IF EXISTS') output.write(' FOR ') output.print_node(node.user) output.write(' SERVER ') output.print_name(node.servername) @node_printer(ast.FunctionParameter) def function_parameter(node, output): if node.mode is not None: pm = enums.FunctionParameterMode if node.mode == pm.FUNC_PARAM_DEFAULT: pass # omit the default elif node.mode == pm.FUNC_PARAM_IN: output.write('IN ') elif node.mode == pm.FUNC_PARAM_OUT: output.write('OUT ') elif node.mode == pm.FUNC_PARAM_INOUT: output.write('INOUT ') elif node.mode == pm.FUNC_PARAM_VARIADIC: output.write('VARIADIC ') elif node.mode == pm.FUNC_PARAM_TABLE: pass # function output column else: # pragma: no cover raise NotImplementedError('Unhandled mode: %s' % node.mode) if node.name: output.print_name(node.name) output.write(' ') output.print_node(node.argType) if node.defexpr is not None: output.write(' = ') output.print_node(node.defexpr) @node_printer(ast.GrantStmt) def grant_stmt(node, output): if node.is_grant: output.write('GRANT ') preposition = 'TO' else: output.write('REVOKE ') preposition = 'FROM' if not node.is_grant and node.grant_option: output.write('GRANT OPTION FOR ') if node.privileges: output.print_list(node.privileges) else: output.write('ALL PRIVILEGES') # hack for OBJECT_FOREIGN_SERVER if node.objtype == enums.ObjectType.OBJECT_FOREIGN_SERVER: object_name = 'FOREIGN SERVER' else: object_name = OBJECT_NAMES[node.objtype] target = node.targtype output.newline() output.space(2) with output.push_indent(): if target == enums.GrantTargetType.ACL_TARGET_OBJECT: output.write('ON ') output.writes(object_name) elif target == enums.GrantTargetType.ACL_TARGET_ALL_IN_SCHEMA: output.write('ON ALL ') output.write(object_name) output.writes('S IN SCHEMA') output.print_list(node.objects, are_names=True) output.newline() output.write(preposition) output.space() output.print_list(node.grantees, are_names=True) if node.is_grant and node.grant_option: output.newline() output.write('WITH GRANT OPTION') if node.grantor: output.newline() output.write('GRANTED BY ') output.print_node(node.grantor) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') @node_printer(ast.GrantRoleStmt) def grant_role_stmt(node, output): if node.is_grant: output.write('GRANT ') preposition = 'TO' else: output.write('REVOKE ') preposition = 'FROM' if node.opt: output.write(node.opt[0].defname.upper()) output.write(' OPTION FOR ') output.print_list(node.granted_roles, ',') output.write(' ') output.write(preposition) output.write(' ') output.print_list(node.grantee_roles, ',') if node.is_grant: if node.opt: output.write(' WITH ') output.print_list(node.opt, ',') if node.grantor: output.write(' GRANTED BY ') output.print_node(node.grantor) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') @node_printer(ast.GrantRoleStmt, ast.DefElem) def grant_role_stmt_opt(node, output): output.write(node.defname.upper()) output.write(' OPTION' if node.arg.boolval else ' FALSE') @node_printer(ast.ImportForeignSchemaStmt) def import_foreign_schema_stmt(node, output): output.write('IMPORT FOREIGN SCHEMA ') output.print_name(node.remote_schema) if node.list_type == enums.ImportForeignSchemaType.FDW_IMPORT_SCHEMA_ALL: pass elif node.list_type == enums.ImportForeignSchemaType.FDW_IMPORT_SCHEMA_LIMIT_TO: output.write(' LIMIT TO ') with output.expression(True): output.print_list(node.table_list) elif node.list_type == enums.ImportForeignSchemaType.FDW_IMPORT_SCHEMA_EXCEPT: output.write(' EXCEPT ') with output.expression(True): output.print_list(node.table_list) output.writes(' FROM SERVER ') output.print_name(node.server_name) output.writes(' INTO ') output.print_name(node.local_schema) alter_def_elem(node.options, output) @node_printer(ast.IndexStmt) def index_stmt(node, output): output.write('CREATE ') if node.unique: output.write('UNIQUE ') output.write('INDEX ') if node.concurrent: output.write('CONCURRENTLY ') if node.if_not_exists: output.write('IF NOT EXISTS ') if node.idxname: output.print_name(node.idxname) output.newline() with output.push_indent(2): output.write('ON ') output.print_node(node.relation) if node.accessMethod != 'btree': output.write('USING ') output.print_name(node.accessMethod) output.write(' ') with output.expression(True): output.print_list(node.indexParams) if node.indexIncludingParams: output.write(' INCLUDE ') with output.expression(True): output.print_list(node.indexIncludingParams) if node.options: output.newline() output.write('WITH ') with output.expression(True): output.print_list(node.options) if node.tableSpace: output.newline() output.write('TABLESPACE ') output.print_name(node.tableSpace) if node.whereClause: output.newline() output.write('WHERE ') output.print_node(node.whereClause) if node.nulls_not_distinct: output.newline() output.write('NULLS NOT DISTINCT') @node_printer(ast.LoadStmt) def load_stmt(node, output): output.write('LOAD ') output.write_quoted_string(node.filename) LOCK_MODE_NAMES = { enums.AccessShareLock: 'ACCESS SHARE', enums.RowShareLock: 'ROW SHARE', enums.RowExclusiveLock: 'ROW EXCLUSIVE', enums.ShareUpdateExclusiveLock: 'SHARE UPDATE EXCLUSIVE', enums.ShareLock: 'SHARE', enums.ShareRowExclusiveLock: 'SHARE ROW EXCLUSIVE', enums.ExclusiveLock: 'EXCLUSIVE', enums.AccessExclusiveLock: 'ACCESS EXCLUSIVE' } @node_printer(ast.LockStmt) def lock_stmt(node, output): output.write('LOCK ') output.print_list(node.relations, ',') lock_mode = node.mode lock_str = LOCK_MODE_NAMES[lock_mode] output.write('IN ') output.write(lock_str) output.write(' MODE') if node.nowait: output.write(' NOWAIT') @node_printer(ast.NotifyStmt) def notify_stmt(node, output): output.write('NOTIFY ') output.print_name(node.conditionname) if node.payload: output.write(', ') output.write_quoted_string(node.payload) def _object_with_args(node, output, unquote_name=False, symbol=False, skip_empty_args=False, empty_placeholder=''): # Special treatment for OPERATOR object inside DROP or COMMENT if unquote_name: if len(node.objname) > 1: for idx, name in enumerate(node.objname): if idx > 0: output.write('.') output.write(name.sval) else: output.write(get_string_value(node.objname)) elif symbol: output.print_symbol(node.objname) else: output.print_name(node.objname) if not node.args_unspecified: args = node.objfuncargs or node.objargs if args: output.write(' ') with output.expression(True): output.print_list(args, ',', standalone_items=False) elif not skip_empty_args: output.write(' ') with output.expression(True): output.write(empty_placeholder) @node_printer(ast.ObjectWithArgs) def object_with_args(node, output): _object_with_args(node, output) @node_printer((ast.AlterObjectSchemaStmt,), ast.ObjectWithArgs) def alter_object_schema_stmt_object_with_args(node, output): symbol = abs(node.ancestors).node.objectType == enums.ObjectType.OBJECT_OPERATOR _object_with_args(node, output, symbol=symbol) @node_printer((ast.AlterOperatorStmt,), ast.ObjectWithArgs) def alter_operator_stmt_object_with_args(node, output): _object_with_args(node, output, unquote_name=True) @node_printer((ast.AlterOwnerStmt,), ast.ObjectWithArgs) def alter_owner_stmt_object_with_args(node, output): unquote_name = abs(node.ancestors).node.objectType == enums.ObjectType.OBJECT_OPERATOR _object_with_args(node, output, unquote_name=unquote_name) @node_printer((ast.CommentStmt,), ast.ObjectWithArgs) def comment_stmt_object_with_args(node, output): unquote_name = abs(node.ancestors).node.objtype == enums.ObjectType.OBJECT_OPERATOR _object_with_args(node, output, unquote_name=unquote_name) @node_printer((ast.DropStmt,), ast.ObjectWithArgs) def drop_stmt_object_with_args(node, output): parent_node = abs(node.ancestors).node unquote_name = parent_node.removeType == enums.ObjectType.OBJECT_OPERATOR if parent_node.removeType == enums.ObjectType.OBJECT_AGGREGATE: _object_with_args(node, output, empty_placeholder='*', unquote_name=unquote_name) else: _object_with_args(node, output, unquote_name=unquote_name) @node_printer(ast.PartitionBoundSpec) def partition_bound_spec(node, output): if node.is_default: output.write('DEFAULT') else: output.write('FOR VALUES ') if node.strategy == enums.PartitionStrategy.PARTITION_STRATEGY_RANGE: output.swrite('FROM ') with output.expression(True): output.print_list(node.lowerdatums) output.write(' TO ') with output.expression(True): output.print_list(node.upperdatums) elif node.strategy == enums.PartitionStrategy.PARTITION_STRATEGY_LIST: output.write('IN ') with output.expression(True): output.print_list(node.listdatums) elif node.strategy == enums.PartitionStrategy.PARTITION_STRATEGY_HASH: output.write('WITH (MODULUS %d, REMAINDER %d)' % (node.modulus, node.remainder)) else: raise NotImplementedError('Unhandled strategy %r' % node.strategy) @node_printer(ast.PartitionCmd) def partition_cmd(node, output): output.print_node(node.name, is_name=True) if node.bound: output.print_node(node.bound) if node.concurrent: output.swrite('CONCURRENTLY') @node_printer(ast.PartitionElem) def partition_elem(node, output): if node.name: output.print_name(node.name) elif node.expr: with output.expression(True): output.print_node(node.expr) if node.collation: output.swrite('COLLATE ') output.print_list(node.collation, are_names=True) if node.opclass: output.print_name(node.opclass) @node_printer(ast.PartitionRangeDatum) def partition_range_datum(node, output): # FIXME: find a way to get here, apparently these have been replaced by ColumRef if node.kind == enums.PartitionRangeDatumKind.PARTITION_RANGE_DATUM_MINVALUE: output.write('MINVALUE') elif node.kind == enums.PartitionRangeDatumKind.PARTITION_RANGE_DATUM_MAXVALUE: output.write('MAXVALUE') else: output.print_node(node) @node_printer(ast.PartitionSpec) def partition_spec(node, output): strategy = { enums.PartitionStrategy.PARTITION_STRATEGY_LIST: 'list', enums.PartitionStrategy.PARTITION_STRATEGY_RANGE: 'range', enums.PartitionStrategy.PARTITION_STRATEGY_HASH: 'hash', }[node.strategy] output.print_symbol(strategy) output.write(' ') with output.expression(True): output.print_list(node.partParams) class PublicationObjSpecTypePrinter(IntEnumPrinter): enum = enums.PublicationObjSpecType def PUBLICATIONOBJ_TABLE(self, node, output): output.write('TABLE ') with output.push_indent(): output.print_node(node.pubtable) def PUBLICATIONOBJ_TABLES_IN_SCHEMA(self, node, output): output.write('TABLES IN SCHEMA ') output.print_name(node.name) def PUBLICATIONOBJ_TABLES_IN_CUR_SCHEMA(self, node, output): output.write('TABLES IN SCHEMA CURRENT_SCHEMA') publication_obj_spec_type_printer = PublicationObjSpecTypePrinter() @node_printer(ast.PublicationObjSpec) def publication_obj_spec(node, output): publication_obj_spec_type_printer(node.pubobjtype, node, output) @node_printer(ast.PublicationTable) def publication_table(node, output): output.print_node(node.relation) if node.columns: output.space() with output.expression(True): output.print_list(node.columns, ',', are_names=True) if node.whereClause: output.newline() output.write('WHERE ') with output.expression(True): output.print_node(node.whereClause) class ReindexKindPrinter(IntEnumPrinter): enum = enums.ReindexObjectType def REINDEX_OBJECT_DATABASE(self, node, output): output.write('DATABASE') if node.name: output.write(' ') output.print_name(node.name) def REINDEX_OBJECT_INDEX(self, node, output): output.write('INDEX ') output.print_node(node.relation) def REINDEX_OBJECT_TABLE(self, node, output): output.write('TABLE ') output.print_node(node.relation) def REINDEX_OBJECT_SCHEMA(self, node, output): output.write('SCHEMA ') output.print_name(node.name) def REINDEX_OBJECT_SYSTEM(self, node, output): output.write('SYSTEM') if node.name: output.write(' ') output.print_name(node.name) reindex_kind_printer = ReindexKindPrinter() @node_printer(ast.ReindexStmt) def reindex_stmt(node, output): output.write('REINDEX ') if node.params: with output.expression(True): output.print_list(node.params, ',') output.write(' ') reindex_kind_printer(node.kind, node, output) @node_printer(ast.ReindexStmt, ast.DefElem) def reindex_stmt_def_elem(node, output): output.write(node.defname.upper()) if node.arg: argv = node.arg.sval if argv == 'false': output.swrite('FALSE') elif argv == 'true': output.swrite('TRUE') else: output.write(' ') output.print_node(node.arg) @node_printer(ast.RenameStmt) def rename_stmt(node, output): OT = enums.ObjectType objtype = node.renameType output.write('ALTER ') if objtype == OT.OBJECT_TABCONSTRAINT: output.write('TABLE') elif objtype == OT.OBJECT_DOMCONSTRAINT: output.write('DOMAIN') elif objtype == OT.OBJECT_ROLE: output.write('ROLE') else: output.write(OBJECT_NAMES[node.relationType if objtype in (OT.OBJECT_ATTRIBUTE, OT.OBJECT_COLUMN) else objtype]) output.write(' ') if node.missing_ok: output.write('IF EXISTS ') if objtype in (OT.OBJECT_SCHEMA, OT.OBJECT_DATABASE, OT.OBJECT_ROLE, OT.OBJECT_TABLESPACE): output.print_name(node.subname) elif objtype in (OT.OBJECT_RULE, OT.OBJECT_POLICY, OT.OBJECT_TRIGGER): output.print_name(node.subname) output.write(' ON ') output.print_node(node.relation) elif node.relation: output.print_node(node.relation) elif objtype in (OT.OBJECT_OPFAMILY, OT.OBJECT_OPCLASS): method, *name = node.object output.print_name(name) output.write(' USING ') output.print_symbol(method) else: output.print_name(node.object) output.write(' RENAME ') if objtype == OT.OBJECT_COLUMN: output.write('COLUMN ') output.print_name(node.subname) elif objtype == OT.OBJECT_TABCONSTRAINT: output.write('CONSTRAINT ') output.print_name(node.subname) elif objtype == OT.OBJECT_ATTRIBUTE: output.write('ATTRIBUTE ') output.print_name(node.subname) elif objtype == OT.OBJECT_DOMCONSTRAINT: output.writes('CONSTRAINT') output.print_name(node.subname) output.swrite('TO ') output.print_name(node.newname) if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') @node_printer(ast.RenameStmt, ast.RangeVar) def rename_stmt_range_var(node, output): OT = enums.ObjectType if not node.inh and abs(node.ancestors).node.renameType not in (OT.OBJECT_ATTRIBUTE, OT.OBJECT_TYPE): output.write('ONLY ') if node.schemaname: output.print_name(node.schemaname) output.write('.') output.print_name(node.relname) alias = node.alias if alias: # FIXME: find a way to get here output.write(' AS ') output.print_name(alias) @node_printer(ast.ReplicaIdentityStmt) def replica_identity_stmt(node, output): output.write('REPLICA IDENTITY ') if node.identity_type == enums.REPLICA_IDENTITY_INDEX: output.write('USING INDEX ') output.print_name(node.name) elif node.identity_type == enums.REPLICA_IDENTITY_DEFAULT: output.write('DEFAULT') elif node.identity_type == enums.REPLICA_IDENTITY_FULL: output.write('FULL') elif node.identity_type == enums.REPLICA_IDENTITY_NOTHING: output.write('NOTHING') @node_printer(ast.RoleSpec) def role_spec(node, output): if node.roletype == enums.RoleSpecType.ROLESPEC_CURRENT_USER: output.write('CURRENT_USER') elif node.roletype == enums.RoleSpecType.ROLESPEC_SESSION_USER: output.write('SESSION_USER') elif node.roletype == enums.RoleSpecType.ROLESPEC_PUBLIC: output.write('PUBLIC') elif node.roletype == enums.RoleSpecType.ROLESPEC_CURRENT_ROLE: output.write('CURRENT_ROLE') else: output.print_name(node.rolename) EVENT_NAMES = { enums.CmdType.CMD_SELECT: 'SELECT', enums.CmdType.CMD_UPDATE: 'UPDATE', enums.CmdType.CMD_INSERT: 'INSERT', enums.CmdType.CMD_DELETE: 'DELETE', } @node_printer(ast.RuleStmt) def rule_stmt_printer(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') output.write('RULE ') output.print_name(node.rulename) output.write(' AS') output.newline() with output.push_indent(2): output.write('ON ') output.write(EVENT_NAMES[node.event]) output.write(' TO ') output.print_name(node.relation) if node.whereClause: output.newline() output.write('WHERE ') output.print_node(node.whereClause) output.newline() output.write('DO ') if node.instead: output.write('INSTEAD') else: output.writes('ALSO') if node.actions: if len(node.actions) > 1: output.write(' ') with output.expression(True): output.newline() with output.push_indent(2): output.space(2) output.print_list(node.actions, ';', standalone_items=True) output.newline() else: output.space() with output.push_indent(): output.print_list(node.actions) else: output.write(' NOTHING') @node_printer(ast.RefreshMatViewStmt) def refresh_mat_view_stmt(node, output): output.write('REFRESH MATERIALIZED VIEW ') if node.concurrent: output.write('CONCURRENTLY ') output.print_node(node.relation) if node.skipData: output.write('WITH NO DATA') @node_printer(ast.ReassignOwnedStmt) def reassign_owned_stmt(node, output): output.write('REASSIGN OWNED BY ') output.print_list(node.roles, ',', are_names=False) output.write(' TO ') output.print_node(node.newrole) @node_printer(ast.ReturnStmt) def return_stmt(node, output): output.write('RETURN ') output.print_node(node.returnval) @node_printer(ast.SecLabelStmt) def sec_label_stmt(node, output): output.write('SECURITY LABEL ') if node.provider: output.write('FOR ') output.print_name(node.provider) output.write(' ON ') output.write(OBJECT_NAMES[node.objtype]) output.write(' ') output.print_name(node.object) output.write(' IS ') if node.label: output.print_node(node.label) else: output.write('NULL') @node_printer(ast.StatsElem) def stats_elem(node, output): if node.name: output.print_name(node.name) else: with output.expression(True): output.print_node(node.expr) @node_printer(ast.TableLikeClause) def table_like_clause(node, output): output.write('LIKE ') output.print_node(node.relation) TLO = enums.TableLikeOption if node.options == TLO.CREATE_TABLE_LIKE_ALL: output.write(' INCLUDING ALL') else: if node.options & TLO.CREATE_TABLE_LIKE_COMMENTS: output.write(' INCLUDING COMMENTS') if node.options & TLO.CREATE_TABLE_LIKE_COMPRESSION: output.write(' INCLUDING COMPRESSION') if node.options & TLO.CREATE_TABLE_LIKE_CONSTRAINTS: output.write(' INCLUDING CONSTRAINTS') if node.options & TLO.CREATE_TABLE_LIKE_DEFAULTS: output.write(' INCLUDING DEFAULTS') if node.options & TLO.CREATE_TABLE_LIKE_IDENTITY: output.write(' INCLUDING IDENTITY') if node.options & TLO.CREATE_TABLE_LIKE_GENERATED: output.write(' INCLUDING GENERATED') if node.options & TLO.CREATE_TABLE_LIKE_INDEXES: output.write(' INCLUDING INDEXES') if node.options & TLO.CREATE_TABLE_LIKE_STATISTICS: output.write(' INCLUDING STATISTICS') if node.options & TLO.CREATE_TABLE_LIKE_STORAGE: output.write(' INCLUDING STORAGE') @node_printer(ast.TriggerTransition) def trigger_transition(node, output): if node.isNew: output.write('NEW TABLE AS ') else: output.write('OLD TABLE AS ') output.print_name(node.name) @node_printer(ast.VacuumStmt) def vacuum_stmt(node, output): if node.is_vacuumcmd: output.write('VACUUM ') else: output.write('ANALYZE ') if node.options: with output.expression(True): output.print_list(node.options, ',') if node.rels: output.space() output.print_list(node.rels, ',') @node_printer(ast.VacuumStmt, ast.DefElem) def vacuum_stmt_def_elem(node, output): output.write(node.defname.upper()) if node.arg: output.write(' ') if isinstance(node.arg, ast.Integer): output.write(str(node.arg.ival)) elif isinstance(node.arg, ast.Float): output.write(node.arg.fval) else: output.write(f"'{node.arg.sval}'") @node_printer(ast.VacuumRelation) def vacuum_relation(node, output): output.print_node(node.relation) if node.va_cols: with output.expression(True): output.print_list(node.va_cols, ',', are_names=True) def print_transaction_mode_list(node, output): first = True for elem in node: if first: first = False else: output.write(', ') if elem.defname == 'transaction_isolation': output.write('ISOLATION LEVEL ') ilevel = elem.arg.val.sval if ilevel == 'read uncommitted': output.write('READ UNCOMMITTED') elif ilevel == 'read committed': output.write('READ COMMITTED') elif ilevel == 'repeatable read': output.write('REPEATABLE READ') elif ilevel == 'serializable': output.write('SERIALIZABLE') elif elem.defname == 'transaction_read_only': ronly = elem.arg.val.ival output.write('READ ONLY' if ronly else 'READ WRITE') elif elem.defname == 'transaction_deferrable': defer = elem.arg.val.ival output.write('DEFERRABLE' if defer else 'NOT DEFERRABLE') class VariableSetKindPrinter(IntEnumPrinter): enum = enums.VariableSetKind def _set_prologue(self, node, output): output.write('SET ') if node.is_local: output.write('LOCAL ') def VAR_SET_VALUE(self, node, output): self._set_prologue(node, output) if node.name == 'timezone': output.write('TIME ZONE ') else: output.print_name(node.name.split('.')) output.write(' TO ') output.print_list(node.args) def VAR_SET_DEFAULT(self, node, output): self._set_prologue(node, output) output.print_name(node.name.split('.')) output.write(' TO DEFAULT') def VAR_SET_CURRENT(self, node, output): self._set_prologue(node, output) output.print_name(node.name.split('.')) output.write(' FROM CURRENT') def VAR_SET_MULTI(self, node, output): self._set_prologue(node, output) if node.name == 'TRANSACTION': output.write('TRANSACTION ') print_transaction_mode_list(node.args, output) elif node.name == 'SESSION CHARACTERISTICS': output.write('SESSION CHARACTERISTICS AS TRANSACTION ') print_transaction_mode_list(node.args, output) elif node.name == 'TRANSACTION SNAPSHOT': output.write('TRANSACTION SNAPSHOT ') output.print_list(node.args, ',') def VAR_RESET(self, node, output): output.write('RESET ') output.print_name(node.name.split('.')) def VAR_RESET_ALL(self, node, output): output.write('RESET ALL') variable_set_kind_printer = VariableSetKindPrinter() @node_printer(ast.VariableSetStmt) def variable_set_stmt(node, output): variable_set_kind_printer(node.kind, node, output) @node_printer(ast.VariableShowStmt) def variable_show_statement(node, output): output.write('SHOW ') if node.name == 'all': output.write('ALL') else: output.print_name(node.name.split('.')) class ViewCheckOptionPrinter(IntEnumPrinter): enum = enums.ViewCheckOption def NO_CHECK_OPTION(self, node, output): pass def LOCAL_CHECK_OPTION(self, node, output): output.write(' WITH LOCAL CHECK OPTION') def CASCADED_CHECK_OPTION(self, node, output): output.write(' WITH CHECK OPTION') view_check_option_printer = ViewCheckOptionPrinter() @node_printer(ast.ViewStmt) def view_stmt(node, output): output.write('CREATE ') if node.replace: output.write('OR REPLACE ') if node.view.relpersistence == enums.RELPERSISTENCE_TEMP: output.write('TEMPORARY ') elif node.view.relpersistence == enums.RELPERSISTENCE_UNLOGGED: output.write('UNLOGGED ') output.write('VIEW ') output.print_node(node.view) if node.aliases: output.write(' ') with output.expression(True): output.print_list(node.aliases, are_names=True) output.newline() output.space(2) if node.options: output.write('WITH ') with output.expression(True): output.print_list(node.options) output.newline() output.space(2) output.write('AS ') with output.push_indent(): output.print_node(node.query) view_check_option_printer(node.withCheckOption, node, output) @node_printer(ast.ViewStmt, ast.DefElem) def view_stmt_def_elem(node, output): output.print_symbol(node.defname) if node.arg: output.write(' = ') output.print_symbol(node.arg) if node.defaction: if node.defaction != enums.DefElemAction.DEFELEM_UNSPEC: # pragma: no cover raise NotImplementedError('Unhandled defaction: %s' % node.defaction) pglast-7.7/pglast/printers/dml.py000066400000000000000000002317771477366773500172210ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Printer functions for SQL DML nodes # :Created: sab 05 ago 2017 16:34:08 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax # from .. import ast, enums from ..parser import LONG_MAX from . import IntEnumPrinter, get_string_value, node_printer @node_printer(ast.A_ArrayExpr) def a_array_expr(node, output): output.write('ARRAY[') if node.elements: output.print_list(node.elements) output.write(']') @node_printer(ast.A_Const) def a_const(node, output): if node.isnull: output.write('NULL') else: output.print_node(node.val) class AExprKindPrinter(IntEnumPrinter): enum = enums.A_Expr_Kind def AEXPR_BETWEEN(self, node, output): output.print_node(node.lexpr) output.swrite('BETWEEN ') output.print_list(node.rexpr, 'AND', relative_indent=-4) def AEXPR_BETWEEN_SYM(self, node, output): output.print_node(node.lexpr) output.swrite('BETWEEN SYMMETRIC ') output.print_list(node.rexpr, 'AND', relative_indent=-4) def AEXPR_DISTINCT(self, node, output): with output.expression(isinstance(node.lexpr, (ast.BoolExpr, ast.NullTest, ast.A_Expr))): output.print_node(node.lexpr) output.swrite('IS DISTINCT FROM ') with output.expression(isinstance(node.rexpr, (ast.BoolExpr, ast.NullTest, ast.A_Expr))): output.print_node(node.rexpr) def AEXPR_ILIKE(self, node, output): output.print_node(node.lexpr) if get_string_value(node.name) == '!~~*': output.swrites('NOT') output.swrite('ILIKE ') output.print_node(node.rexpr) def AEXPR_IN(self, node, output): output.print_node(node.lexpr) if get_string_value(node.name) == '<>': output.swrites('NOT') output.swrite('IN ') with output.expression(True): output.print_list(node.rexpr) def AEXPR_LIKE(self, node, output): output.print_node(node.lexpr) if get_string_value(node.name) == '!~~': output.swrites('NOT') output.swrite('LIKE ') output.print_node(node.rexpr) def AEXPR_NOT_BETWEEN(self, node, output): output.print_node(node.lexpr) output.swrite('NOT BETWEEN ') output.print_list(node.rexpr, 'AND', relative_indent=-4) def AEXPR_NOT_BETWEEN_SYM(self, node, output): output.print_node(node.lexpr) output.swrite('NOT BETWEEN SYMMETRIC ') output.print_list(node.rexpr, 'AND', relative_indent=-4) def AEXPR_NOT_DISTINCT(self, node, output): output.print_node(node.lexpr) output.swrite('IS NOT DISTINCT FROM ') output.print_node(node.rexpr) def AEXPR_NULLIF(self, node, output): output.write('NULLIF') with output.expression(True): output.print_list((node.lexpr, node.rexpr)) def AEXPR_OP(self, node, output): with output.expression(isinstance(abs(node.ancestors), ast.A_Expr)): # lexpr is optional because these are valid: -(1+1), +(1+1), ~(1+1) if node.lexpr is not None: with output.expression(isinstance(node.lexpr, (ast.BoolExpr, ast.NullTest, ast.A_Expr))): output.print_node(node.lexpr) output.write(' ') if isinstance(node.name, tuple) and len(node.name) > 1: output.write('OPERATOR') with output.expression(True): output.print_symbol(node.name) else: output.print_symbol(node.name) output.write(' ') if node.rexpr is not None: with output.expression(isinstance(node.rexpr, (ast.BoolExpr, ast.NullTest, ast.A_Expr))): output.print_node(node.rexpr) def AEXPR_OP_ALL(self, node, output): output.print_node(node.lexpr) output.write(' ') output.write(get_string_value(node.name)) output.write(' ALL') with output.expression(True): output.print_node(node.rexpr) def AEXPR_OP_ANY(self, node, output): output.print_node(node.lexpr) output.write(' ') output.write(get_string_value(node.name)) output.write(' ANY') with output.expression(True): output.print_node(node.rexpr) def AEXPR_SIMILAR(self, node, output): output.print_node(node.lexpr) if get_string_value(node.name) == '!~': output.swrites('NOT') output.swrite('SIMILAR TO ') if ((not isinstance(node.rexpr, ast.FuncCall) or node.rexpr.funcname[1].sval != 'similar_to_escape')): # pragma: no cover raise RuntimeError('Expected a FuncCall to "similar_to_escape", got %r', node.rexpr) pattern = node.rexpr.args[0] output.print_node(pattern) if len(node.rexpr.args) > 1: output.swrite('ESCAPE ') output.print_node(node.rexpr.args[1]) a_expr_kind_printer = AExprKindPrinter() @node_printer(ast.A_Expr) def a_expr(node, output): a_expr_kind_printer(node.kind, node, output) @node_printer(ast.A_Indices) def a_indices(node, output): output.write('[') if node.is_slice: if node.lidx: output.print_node(node.lidx) output.write(':') if node.uidx: output.print_node(node.uidx) else: output.print_node(node.uidx) output.write(']') @node_printer(ast.A_Indirection) def a_indirection(node, output): with output.expression(isinstance(node.arg, (ast.A_ArrayExpr, ast.A_Expr, ast.FuncCall, ast.A_Indirection, ast.JsonFuncExpr, ast.RowExpr, ast.TypeCast)) or (isinstance(node.arg, ast.ColumnRef) and not isinstance(node.indirection[0], ast.A_Indices))): output.print_node(node.arg) output.print_list(node.indirection, '', standalone_items=False) @node_printer(ast.A_Indirection, ast.A_Star) def a_indirection_a_star(node, output): output.pending_separator = False output.write('.') a_star(node, output) @node_printer(ast.A_Indirection, ast.ColumnRef) def a_indirection_column_ref(node, output): with output.expression(True): column_ref(node, output) @node_printer(ast.A_Indirection, ast.FuncCall) def a_indirection_func_call(node, output): with output.expression(True): func_call(node, output) @node_printer(ast.A_Indirection, ast.String) def a_indirection_field(node, output): output.write('.') string(node, output, is_name=True) @node_printer(ast.A_Star) def a_star(node, output): output.write('*') @node_printer(ast.Alias) def alias(node, output): output.print_name(node.aliasname) if node.colnames: output.write(' ') with output.expression(True): output.print_name(node.colnames, sep=',') @node_printer(ast.BitString) def bitstring(node, output): value = node.bsval output.write(f"{value[0]}'{value[1:]}'") @node_printer(ast.Boolean) def boolean(node, output): output.write('TRUE' if node.boolval else 'FALSE') def _bool_expr_needs_to_be_wrapped_in_parens(node): bet = enums.BoolExprType return isinstance(node, ast.BoolExpr) and node.boolop in (bet.AND_EXPR, bet.OR_EXPR) @node_printer(ast.BoolExpr) def bool_expr(node, output): bet = enums.BoolExprType in_res_target = isinstance(node.ancestors[0], ast.ResTarget) if node.boolop == bet.AND_EXPR: relindent = -4 if not in_res_target else None output.print_list(node.args, 'AND', relative_indent=relindent, item_needs_parens=_bool_expr_needs_to_be_wrapped_in_parens) elif node.boolop == bet.OR_EXPR: relindent = -3 if not in_res_target else None output.print_list(node.args, 'OR', relative_indent=relindent, item_needs_parens=_bool_expr_needs_to_be_wrapped_in_parens) else: output.writes('NOT') with output.expression(_bool_expr_needs_to_be_wrapped_in_parens(node.args[0])): output.print_node(node.args[0]) class BooleanTestPrinter(IntEnumPrinter): enum = enums.BoolTestType def IS_FALSE(self, node, output): output.write('FALSE') def IS_NOT_FALSE(self, node, output): output.write('NOT FALSE') def IS_NOT_TRUE(self, node, output): output.write('NOT TRUE') def IS_NOT_UNKNOWN(self, node, output): output.write('NOT UNKNOWN') def IS_TRUE(self, node, output): output.write('TRUE') def IS_UNKNOWN(self, node, output): output.write('UNKNOWN') boolean_test_printer = BooleanTestPrinter() @node_printer(ast.BooleanTest) def boolean_test(node, output): with output.expression(isinstance(node.ancestors[0], ast.A_Expr)): with output.expression(isinstance(node.arg, ast.BoolExpr)): output.print_node(node.arg) output.write(' IS ') boolean_test_printer(node.booltesttype, node, output) @node_printer(ast.CallStmt) def call_stmt(node, output): output.write('CALL ') output.print_node(node.funccall) @node_printer(ast.CaseExpr) def case_expr(node, output): with output.push_indent(): output.writes('CASE') if node.arg: output.print_node(node.arg) output.newline() output.space(2) with output.push_indent(): output.print_list(node.args, '') if node.defresult: output.newline() output.write('ELSE ') output.print_node(node.defresult) output.newline() output.write('END') @node_printer(ast.CaseWhen) def case_when(node, output): output.write('WHEN ') with output.push_indent(-3): output.print_node(node.expr) output.newline() output.write('THEN ') output.print_node(node.result) @node_printer(ast.CoalesceExpr) def coalesce_expr(node, output): output.write('COALESCE') with output.expression(True): output.print_list(node.args) @node_printer(ast.CollateClause) def collate_clause(node, output): if node.arg: with output.expression(isinstance(node.arg, ast.A_Expr)): output.print_node(node.arg) output.swrite('COLLATE ') output.print_name(node.collname, '.') @node_printer(ast.ColumnRef) def column_ref(node, output): output.print_name(node.fields) class CTEMaterializedPrinter(IntEnumPrinter): enum = enums.CTEMaterialize def CTEMaterializeAlways(self, node, output): output.write(' MATERIALIZED') def CTEMaterializeDefault(self, node, output): pass def CTEMaterializeNever(self, node, output): output.write(' NOT MATERIALIZED') cte_materialize_printer = CTEMaterializedPrinter() @node_printer(ast.CTECycleClause) def cte_cycle_clause(node, output): output.write('CYCLE ') output.print_list(node.cycle_col_list, are_names=True) output.write(' SET ') output.print_name(node.cycle_mark_column) if node.cycle_mark_value: output.write(' TO ') output.print_node(node.cycle_mark_value) if node.cycle_mark_default: output.write(' DEFAULT ') output.print_node(node.cycle_mark_default) output.write(' USING ') output.print_name(node.cycle_path_column) @node_printer(ast.CTECycleClause, ast.TypeCast) def cte_cycle_clause_type_cast(node, output): # This is a variant of the standard TypeCast printer, because within a CTECycleClause they # must be spelled as "typename 'value'", not as "CAST('value' AS typename)" output.print_node(node.typeName) output.write(' ') output.print_node(node.arg) @node_printer(ast.CTESearchClause) def cte_search_clause(node, output): output.write('SEARCH ') if node.search_breadth_first: output.write('BREADTH ') else: output.write('DEPTH ') output.write('FIRST BY ') output.print_list(node.search_col_list, are_names=True) output.write(' SET ') output.print_name(node.search_seq_column) @node_printer(ast.CommonTableExpr) def common_table_expr(node, output): output.print_name(node.ctename) if node.aliascolnames: with output.expression(True): if len(node.aliascolnames) > 1: output.space(2) output.print_name(node.aliascolnames, ',') output.swrite('AS') cte_materialize_printer(node.ctematerialized, node, output) output.newline() # See https://github.com/lelit/pglast/issues/163: the "forced" space will happen only in # the RawStream, that otherwise would not emit it before the opening paren of the # expression. The IndentedStream ignores the `force` argument. output.space(2, force=True) with output.expression(True): output.print_node(node.ctequery) if node.search_clause: output.newline() output.newline() output.print_node(node.search_clause) if node.cycle_clause: output.newline() output.newline() output.print_node(node.cycle_clause) output.newline() @node_printer(ast.ConstraintsSetStmt) def constraints_set_stmt(node, output): output.write('SET CONSTRAINTS ') if node.constraints: output.print_list(node.constraints) output.write(' ') else: output.write('ALL ') if node.deferred: output.write('DEFERRED') else: output.write('IMMEDIATE') @node_printer(ast.CopyStmt) def copy_stmt(node, output): output.write('COPY') if node.relation: output.write(' ') output.print_node(node.relation) if node.attlist: output.write(' ') with output.expression(True): output.print_list(node.attlist, are_names=True) if node.query: output.write(' ') with output.expression(True): with output.push_indent(): output.print_node(node.query) if node.is_from: output.write(' FROM ') else: output.write(' TO ') if node.is_program: output.write('PROGRAM ') if node.filename: output.write_quoted_string(node.filename) else: if node.is_from: output.write('STDIN') else: output.write('STDOUT') if node.options: output.newline() output.write('WITH ') old_syntax = False for option in node.options: if isinstance(option.arg, ast.Boolean) or option.defname == 'csv': old_syntax = True break if old_syntax: options = [] for option in node.options: if ((option.defname == 'csv' or option.defname == 'format' and option.arg.sval == 'csv')): value = 'CSV' elif option.defname == 'force_quote': value = 'FORCE QUOTE ' + output._concat_nodes(option.arg, are_names=True) elif option.defname in ('delimiter', 'escape', 'quote'): value = f"{option.defname.upper()} AS '{option.arg.sval}'" else: value = option.defname.upper() options.append(value) output.write(' '.join(options)) else: with output.expression(True): output.print_list(node.options) if node.whereClause: output.newline() output.write('WHERE ') output.print_node(node.whereClause) @node_printer(ast.CopyStmt, ast.DefElem) def copy_stmt_def_elem(node, output): option = node.defname argv = node.arg if option in {'format', 'log_verbosity', 'on_error'}: output.write(option.upper()) output.write(' ') output.print_symbol(argv) elif option == 'freeze': output.write('FREEZE') if isinstance(argv, ast.String): output.swrite(argv.sval.upper()) elif isinstance(argv, ast.Integer): output.swrite(str(argv.ival)) elif option in {'default', 'delimiter', 'encoding', 'escape', 'null', 'quote'}: output.write(option.upper()) output.write(' ') output.print_node(argv) elif option == 'header': output.write('HEADER') if argv is not None: output.swrite(argv.sval.upper()) elif option in {'force_quote', 'force_not_null', 'force_null'}: output.write(option.upper()) output.write(' ') # If it is a list print it. if isinstance(argv, tuple): with output.expression(True): output.print_list(argv, are_names=True) else: output.write('*') elif option == 'convert_selectively': output.write(option.upper()) output.write(' ') with output.expression(True): output.print_name(argv) else: raise NotImplementedError(option) @node_printer(ast.DeclareCursorStmt) def declare_cursor_stmt(node, output): output.write('DECLARE ') output.print_name(node.portalname) output.write(' ') if node.options & enums.CURSOR_OPT_BINARY: output.writes('BINARY') if node.options & enums.CURSOR_OPT_SCROLL: output.writes('SCROLL') elif node.options & enums.CURSOR_OPT_NO_SCROLL: output.writes('NO SCROLL') if node.options & enums.CURSOR_OPT_INSENSITIVE: output.writes('INSENSITIVE') output.writes('CURSOR') if node.options & enums.CURSOR_OPT_HOLD: output.writes('WITH HOLD') output.newline() output.space(2) output.write('FOR ') with output.push_indent(): output.print_node(node.query) @node_printer(ast.DeleteStmt) def delete_stmt(node, output): with output.push_indent(): if node.withClause: output.write('WITH ') output.print_node(node.withClause) output.newline() output.space(2) output.indent() output.write('DELETE FROM ') output.print_node(node.relation) if node.usingClause: output.newline() output.write('USING ') output.print_list(node.usingClause) if node.whereClause: output.newline() output.write('WHERE ') output.print_node(node.whereClause) if node.returningList: output.newline() output.write('RETURNING ') output.print_list(node.returningList) if node.withClause: output.dedent() @node_printer(ast.ExecuteStmt) def execute_stmt(node, output): output.write('EXECUTE ') output.print_name(node.name) if node.params: with output.expression(True): output.print_list(node.params) @node_printer(ast.ExplainStmt) def explain_stmt(node, output): output.write('EXPLAIN ') if node.options: with output.expression(True): output.print_list(node.options) output.newline() output.space(2) output.print_node(node.query) @node_printer(ast.ExplainStmt, ast.DefElem) def explain_stmt_def_elem(node, output): output.print_symbol(node.defname) if node.arg is not None: output.write(' ') output.print_symbol(node.arg) class FetchDirectionPrinter(IntEnumPrinter): enum = enums.FetchDirection def FETCH_FORWARD(self, node, output): if node.howMany == 1: output.write('NEXT') else: output.write('FORWARD') output.swrite('ALL' if node.howMany == LONG_MAX else str(node.howMany)) def FETCH_BACKWARD(self, node, output): if node.howMany == 1: output.write('PRIOR') else: output.write('BACKWARD') output.swrite('ALL' if node.howMany == LONG_MAX else str(node.howMany)) def FETCH_ABSOLUTE(self, node, output): if node.howMany == 1: output.write('FIRST') elif node.howMany == -1: output.write('LAST') else: output.write(f'ABSOLUTE {node.howMany}') def FETCH_RELATIVE(self, node, output): output.write(f'RELATIVE {node.howMany}') fetch_direction_printer = FetchDirectionPrinter() @node_printer(ast.FetchStmt) def fetch_stmt(node, output): output.write('MOVE ' if node.ismove else 'FETCH ') fetch_direction_printer(node.direction, node, output) output.write(' IN ' if node.ismove else ' FROM ') output.print_name(node.portalname) @node_printer(ast.Float) def float(node, output): output.write(node.fval) @node_printer(ast.FuncCall) def func_call(node, output): name = '.'.join(n.sval for n in node.funcname) special_printer = output.get_printer_for_function(name) if special_printer is not None: special_printer(node, output) return output.print_name(node.funcname) with output.expression(True): if node.agg_distinct: output.writes('DISTINCT') if node.args is None: if node.agg_star: output.write('*') else: if node.func_variadic: if len(node.args) > 1: output.print_list(node.args[:-1]) output.write(', ') output.write('VARIADIC ') output.print_node(node.args[-1]) else: output.print_list(node.args) if node.agg_order: if not node.agg_within_group: output.swrites('ORDER BY') output.print_list(node.agg_order) else: output.writes(') WITHIN GROUP (ORDER BY') output.print_list(node.agg_order) if node.agg_filter: output.swrites('FILTER (WHERE') output.print_node(node.agg_filter) output.write(')') if node.over: output.swrite('OVER ') output.print_node(node.over) @node_printer(ast.FuncCall, ast.WindowDef) def func_call_window_def(node, output): if node.name: output.print_name(node.name) else: window_def(node, output) @node_printer(ast.GroupingSet) def grouping_set(node, output): kind = node.kind if kind == enums.GroupingSetKind.GROUPING_SET_CUBE: output.write('CUBE ') elif kind == enums.GroupingSetKind.GROUPING_SET_ROLLUP: output.write('ROLLUP ') elif kind == enums.GroupingSetKind.GROUPING_SET_SETS: output.write('GROUPING SETS ') elif kind == enums.GroupingSetKind.GROUPING_SET_EMPTY: output.write('()') return elif kind == enums.GroupingSetKind.GROUPING_SET_SIMPLE: # FIXME: no idea how to reach this branch output.write('SIMPLE ') else: # pragma: no cover raise NotImplementedError('Unhandled grouping set kind: %s' % kind) with output.expression(True): output.print_list(node.content, ',') @node_printer(ast.GroupingFunc) def grouping_func(node, output): output.write(' GROUPING') with output.expression(True): output.print_list(node.args) @node_printer(ast.IndexElem) def index_elem(node, output): if node.name is not None: output.print_name(node.name) else: with output.expression(True): output.print_node(node.expr) if node.collation: output.swrite('COLLATE ') output.print_name(node.collation, ',') if node.opclass: output.write(' ') output.print_name(node.opclass, '.') if node.opclassopts: output.write(' ') with output.expression(True): output.print_list(node.opclassopts) if node.ordering != enums.SortByDir.SORTBY_DEFAULT: if node.ordering == enums.SortByDir.SORTBY_ASC: output.swrite('ASC') elif node.ordering == enums.SortByDir.SORTBY_DESC: output.swrite('DESC') else: # pragma: no cover raise NotImplementedError('Unhandled ordering: %s' % node.ordering) if node.nulls_ordering != enums.SortByNulls.SORTBY_NULLS_DEFAULT: output.swrite('NULLS ') if node.nulls_ordering == enums.SortByNulls.SORTBY_NULLS_LAST: output.write('LAST') else: output.write('FIRST') @node_printer(ast.InferClause) def infer_clause(node, output): if node.conname: output.swrite('ON CONSTRAINT ') output.print_name(node.conname) if node.indexElems: output.separator() with output.expression(True): output.print_list(node.indexElems) if node.whereClause: output.swrite('WHERE ') output.print_node(node.whereClause) @node_printer(ast.Integer) def integer(node, output): output.print_node(node.ival) @node_printer(ast.InsertStmt) def insert_stmt(node, output): with output.push_indent(): if node.withClause: output.write('WITH ') output.print_node(node.withClause) output.newline() output.space(2) output.indent() output.write('INSERT INTO ') output.print_node(node.relation) if node.cols: output.write(' ') with output.expression(True): output.print_list(node.cols) else: output.separator() if node.override: if node.override == enums.OverridingKind.OVERRIDING_USER_VALUE: output.write(' OVERRIDING USER VALUE ') elif node.override == enums.OverridingKind.OVERRIDING_SYSTEM_VALUE: output.write(' OVERRIDING SYSTEM VALUE ') if node.selectStmt: output.newline() output.print_node(node.selectStmt) else: output.write('DEFAULT VALUES') if node.onConflictClause: output.newline() output.write('ON CONFLICT ') output.print_node(node.onConflictClause) if node.returningList: output.newline() output.write('RETURNING ') output.print_name(node.returningList, ',') if node.withClause: output.dedent() @node_printer(ast.IntoClause) def into_clause(node, output): output.print_node(node.rel) if node.colNames: output.write(' ') with output.expression(True): output.print_name(node.colNames, ',') output.newline() with output.push_indent(2): if node.accessMethod: output.write('USING ') output.print_name(node.accessMethod) output.newline() if node.options: output.write('WITH ') with output.expression(True): output.print_list(node.options) output.newline() if node.onCommit != enums.OnCommitAction.ONCOMMIT_NOOP: output.write('ON COMMIT ') if node.onCommit == enums.OnCommitAction.ONCOMMIT_PRESERVE_ROWS: output.write('PRESERVE ROWS') elif node.onCommit == enums.OnCommitAction.ONCOMMIT_DELETE_ROWS: output.write('DELETE ROWS') elif node.onCommit == enums.OnCommitAction.ONCOMMIT_DROP: output.write('DROP') output.newline() if node.tableSpaceName: output.write('TABLESPACE ') output.print_name(node.tableSpaceName) output.newline() @node_printer(ast.JoinExpr) def join_expr(node, output): with output.push_indent(): with output.expression(bool(node.alias)): output.print_node(node.larg) output.newline() if node.isNatural: output.write('NATURAL ') jt = enums.JoinType if node.jointype == jt.JOIN_INNER: if not node.usingClause and not node.quals and not node.isNatural: output.write('CROSS') else: output.write('INNER') elif node.jointype == jt.JOIN_LEFT: output.write('LEFT') elif node.jointype == jt.JOIN_FULL: output.write('FULL') elif node.jointype == jt.JOIN_RIGHT: output.write('RIGHT') output.swrite('JOIN ') if isinstance(node.rarg, ast.JoinExpr): output.indent(3, relative=False) # need this for: # tests/test_printers_roundtrip.py::test_pg_regress_corpus[join.sql] - # AssertionError: Statement “select * from int8_tbl x cross join (int4_tbl x cross join lateral (select x.f1) ss)” # from libpg_query/test/sql/postgres_regress/join.sql at line 1998 with output.expression(not bool(node.rarg.alias)): output.print_node(node.rarg) output.newline() else: output.print_node(node.rarg) if node.usingClause: output.swrite('USING ') with output.expression(True): output.print_name(node.usingClause, ',') if node.join_using_alias: output.write(' AS ') output.print_node(node.join_using_alias) elif node.quals: output.swrite('ON ') output.print_node(node.quals) if node.alias: output.writes(' AS ') output.print_name(node.alias) if isinstance(node.rarg, ast.JoinExpr): output.dedent() @node_printer(ast.JsonAggConstructor) def json_agg_constructor(node, output): if node.agg_order: output.write('ORDER BY ') output.print_list(node.agg_order) parent_node = node.ancestors[0] output.swrite('ABSENT' if parent_node.absent_on_null else 'NULL') output.write(' ON NULL') if getattr(parent_node, 'unique', False): output.swrite('WITH UNIQUE KEYS') if node.output: output.print_node(node.output) @node_printer(ast.JsonArgument) def json_argument(node, output): output.print_node(node.val) output.write(' AS ') output.print_name(node.name) @node_printer(ast.JsonArrayAgg) def json_array_agg(node, output): output.write('json_arrayagg') with output.expression(True): output.print_node(node.arg) output.print_node(node.constructor) # Sigh, the following sub-nodes of JsonAggConstructor must be handled here, # because they go outside the json_arrayagg() "function"... if node.constructor.agg_filter: output.write(' FILTER ') with output.expression(True): output.write('WHERE ') output.print_node(node.constructor.agg_filter) if node.constructor.over: output.write(' OVER ') output.print_node(node.constructor.over) @node_printer(ast.JsonArrayConstructor) def json_array_constructor(node, output): output.write('json_array') with output.expression(True): if node.exprs: output.print_list(node.exprs) output.swrite('ABSENT' if node.absent_on_null else 'NULL') output.write(' ON NULL') if node.output: output.print_node(node.output) @node_printer(ast.JsonArrayQueryConstructor) def json_array_query_constructor(node, output): output.write('json_array') with output.expression(True): output.print_node(node.query) output.print_node(node.format) if node.output: output.print_node(node.output) class JsonBehaviorTypePrinter(IntEnumPrinter): enum = enums.JsonBehaviorType def JSON_BEHAVIOR_NULL(self, node, output): output.write('NULL') def JSON_BEHAVIOR_ERROR(self, node, output): output.write('ERROR') def JSON_BEHAVIOR_EMPTY(self, node, output): output.write('EMPTY') def JSON_BEHAVIOR_TRUE(self, node, output): output.write('TRUE') def JSON_BEHAVIOR_FALSE(self, node, output): output.write('FALSE') def JSON_BEHAVIOR_UNKNOWN(self, node, output): output.write('UNKNOWN') def JSON_BEHAVIOR_EMPTY_ARRAY(self, node, output): output.write('EMPTY ARRAY') def JSON_BEHAVIOR_EMPTY_OBJECT(self, node, output): output.write('EMPTY OBJECT') def JSON_BEHAVIOR_DEFAULT(self, node, output): output.write('DEFAULT ') output.print_node(node.expr) json_behavior_type_printer = JsonBehaviorTypePrinter() @node_printer(ast.JsonBehavior) def json_behavior(node, output): json_behavior_type_printer(node.btype, node, output) class JsonEncodingPrinter(IntEnumPrinter): enum = enums.JsonEncoding def JS_ENC_UTF8(self, node, output): output.write('UTF8') def JS_ENC_UTF16(self, node, output): output.write('UTF16') def JS_ENC_UTF32(self, node, output): output.write('UTF32') json_encoding_printer = JsonEncodingPrinter() class JsonFormatTypePrinter(IntEnumPrinter): enum = enums.JsonFormatType def JS_FORMAT_JSON(self, node, output): output.write('JSON') def JS_FORMAT_JSONB(self, node, output): output.write('JSONB') json_format_type_printer = JsonFormatTypePrinter() @node_printer(ast.JsonFormat) def json_format(node, output): if node.format_type != enums.JsonFormatType.JS_FORMAT_DEFAULT: output.swrite('FORMAT ') json_format_type_printer(node.format_type, node, output) if node.encoding != enums.JsonEncoding.JS_ENC_DEFAULT: output.swrite('ENCODING ') json_encoding_printer(node.encoding, node, output) class JsonExprOpPrinter(IntEnumPrinter): enum = enums.JsonExprOp def JSON_EXISTS_OP(self, node, output): output.write('JSON_EXISTS') def JSON_QUERY_OP(self, node, output): output.write('JSON_QUERY') def JSON_VALUE_OP(self, node, output): output.write('JSON_VALUE') def JSON_TABLE_OP(self, node, output): output.write('JSON_TABLE') json_expr_op_printer = JsonExprOpPrinter() @node_printer(ast.JsonFuncExpr) def json_func_expr(node, output): json_expr_op_printer(node.op, node, output) with output.expression(True): with output.push_indent(): output.print_node(node.context_item) output.write(', ') output.print_node(node.pathspec) if node.passing: output.newline() output.write('PASSING ') output.print_list(node.passing) if node.output: output.print_node(node.output) jw = enums.JsonWrapper if node.wrapper == jw.JSW_NONE: output.write(' WITHOUT WRAPPER') elif node.wrapper == jw.JSW_CONDITIONAL: output.write(' WITH CONDITIONAL WRAPPER') elif node.wrapper == jw.JSW_UNCONDITIONAL: output.write(' WITH UNCONDITIONAL WRAPPER') json_quotes_printer(node.quotes, node, output) if node.on_empty: output.write(' ') output.print_node(node.on_empty) output.write(' ON EMPTY') if node.on_error: output.write(' ') output.print_node(node.on_error) output.write(' ON ERROR') @node_printer(ast.JsonIsPredicate) def json_is_predicate(node, output): output.print_node(node.expr) output.print_node(node.format) output.write(' IS ') json_value_type_printer(node.item_type, node, output) if node.unique_keys: output.write(' WITH UNIQUE KEYS') @node_printer(ast.JsonKeyValue) def json_key_value(node, output): output.print_node(node.key) output.writes(':') output.print_node(node.value) @node_printer(ast.JsonObjectAgg) def json_object_agg(node, output): output.write('json_objectagg') with output.expression(True): output.print_node(node.arg) output.print_node(node.constructor) # Sigh, the following sub-nodes of JsonAggConstructor must be handled here, # because they go outside the json_objectagg() "function"... if node.constructor.agg_filter: output.write(' FILTER ') with output.expression(True): output.write('WHERE ') output.print_node(node.constructor.agg_filter) if node.constructor.over: output.write(' OVER ') output.print_node(node.constructor.over) @node_printer(ast.JsonObjectConstructor) def json_object_constructor(node, output): output.write('json_object') with output.expression(True): if node.exprs: output.print_list(node.exprs) if node.absent_on_null: output.swrite('ABSENT ON NULL') if node.unique: output.swrite('WITH UNIQUE KEYS') if node.output: output.print_node(node.output) @node_printer(ast.JsonOutput) def json_output(node, output): if node.returning: output.swrite('RETURNING ') output.print_node(node.typeName) output.print_node(node.returning) @node_printer(ast.JsonParseExpr) def json_parse_expr(node, output): output.write('json') with output.expression(True): output.print_node(node.expr) if node.unique_keys: output.write('WITH UNIQUE KEYS') @node_printer(ast.JsonReturning) def json_returning(node, output): output.print_node(node.format) @node_printer(ast.JsonScalarExpr) def json_scalar_expr(node, output): output.write('json_scalar') with output.expression(True): output.print_node(node.expr) @node_printer(ast.JsonSerializeExpr) def json_serialize_expr(node, output): output.write('json_serialize') with output.expression(True): output.print_node(node.expr) if node.output: output.print_node(node.output) @node_printer(ast.JsonTable) def json_table(node, output): output.write('json_table') with output.expression(True): with output.push_indent(): output.print_node(node.context_item) output.write(', ') output.print_node(node.pathspec) if node.passing: output.newline() output.write('PASSING ') output.print_list(node.passing) output.newline() output.write('COLUMNS ') with output.expression(True): output.print_list(node.columns) if node.on_error: output.newline() output.print_node(node.on_error) output.write(' ON ERROR') if node.alias: output.swrite('AS ') output.print_node(node.alias, is_name=True) class JsonQuotesPrinter(IntEnumPrinter): enum = enums.JsonQuotes def JS_QUOTES_UNSPEC(self, node, output): pass def JS_QUOTES_KEEP(self, node, output): output.swrite('KEEP QUOTES') def JS_QUOTES_OMIT(self, node, output): output.swrite('OMIT QUOTES') json_quotes_printer = JsonQuotesPrinter() @node_printer(ast.JsonTableColumn) def json_table_column(node, output): jtct = enums.JsonTableColumnType if node.coltype == jtct.JTC_NESTED: output.write('NESTED PATH ') output.print_node(node.pathspec) output.write('COLUMNS ') with output.expression(True): output.print_list(node.columns) else: output.print_node(node.name, is_name=True) if node.coltype == jtct.JTC_FOR_ORDINALITY: output.write(' FOR ORDINALITY') else: output.print_node(node.typeName) if node.coltype == jtct.JTC_EXISTS: output.write(' EXISTS ') if node.format: output.print_node(node.format) if node.pathspec: output.swrite('PATH ') output.print_node(node.pathspec) jw = enums.JsonWrapper if node.wrapper == jw.JSW_NONE: if node.coltype in (jtct.JTC_REGULAR, jtct.JTC_FORMATTED): output.write(' WITHOUT WRAPPER') elif node.wrapper == jw.JSW_CONDITIONAL: output.write(' WITH CONDITIONAL WRAPPER') elif node.wrapper == jw.JSW_UNCONDITIONAL: output.write(' WITH UNCONDITIONAL WRAPPER') json_quotes_printer(node.quotes, node, output) if node.on_empty: output.write(' ') output.print_node(node.on_empty) output.write(' ON EMPTY') if node.on_error: output.write(' ') output.print_node(node.on_error) output.write(' ON ERROR') @node_printer(ast.JsonTablePathSpec) def json_table_path_spec(node, output): output.write_quoted_string(node.string.val.sval) if node.name: output.write(' AS ') output.print_node(node.name, is_name=True) @node_printer(ast.JsonValueExpr) def json_value_expr(node, output): output.print_node(node.raw_expr) output.print_node(node.format) class JsonValueTypePrinter(IntEnumPrinter): enum = enums.JsonValueType def JS_TYPE_ANY(self, node, output): output.write('JSON') def JS_TYPE_OBJECT(self, node, output): output.write('JSON OBJECT') def JS_TYPE_ARRAY(self, node, output): output.write('JSON ARRAY') def JS_TYPE_SCALAR(self, node, output): output.write('JSON SCALAR') json_value_type_printer = JsonValueTypePrinter() @node_printer(ast.LockingClause) def locking_clause(node, output): lcs = enums.LockClauseStrength if node.strength == lcs.LCS_FORKEYSHARE: output.write('KEY SHARE') elif node.strength == lcs.LCS_FORSHARE: output.write('SHARE') elif node.strength == lcs.LCS_FORNOKEYUPDATE: output.write('NO KEY UPDATE') elif node.strength == lcs.LCS_FORUPDATE: output.write('UPDATE') if node.lockedRels: output.swrites('OF') output.print_list(node.lockedRels) lwp = enums.LockWaitPolicy if node.waitPolicy == lwp.LockWaitSkip: output.swrite('SKIP LOCKED') elif node.waitPolicy == lwp.LockWaitError: output.swrite('NOWAIT') @node_printer(ast.ListenStmt) def listen_stmt(node, output): output.write('LISTEN ') output.print_name(node.conditionname) class MergeMatchKindPrinter(IntEnumPrinter): enum = enums.MergeMatchKind def MERGE_WHEN_MATCHED(self, node, output): output.write('MATCHED') def MERGE_WHEN_NOT_MATCHED_BY_SOURCE(self, node, output): output.write('NOT MATCHED BY SOURCE') def MERGE_WHEN_NOT_MATCHED_BY_TARGET(self, node, output): output.write('NOT MATCHED BY TARGET') merge_match_kind_printer = MergeMatchKindPrinter() @node_printer(ast.MergeStmt) def merge_stmt(node, output): with output.push_indent(): if node.withClause is not None: output.write('WITH ') output.print_node(node.withClause) output.newline() output.space(2) output.indent() output.write('MERGE INTO ') output.print_node(node.relation) output.newline() output.write('USING ') with output.push_indent(): output.print_node(node.sourceRelation) if isinstance(node.sourceRelation, ast.RangeSubselect): output.newline() output.swrite('ON ') output.print_node(node.joinCondition) for when in node.mergeWhenClauses: output.newline() output.write('WHEN ') merge_match_kind_printer(when.matchKind, node, output) if when.condition is not None: output.swrite('AND ') output.print_node(when.condition) output.swrite('THEN') if when.commandType in (enums.CmdType.CMD_NOTHING, enums.CmdType.CMD_DELETE): output.space() else: output.newline() output.print_node(when) if node.returningList: output.newline() output.write('RETURNING ') first = True for elem in node.returningList: if first: first = False else: output.write(', ') output.print_node(elem.val) if elem.name: output.write(' AS ') output.print_name(elem.name) if node.withClause is not None: output.dedent() @node_printer(ast.MergeSupportFunc) def merge_support_func(node, output): output.write('merge_action()') @node_printer(ast.MergeWhenClause) def merge_when_clause(node, output): oke = enums.OverridingKind if node.commandType == enums.CmdType.CMD_NOTHING: output.write('DO NOTHING') elif node.commandType == enums.CmdType.CMD_DELETE: output.write('DELETE') elif node.commandType == enums.CmdType.CMD_INSERT: with output.push_indent(2): output.write('INSERT ') if node.targetList is not None: with output.expression(True): output.print_list(node.targetList) output.newline() if node.override != oke.OVERRIDING_NOT_SET: ouv = 'USER' if node.override == oke.OVERRIDING_USER_VALUE else 'SYSTEM' output.write(f'OVERRIDING {ouv} VALUE') output.newline() if node.values is None: output.write('DEFAULT VALUES') else: output.write('VALUES ') with output.expression(True): output.print_list(node.values) elif node.commandType == enums.CmdType.CMD_UPDATE: with output.push_indent(2): output.write('UPDATE SET ') output.print_list(node.targetList) @node_printer(ast.MinMaxExpr) def min_max_expr(node, output): if node.op == enums.MinMaxOp.IS_GREATEST: output.write('GREATEST') else: output.write('LEAST') with output.expression(True): output.print_list(node.args) @node_printer(ast.MultiAssignRef) def multi_assign_ref(node, output): output.print_node(node.source) @node_printer(ast.NamedArgExpr) def named_arg_expr(node, output): output.print_name(node.name) output.write(' => ') output.print_node(node.arg) @node_printer(ast.NullTest) def null_test(node, output): output.print_node(node.arg) output.write(' IS') if node.nulltesttype == enums.NullTestType.IS_NOT_NULL: output.write(' NOT') output.write(' NULL') @node_printer(ast.ParamRef) def param_ref(node, output): output.write('$%d' % node.number) @node_printer(ast.PrepareStmt) def prepare_stmt(node, output): output.write('PREPARE ') output.print_node(node.name, is_name=True) if node.argtypes: with output.expression(True): output.print_list(node.argtypes) output.write(' AS') output.newline() with output.push_indent(2): output.print_node(node.query) @node_printer(ast.OnConflictClause) def on_conflict_clause(node, output): oca = enums.OnConflictAction if node.infer: output.print_node(node.infer) if node.action == oca.ONCONFLICT_NOTHING: output.write('DO NOTHING') elif node.action == oca.ONCONFLICT_UPDATE: output.newline() with output.push_indent(3): output.write('DO UPDATE') output.newline() output.space(2) output.write('SET ') output.print_list(node.targetList) if node.whereClause: output.newline() output.space(2) output.write('WHERE ') output.print_node(node.whereClause) @node_printer(ast.RangeFunction) def range_function(node, output): if node.lateral: output.write('LATERAL ') if node.is_rowsfrom: output.write('ROWS FROM ') with output.expression(node.is_rowsfrom): first = True for fun, cdefs in node.functions: if first: first = False else: output.write(', ') output.print_node(fun) if cdefs: # FIXME: find a way to get here output.write(' AS ') with output.expression(True): output.print_list(cdefs) if node.ordinality: output.write(' WITH ORDINALITY') if node.alias: output.write(' AS ') output.print_node(node.alias) if node.coldeflist: if not node.alias: output.write(' AS ') with output.expression(True): output.print_list(node.coldeflist, ',') @node_printer(ast.RangeSubselect) def range_subselect(node, output): if node.lateral: output.write('LATERAL') output.maybe_write_space() with output.expression(True): with output.push_indent(): output.print_node(node.subquery) if node.alias: output.write(' AS ') output.print_name(node.alias) @node_printer(ast.RangeTableFunc) def range_table_func(node, output): if node.lateral: output.write('LATERAL ') output.write('xmltable') with output.expression(True): with output.push_indent(): if node.namespaces: output.write('xmlnamespaces') with output.expression(True): output.print_list(node.namespaces) output.writes(',') output.newline() with output.expression(True): output.print_node(node.rowexpr) output.newline() output.write('PASSING ') output.print_node(node.docexpr) output.newline() output.write('COLUMNS ') output.print_list(node.columns) if node.alias: # FIXME: find a way to get here output.write(' AS ') output.print_node(node.alias) @node_printer(ast.RangeTableFunc, ast.ResTarget) def range_table_func_res_target(node, output): if not node.name: output.write('DEFAULT ') output.print_node(node.val) if node.name: output.write(' AS ') output.print_name(node.name) @node_printer(ast.RangeTableFuncCol) def range_table_func_col(node, output): output.print_node(node.colname, is_name=True) output.write(' ') if node.for_ordinality: output.write('FOR ORDINALITY') else: output.print_node(node.typeName) if node.colexpr: output.swrite('PATH ') output.print_node(node.colexpr) if node.coldefexpr: output.swrite('DEFAULT ') output.print_node(node.coldefexpr) if node.is_not_null: output.swrite('NOT NULL') @node_printer(ast.RangeVar) def range_var(node, output): if not node.inh: output.write('ONLY ') if node.catalogname: output.print_name(node.catalogname) output.write('.') if node.schemaname: output.print_name(node.schemaname) output.write('.') output.print_name(node.relname) alias = node.alias if alias: output.write(' AS ') output.print_name(alias) @node_printer(ast.RangeTableSample) def range_table_sample(node, output): output.print_node(node.relation) output.write(' TABLESAMPLE ') output.print_name(node.method, ' ') with output.expression(True): output.print_list(node.args, ' ') if node.repeatable: output.write(' REPEATABLE ') with output.expression(True): output.print_node(node.repeatable) @node_printer(ast.RawStmt) def raw_stmt(node, output): output.print_node(node.stmt) @node_printer(ast.ResTarget) def res_target(node, output): if node.val: output.print_node(node.val) if node.name: output.write(' AS ') output.print_name(node.name) else: output.print_name(node.name) if node.indirection: print_indirection(node.indirection, output) @node_printer(ast.RowExpr) def row_expr(node, output): if node.row_format == enums.CoercionForm.COERCE_EXPLICIT_CALL: output.write('ROW') with output.expression(True): if node.args: output.print_list(node.args) elif node.row_format == enums.CoercionForm.COERCE_IMPLICIT_CAST: with output.expression(True): output.print_list(node.args) else: raise NotImplementedError('Coercion type not implemented: %s' % node.row_format) def _select_needs_to_be_wrapped_in_parens(node): # Accordingly with https://www.postgresql.org/docs/current/sql-select.html, a SELECT # statement on either sides of UNION/INTERSECT/EXCEPT must be wrapped in parens if it # contains ORDER BY/LIMIT/... or is a nested UNION/INTERSECT/EXCEPT return bool(node.sortClause or node.limitCount or node.limitOffset or node.lockingClause or node.withClause or node.op != enums.SetOperation.SETOP_NONE) @node_printer(ast.SelectStmt) def select_stmt(node, output): with output.push_indent(): if node.withClause: output.write('WITH ') output.print_node(node.withClause) output.newline() output.space(2) output.indent() so = enums.SetOperation if node.valuesLists: # Is this a SELECT ... FROM (VALUES (...))? with output.expression(isinstance(node.ancestors[0], ast.RangeSubselect)): output.write('VALUES ') output.print_lists(node.valuesLists) elif node.op != so.SETOP_NONE and (node.larg or node.rarg): with output.push_indent(): if node.larg: with output.expression(_select_needs_to_be_wrapped_in_parens(node.larg)): output.print_node(node.larg) output.newline() output.newline() if node.op == so.SETOP_UNION: output.write('UNION') elif node.op == so.SETOP_INTERSECT: output.write('INTERSECT') elif node.op == so.SETOP_EXCEPT: output.write('EXCEPT') if node.all: output.write(' ALL') output.newline() output.newline() if node.rarg: with output.expression(_select_needs_to_be_wrapped_in_parens(node.rarg)): output.print_node(node.rarg) else: output.write('SELECT') if node.distinctClause: output.write(' DISTINCT') if node.distinctClause[0]: output.write(' ON ') with output.expression(True): output.print_list(node.distinctClause) if node.targetList: output.write(' ') output.print_list(node.targetList) if node.intoClause: output.newline() output.write('INTO ') if node.intoClause.rel.relpersistence == enums.RELPERSISTENCE_UNLOGGED: output.write('UNLOGGED ') elif node.intoClause.rel.relpersistence == enums.RELPERSISTENCE_TEMP: output.write('TEMPORARY ') output.print_node(node.intoClause) if node.fromClause: output.newline() output.write('FROM ') output.print_list(node.fromClause) if node.whereClause: output.newline() output.write('WHERE ') output.print_node(node.whereClause) if node.groupClause: output.newline() output.write('GROUP BY ') if node.groupDistinct: output.write('DISTINCT ') output.print_list(node.groupClause) if node.havingClause: output.newline() output.write('HAVING ') output.print_node(node.havingClause) if node.windowClause: output.newline() output.write('WINDOW ') output.print_list(node.windowClause) if node.sortClause: output.newline() output.write('ORDER BY ') output.print_list(node.sortClause) if node.limitCount: output.newline() if node.limitOption == enums.LimitOption.LIMIT_OPTION_COUNT: output.write('LIMIT ') elif node.limitOption == enums.LimitOption.LIMIT_OPTION_WITH_TIES: output.write('FETCH FIRST ') if isinstance(node.limitCount, ast.A_Const) and node.limitCount.isnull: output.write('ALL') else: with output.expression(isinstance(node.limitCount, ast.A_Expr) and node.limitCount.kind == enums.A_Expr_Kind.AEXPR_OP): output.print_node(node.limitCount) if node.limitOption == enums.LimitOption.LIMIT_OPTION_WITH_TIES: output.write(' ROWS WITH TIES ') if node.limitOffset: output.newline() output.write('OFFSET ') output.print_node(node.limitOffset) if node.lockingClause: output.newline() output.write('FOR ') output.print_list(node.lockingClause) if node.withClause: output.dedent() @node_printer(ast.SetToDefault) def set_to_default(node, output): output.write('DEFAULT') @node_printer(ast.SortBy) def sort_by(node, output): output.print_node(node.node) sbd = enums.SortByDir if node.sortby_dir == sbd.SORTBY_ASC: output.swrite('ASC') elif node.sortby_dir == sbd.SORTBY_DESC: output.swrite('DESC') elif node.sortby_dir == sbd.SORTBY_USING: output.swrite('USING ') output.print_symbol(node.useOp) sbn = enums.SortByNulls if node.sortby_nulls != sbn.SORTBY_NULLS_DEFAULT: output.swrite('NULLS ') output.write('FIRST' if node.sortby_nulls == sbn.SORTBY_NULLS_FIRST else 'LAST') class SQLValueFunctionOpPrinter(IntEnumPrinter): enum = enums.SQLValueFunctionOp def SVFOP_CURRENT_CATALOG(self, node, output): output.write('CURRENT_CATALOG') def SVFOP_CURRENT_DATE(self, node, output): output.write('CURRENT_DATE') def SVFOP_CURRENT_ROLE(self, node, output): output.write('CURRENT_ROLE') def SVFOP_CURRENT_SCHEMA(self, node, output): output.write('CURRENT_SCHEMA') def SVFOP_CURRENT_TIME(self, node, output): output.write('CURRENT_TIME') def SVFOP_CURRENT_TIMESTAMP(self, node, output): output.write('CURRENT_TIMESTAMP') def SVFOP_CURRENT_TIMESTAMP_N(self, node, output): # pragma: no cover output.write('CURRENT_TIMESTAMP') with output.expression(True): output.write(str(node.typmod)) def SVFOP_CURRENT_TIME_N(self, node, output): # pragma: no cover output.write('CURRENT_TIME') with output.expression(True): output.write(str(node.typmod)) def SVFOP_CURRENT_USER(self, node, output): output.write('CURRENT_USER') def SVFOP_LOCALTIME(self, node, output): output.write('LOCALTIME') def SVFOP_LOCALTIMESTAMP(self, node, output): output.write('LOCALTIMESTAMP') def SVFOP_LOCALTIMESTAMP_N(self, node, output): # pragma: no cover output.write('LOCALTIMESTAMP') with output.expression(True): output.write(str(node.typmod)) def SVFOP_LOCALTIME_N(self, node, output): # pragma: no cover output.write('LOCALTIME') with output.expression(True): output.write(str(node.typmod)) def SVFOP_SESSION_USER(self, node, output): output.write('SESSION_USER') def SVFOP_USER(self, node, output): output.write('USER') sql_value_function_op_printer = SQLValueFunctionOpPrinter() @node_printer(ast.SQLValueFunction) def sql_value_function(node, output): sql_value_function_op_printer(node.op, node, output) @node_printer(ast.String) def string(node, output, is_name=False, is_symbol=False): output.print_node(node.sval, is_name=is_name, is_symbol=is_symbol) @node_printer(ast.SubLink) def sub_link(node, output): slt = enums.SubLinkType if node.subLinkType == slt.EXISTS_SUBLINK: output.write('EXISTS ') elif node.subLinkType == slt.ALL_SUBLINK: output.print_node(node.testexpr) output.write(' ') output.write(get_string_value(node.operName)) output.write(' ALL ') elif node.subLinkType == slt.ANY_SUBLINK: output.print_node(node.testexpr) if node.operName: output.write(' ') output.write(get_string_value(node.operName)) output.write(' ANY ') else: output.write(' IN ') elif node.subLinkType == slt.EXPR_SUBLINK: pass elif node.subLinkType == slt.ARRAY_SUBLINK: output.write('ARRAY') elif node.subLinkType in (slt.MULTIEXPR_SUBLINK, slt.ROWCOMPARE_SUBLINK): # pragma: no cover # FIXME: figure out how the get here raise NotImplementedError('SubLink of type %s not supported yet' % node.subLinkType) with output.expression(True): with output.push_indent(): output.print_node(node.subselect) @node_printer(ast.TransactionStmt) def transaction_stmt(node, output): tsk = enums.TransactionStmtKind if node.kind == tsk.TRANS_STMT_BEGIN: output.write('BEGIN ') if node.options: output.print_list(node.options) elif node.kind == tsk.TRANS_STMT_START: output.write('START TRANSACTION ') if node.options: output.print_list(node.options) elif node.kind == tsk.TRANS_STMT_COMMIT: output.write('COMMIT ') if node.chain: output.write('AND CHAIN ') elif node.kind == tsk.TRANS_STMT_ROLLBACK: output.write('ROLLBACK ') if node.chain: output.write('AND CHAIN ') elif node.kind == tsk.TRANS_STMT_SAVEPOINT: output.write('SAVEPOINT ') output.write(node.savepoint_name) elif node.kind == tsk.TRANS_STMT_RELEASE: output.write('RELEASE ') output.write(node.savepoint_name) elif node.kind == tsk.TRANS_STMT_ROLLBACK_TO: output.write('ROLLBACK TO SAVEPOINT ') output.write(node.savepoint_name) elif node.kind == tsk.TRANS_STMT_PREPARE: output.write('PREPARE TRANSACTION ') output.write("'%s'" % node.gid) elif node.kind == tsk.TRANS_STMT_COMMIT_PREPARED: output.write('COMMIT PREPARED ') output.write("'%s'" % node.gid) elif node.kind == tsk.TRANS_STMT_ROLLBACK_PREPARED: output.write('ROLLBACK PREPARED ') output.write("'%s'" % node.gid) @node_printer(ast.TransactionStmt, ast.DefElem) def transaction_stmt_def_elem(node, output): value = node.defname argv = node.arg.val if value == 'transaction_isolation': output.write('ISOLATION LEVEL ') output.write(argv.sval.upper()) elif value == 'transaction_read_only': output.write('READ ') if argv.ival == 0: output.write('WRITE') else: output.write('ONLY') elif value == 'transaction_deferrable': if argv.ival == 0: output.write('NOT ') output.write('DEFERRABLE') else: # pragma: no cover raise NotImplementedError('Unhandled defname value %r' % value) @node_printer(ast.TruncateStmt) def truncate_stmt(node, output): output.write('TRUNCATE TABLE ') output.print_list(node.relations) if node.restart_seqs: output.write(' RESTART IDENTITY') if node.behavior == enums.DropBehavior.DROP_CASCADE: output.write(' CASCADE') @node_printer(ast.TypeCast) def type_cast(node, output): if isinstance(node.arg, ast.A_Const): fqtn = '.'.join(n.sval for n in node.typeName.names) if fqtn == 'pg_catalog.bpchar' and node.typeName.typmods is None: output.write('char ') output.print_node(node.arg) return output.write('CAST') with output.expression(True): output.print_node(node.arg) output.write(' AS ') output.print_node(node.typeName) # Constants taken from PG's include/utils/datetime.h: seem safe to assume they won't change MONTH = 1 << 1 YEAR = 1 << 2 DAY = 1 << 3 HOUR = 1 << 10 MINUTE = 1 << 11 SECOND = 1 << 12 # Map interval's typmod to string representation interval_ranges = { YEAR: 'year', MONTH: 'month', DAY: 'day', HOUR: 'hour', MINUTE: 'minute', SECOND: 'second', YEAR | MONTH: 'year to month', DAY | HOUR: 'day to hour', DAY | HOUR | MINUTE: 'day to minute', DAY | HOUR | MINUTE | SECOND: 'day to second', HOUR | MINUTE: 'hour to minute', HOUR | MINUTE | SECOND: 'hour to second', MINUTE | SECOND: 'minute to second', } del MONTH, YEAR, DAY, HOUR, MINUTE, SECOND # Map system type name to generic one system_types = { 'pg_catalog.bool': ('boolean', ''), 'pg_catalog.bpchar': ('char', ''), 'pg_catalog.float4': ('real', ''), 'pg_catalog.float8': ('double precision', ''), 'pg_catalog.int2': ('smallint', ''), 'pg_catalog.int4': ('integer', ''), 'pg_catalog.int8': ('bigint', ''), 'pg_catalog.interval': ('interval', ''), 'pg_catalog.numeric': ('numeric', ''), 'pg_catalog.time': ('time', ''), 'pg_catalog.timestamp': ('timestamp', ''), 'pg_catalog.timestamptz': ('timestamp', ' with time zone'), 'pg_catalog.timetz': ('time', ' with time zone'), 'pg_catalog.varbit': ('bit varying', ''), 'pg_catalog.varchar': ('varchar', ''), } @node_printer(ast.TypeName) def type_name(node, output): if node.setof: output.writes('SETOF') name = '.'.join(n.sval for n in node.names) suffix = '' if name in system_types: prefix, suffix = system_types[name] output.write(prefix) else: if name == 'char': output.write('"char"') else: output.print_name(node.names) if node.pct_type: output.write('%TYPE') else: if node.typmods: if name == 'pg_catalog.interval': typmod = node.typmods[0].val.ival if typmod in interval_ranges: output.swrite(interval_ranges[typmod]) if len(node.typmods) == 2: output.write(' ') with output.expression(True): output.print_node(node.typmods[1]) else: # Simplify "char(1)" to just "char" if ((name != 'pg_catalog.bpchar' or len(node.typmods) > 1 or node.typmods[0].val.ival != 1)): with output.expression(True): output.print_list(node.typmods, ',', standalone_items=False) output.write(suffix) if node.arrayBounds: for ab in node.arrayBounds: output.write('[') if ab.ival >= 0: output.print_node(ab) output.write(']') @node_printer(ast.VariableSetStmt, ast.TypeCast) def variable_set_stmt_type_cast(node, output): # This is a variant of the standard TypeCast printer, to handle the special case of # ”SET TIME ZONE INTERVAL 'xx' hour TO minute”, not as "CAST('xx' AS interval...)" type_name = '.'.join(n.sval for n in node.typeName.names) if type_name == 'pg_catalog.interval': output.write('INTERVAL ') output.print_node(node.arg) typmod = node.typeName.typmods[0].val.ival if typmod in interval_ranges: output.swrite(interval_ranges[typmod]) else: raise NotImplementedError('Unhandled typecast to %r' % type_name) @node_printer(ast.UpdateStmt) def update_stmt(node, output): with output.push_indent(): if node.withClause: output.write('WITH ') output.print_node(node.withClause) output.newline() output.space(2) output.indent() output.write('UPDATE ') output.print_node(node.relation) output.newline() output.write('SET ') output.print_list(node.targetList) if node.fromClause: output.newline() output.write('FROM ') output.print_list(node.fromClause) if node.whereClause: output.newline() output.write('WHERE ') output.print_node(node.whereClause) if node.returningList: output.newline() output.write('RETURNING ') first = True for elem in node.returningList: if first: first = False else: output.write(', ') output.print_node(elem.val) if elem.name: output.write(' AS ') output.print_name(elem.name) if node.withClause: output.dedent() @node_printer(ast.UnlistenStmt) def unlisten_stmt(node, output): output.write('UNLISTEN ') if node.conditionname: output.print_name(node.conditionname) else: output.write('*') @node_printer(ast.WithClause) def with_clause(node, output): relindent = -2 if node.recursive: relindent -= output.write('RECURSIVE ') output.print_list(node.ctes, relative_indent=relindent) @node_printer(ast.WindowDef) def window_def(node, output): if node.name: output.print_name(node.name) output.write(' AS ') with output.expression(True): if node.refname: output.print_name(node.refname) with output.push_indent(): if node.partitionClause: output.write('PARTITION BY ') output.print_list(node.partitionClause) if node.orderClause: if node.partitionClause: output.newline() output.write('ORDER BY ') output.print_list(node.orderClause) if node.frameOptions & enums.FRAMEOPTION_NONDEFAULT: if node.partitionClause or node.orderClause: output.newline() fo = node.frameOptions if fo & enums.FRAMEOPTION_RANGE: output.writes('RANGE') elif fo & enums.FRAMEOPTION_ROWS: output.writes('ROWS') elif fo & enums.FRAMEOPTION_GROUPS: output.writes('GROUPS') if fo & enums.FRAMEOPTION_BETWEEN: output.writes('BETWEEN') if fo & enums.FRAMEOPTION_START_UNBOUNDED_PRECEDING: output.writes('UNBOUNDED PRECEDING') elif fo & enums.FRAMEOPTION_START_UNBOUNDED_FOLLOWING: # pragma: no cover # Disallowed #output.writes('UNBOUNDED FOLLOWING') raise RuntimeError('Unexpected "UNBOUNDED FOLLOWING" disallowed option') elif fo & enums.FRAMEOPTION_START_CURRENT_ROW: output.writes('CURRENT ROW') elif fo & enums.FRAMEOPTION_START_OFFSET_PRECEDING: output.print_node(node.startOffset) output.swrites('PRECEDING') elif fo & enums.FRAMEOPTION_START_OFFSET_FOLLOWING: output.print_node(node.startOffset) output.swrites('FOLLOWING') if fo & enums.FRAMEOPTION_BETWEEN: output.writes('AND') if fo & enums.FRAMEOPTION_END_UNBOUNDED_PRECEDING: # pragma: no cover # Disallowed #output.writes('UNBOUNDED PRECEDING') raise RuntimeError('Unexpected "UNBOUNDED PRECEDING" disallowed option') elif fo & enums.FRAMEOPTION_END_UNBOUNDED_FOLLOWING: output.writes('UNBOUNDED FOLLOWING') elif fo & enums.FRAMEOPTION_END_CURRENT_ROW: output.writes('CURRENT ROW') elif fo & enums.FRAMEOPTION_END_OFFSET_PRECEDING: output.print_node(node.endOffset) output.swrites('PRECEDING') elif fo & enums.FRAMEOPTION_END_OFFSET_FOLLOWING: output.print_node(node.endOffset) output.swrites('FOLLOWING') if fo & enums.FRAMEOPTION_EXCLUDE_CURRENT_ROW: output.swrite('EXCLUDE CURRENT ROW') elif fo & enums.FRAMEOPTION_EXCLUDE_GROUP: output.swrite('EXCLUDE GROUP') elif fo & enums.FRAMEOPTION_EXCLUDE_TIES: output.swrite('EXCLUDE TIES') def print_indirection(node, output): for subnode in node: if isinstance(subnode, ast.String): output.write('.') output.print_node(subnode, is_name=True) @node_printer((ast.MergeWhenClause, ast.OnConflictClause, ast.UpdateStmt), ast.ResTarget) def update_stmt_res_target(node, output): if isinstance(node.val, ast.MultiAssignRef): if node.val.colno == 1: output.write('( ') output.indent(-2) output.print_name(node.name) if node.indirection: print_indirection(node.indirection, output) if node.val.colno == node.val.ncolumns: output.dedent() output.write(') = ') output.print_node(node.val) else: parent_node = abs(node.ancestors).node is_merge_insert = (isinstance(parent_node, ast.MergeWhenClause) and parent_node.commandType == enums.CmdType.CMD_INSERT) if is_merge_insert: output.print_name(node.name) else: if node.name: output.print_name(node.name) if node.indirection: print_indirection(node.indirection, output) output.write(' = ') output.print_node(node.val) class XmlOptionTypePrinter(IntEnumPrinter): enum = enums.XmlOptionType def XMLOPTION_DOCUMENT(self, node, output): output.write('document ') def XMLOPTION_CONTENT(self, node, output): output.write('content ') xml_option_type_printer = XmlOptionTypePrinter() class XmlStandaloneTypePrinter(IntEnumPrinter): enum = enums.XmlStandaloneType def XML_STANDALONE_YES(self, node, output): output.write(', STANDALONE YES') def XML_STANDALONE_NO(self, node, output): output.write(', STANDALONE NO') def XML_STANDALONE_NO_VALUE(self, node, output): output.write(', STANDALONE NO VALUE') def XML_STANDALONE_OMITTED(self, node, output): pass xml_standalone_type_printer = XmlStandaloneTypePrinter() class XmlExprOpPrinter(IntEnumPrinter): enum = enums.XmlExprOp def IS_XMLCONCAT(self, node, output): # XMLCONCAT(args) output.write('xmlconcat') with output.expression(True): output.print_list(node.args) def IS_XMLELEMENT(self, node, output): # XMLELEMENT(name, xml_attributes, args) output.write('xmlelement(name ') output.print_name(node.name) if node.named_args: output.write(', xmlattributes') with output.expression(True): output.print_list(node.named_args) if node.args: output.write(', ') output.print_list(node.args) output.write(')') def IS_XMLFOREST(self, node, output): # XMLFOREST(xml_attributes) output.write('xmlforest') with output.expression(True): output.print_list(node.named_args) def IS_XMLPARSE(self, node, output): # XMLPARSE(text, is_doc, preserve_ws) output.write('xmlparse') with output.expression(True): xml_option_type_printer(node.xmloption, node, output) arg, preserve_ws = node.args output.print_node(arg) if preserve_ws.val.boolval: # FIXME: find a way to get here output.write(' PRESERVE WHITESPACE') def IS_XMLPI(self, node, output): # XMLPI(name [, args]) output.write('xmlpi') with output.expression(True): output.write('name ') output.print_name(node.name) if node.args: output.write(', ') output.print_list(node.args) def IS_XMLROOT(self, node, output): # XMLROOT(xml, version, standalone) output.write('xmlroot') with output.expression(True): xml, version, standalone = node.args output.print_node(xml) output.write(', version ') if version.isnull: output.write('NO VALUE') else: output.print_node(version) xml_standalone_type_printer(standalone.val, node, output) def IS_XMLSERIALIZE(self, node, output): # XMLSERIALIZE(is_document, xmlval) raise NotImplementedError('IS_XMLSERIALIZE??') def IS_DOCUMENT(self, node, output): # xmlval IS DOCUMENT output.print_node(node.args[0]) output.write(' IS DOCUMENT') xml_expr_op_printer = XmlExprOpPrinter() @node_printer(ast.XmlExpr) def xml_expr(node, output): xml_expr_op_printer(node.op, node, output) @node_printer(ast.XmlSerialize) def xml_serialize(node, output): output.write('xmlserialize') with output.expression(True): xml_option_type_printer(node.xmloption, node, output) output.print_node(node.expr) output.write(' AS ') output.print_node(node.typeName) if node.indent: output.write('INDENT') pglast-7.7/pglast/printers/sfuncs.py000066400000000000000000000131131477366773500177240ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Special functions # :Created: mer 22 nov 2017 08:34:34 CET # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2021, 2022, 2024 Lele Gaifax # from .. import ast, enums from . import special_function # reminder for not yet implemented special functions: # # treat(1 as int) # 'foo' is nfc normalized # 'foo' is not nfc normalized def _print_trim(where, node, output): output.write('trim({}'.format(where)) if len(node.args) > 1: output.write(' ') output.print_node(node.args[1]) output.write(' FROM ') output.print_node(node.args[0]) output.write(')') @special_function('pg_catalog.btrim') def btrim(node, output): """ Emit function ``pg_catalog.btrim(' abc ')`` as ``trim(BOTH FROM ' abc ')`` and ``pg_catalog.btrim('xxabcxx', 'x')`` as ``trim(BOTH 'x' FROM 'xxabcxx')``. """ _print_trim('BOTH', node, output) @special_function('pg_catalog.pg_collation_for') def pg_collation_for(node, output): "Emit function ``pg_catalog.pg_collation_for(x)`` as ``COLLATION FOR (x)``." output.write('COLLATION FOR ') with output.expression(True): output.print_node(node.args[0]) @special_function('pg_catalog.extract') def extract(node, output): """ Emit function ``pg_catalog.extract(field, timestamp)`` as ``EXTRACT(field FROM timestamp).``. """ output.write('EXTRACT') with output.expression(True): output.write(node.args[0].val.sval.upper()) output.write(' FROM ') output.print_node(node.args[1]) @special_function('pg_catalog.ltrim') def ltrim(node, output): """ Emit function ``pg_catalog.ltrim(' abc ')`` as ``trim(LEADING FROM ' abc ')`` and ``pg_catalog.ltrim('xxabcxx', 'x')`` as ``trim(LEADING 'x' FROM 'xxabcxx').`` """ _print_trim('LEADING', node, output) # normalize(U&'\0061\0308bc', NFC) @special_function('pg_catalog.normalize') def normalize(node, output): """ Emit function ``pg_catalog.normalize(a)`` as ``normalize(x)`` and function ``pg_catalog.normalize('a','b')`` as ``normalize('a', b)``. """ output.write('normalize') with output.expression(True): output.print_node(node.args[0]) if len(node.args) > 1: output.write(', ') output.write(node.args[1].val.sval.upper()) @special_function('pg_catalog.overlaps') def overlaps(node, output): "Emit function ``pg_catalog.overlaps(a, b, c, d)`` as ``(a, b) OVERLAPS (c, d)``." with output.expression(True): output.print_list((node.args[0], node.args[1]), standalone_items=False) output.write(' OVERLAPS ') with output.expression(True): output.print_list((node.args[2], node.args[3]), standalone_items=False) @special_function('pg_catalog.overlay') def overlay(node, output): """ Emit function ``pg_catalog.overlay('Txxxxas','hom', 2, 4)`` as ``overlay('Txxxxas' PLACING 'hom' FROM 2 FOR 4)``." """ output.write('overlay') with output.expression(True): output.print_node(node.args[0]) output.write(' PLACING ') output.print_node(node.args[1]) output.write(' FROM ') output.print_node(node.args[2]) output.write(' FOR ') output.print_node(node.args[3]) @special_function('pg_catalog.position') def position(node, output): "Emit function ``pg_catalog.position('abcd', 'a')`` as ``position('a' IN 'abcd')``." output.write('position') with output.expression(True): output.print_node(node.args[1]) output.write(' IN ') output.print_node(node.args[0]) @special_function('pg_catalog.rtrim') def rtrim(node, output): """ Emit function ``pg_catalog.rtrim(' abc ')`` as ``trim(TRAILING FROM ' abc ')`` and ``pg_catalog.rtrim('xxabcxx', 'x')`` as ``trim(TRAILING 'x' FROM 'xxabcxx')`` """ _print_trim('TRAILING', node, output) @special_function('pg_catalog.substring') def substring(node, output): """ Emit function ``pg_catalog.substring('Txxxxas', 2, 4)`` as ``substring('Txxxxas' FROM 2 FOR 4)`` and ``pg_catalog.substring('blabla', 2)`` as ``substring('blabla' FROM 2)``. """ output.write('substring') with output.expression(True): output.print_node(node.args[0]) output.write(' FROM ') output.print_node(node.args[1]) if len(node.args) > 2: output.write(' FOR ') output.print_node(node.args[2]) @special_function('pg_catalog.timezone') def timezone(node, output): """ Emit function ``pg_catalog.timezone(tz, timestamp)`` as ``timestamp AT TIME ZONE tz``. """ # It must be wrapped in parens when it is within a DEFAULT constraint nearest_constraint = node.ancestors.find_nearest(ast.Constraint) if nearest_constraint is None: needs_parens = False else: needs_parens = nearest_constraint.node.contype == enums.ConstrType.CONSTR_DEFAULT with output.expression(needs_parens): if len(node.args) == 1: output.print_node(node.args[0]) output.write(' AT LOCAL') else: output.print_node(node.args[1]) output.write(' AT TIME ZONE ') output.print_node(node.args[0]) @special_function('pg_catalog.xmlexists') def xmlexists(node, output): "Emit function ``pg_catalog.xmlexists(x, y)`` as ``xmlexists(x PASSING BY REF y)``." output.write('xmlexists') with output.expression(True): output.print_node(node.args[0]) output.write(' PASSING BY REF ') output.print_node(node.args[1]) pglast-7.7/pglast/stream.py000066400000000000000000000717211477366773500160610ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Serialization logic # :Created: mer 02 ago 2017 15:46:11 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Lele Gaifax # from contextlib import contextmanager from io import StringIO from re import compile from sys import stderr from . import ast, parse_plpgsql, parse_sql from .keywords import RESERVED_KEYWORDS, TYPE_FUNC_NAME_KEYWORDS from .printers import get_printer_for_node, get_special_function is_simple_name = compile(r'[a-z_][a-z0-9_]*$').match "Determine whether a name is simple enough to not require being double quoted." def maybe_double_quote_name(name): """Possibly enclose `name` within double quotes. When `name` is not entirely composed by lower case letters, digits or underscores, or it matches one of the PostgreSQL keywords, it must be emitted between double quotes. """ if ((not is_simple_name(name) or name in RESERVED_KEYWORDS or name in TYPE_FUNC_NAME_KEYWORDS)): name = '"%s"' % name.replace('"', '""') return name class OutputStream(StringIO): "A stream that has a concept of a *pending separator* between consecutive writes." def __init__(self): super().__init__() self.pending_separator = False self.last_emitted_char = ' ' def show(self, where=stderr): # pragma: no cover "Emit current stream content, by default to `stderr`, to aid debugging." where.write(self.getvalue()) where.write('\n') def separator(self): """Possibly insert a single whitespace character before next output. When the last character written is not a space, set the `pending_separator` flag to ``True``: the next call to :meth:`write` will prepend a single whitespace to its argument if that begins with an alphanumeric character. """ if not self.last_emitted_char.isspace(): self.pending_separator = True def maybe_write_space(self, nextc=None, _special_chars=set("""_*+/-"'=<>$@""")): """Emit a space when needed. :param nextc: either None or the next character that will be written :return: the number of characters written to the stream If the last character written was neither a space nor an open parentheses, and `nextc` is either ``None`` or a *special character*, then emit a single whitespace. """ lec = self.last_emitted_char if not lec.isspace() and lec != '(': if nextc is None or nextc.isalnum() or nextc in _special_chars: return self.write(' ') return 0 def write(self, s): """Emit string `s`. :param str s: the string to emit :return: the number of characters written to the stream When `s` is not empty and `pending_separator` is ``True`` and the first character of `s` is alphanumeric, emit a single whitespace before writing out `s` and then reset `pending_separator` to ``False``. """ count = 0 if s: if self.pending_separator: if s != ' ': self.maybe_write_space(s[0]) self.pending_separator = False count = super().write(s) self.last_emitted_char = s[-1] return count def writes(self, s): "Shortcut for ``self.write(s); self.separator()``." count = self.write(s) self.separator() return count def swrite(self, s): "Shortcut for ``self.maybe_write_space(s[0]); self.write(s)``." count = self.maybe_write_space(s[0]) return count + self.write(s) def swrites(self, s): "Shortcut for ``self.swrite(s); self.separator()``." count = self.swrite(s) self.separator() return count class RawStream(OutputStream): """Basic SQL parse tree writer. :param int separate_statements: ``1`` by default, tells how many empty lines should separate statements :param bool special_functions: ``False`` by default, when ``True`` some functions are treated in a special way and emitted as equivalent constructs :param bool comma_at_eoln: ``False`` by default, when ``True`` put the comma right after each item instead of at the beginning of the *next* item line :param bool semicolon_after_last_statement: ``False`` by default, when ``True`` add a semicolon after the last statement, otherwise it is emitted only as a separator between multiple statements :param comments: optional sequence of tuples with the comments extracted from the statement :param bool remove_pg_catalog_from_functions: ``False`` by default, when ``True`` remove the pg_catalog schema from functions This augments :class:`OutputStream` and implements the basic machinery needed to serialize the *parse tree* produced by :func:`~.parser.parse_sql()` back to a textual representation, without any adornment. """ def __init__(self, separate_statements=1, special_functions=False, comma_at_eoln=False, semicolon_after_last_statement=False, comments=None, remove_pg_catalog_from_functions=False): super().__init__() self.current_column = 0 self.separate_statements = separate_statements self.special_functions = special_functions self.comma_at_eoln = comma_at_eoln self.semicolon_after_last_statement = semicolon_after_last_statement self.comments = comments self.remove_pg_catalog_from_functions = remove_pg_catalog_from_functions def show(self, where=stderr): # pragma: no cover """Emit also current expression_level and a "pointer" showing current_column.""" super().show(where) if self.current_column: where.write('-' * (self.current_column-1)) where.write('^\n') def __call__(self, sql, plpgsql=False): """Main entry point: execute :meth:`print_node` on each statement in `sql`. :param sql: the SQL statement :param bool plpgsql: whether `sql` is really a ``plpgsql`` statement :returns: a string with the equivalent SQL obtained by serializing the syntax tree The `sql` statement may be either a ``str`` containing the ``SQL`` in textual form, or a concrete :class:`.ast.Node` instance or a tuple of them. """ from .visitors import Visitor if isinstance(sql, str): sql = parse_plpgsql(sql) if plpgsql else parse_sql(sql) elif isinstance(sql, ast.Node): sql = (sql,) elif not (isinstance(sql, tuple) and sql and isinstance(sql[0], ast.Node)): raise ValueError("Unexpected value for 'sql', must be either a string," " an ast.Node or tuple of them, got %r" % type(sql)) class UpdateAncestors(Visitor): def visit(self, ancestors, node): node.ancestors = ancestors UpdateAncestors()(sql) first = True for statement in sql: if first: first = False else: self.write(';') self.newline() for _ in range(self.separate_statements): self.newline() self.print_node(statement) if self.semicolon_after_last_statement: self.write(';') if self.comments: while self.comments: self.print_comment(self.comments.pop(0)) return self.getvalue() def dedent(self): "Do nothing, shall be overridden by the prettifier subclass." def get_printer_for_function(self, name): """Look for a specific printer for function `name` in :data:`SPECIAL_FUNCTIONS`. :param str name: the qualified name of the function :returns: either ``None`` or a callable When the option `special_functions` is ``True``, return the printer function associated with `name`, if present. In all other cases return ``None``. """ if self.special_functions: return get_special_function(name) def indent(self, amount=0, relative=True): "Do nothing, shall be overridden by the prettifier subclass." def newline(self): "Emit a single whitespace, shall be overridden by the prettifier subclass." self.separator() def space(self, count=1, force=False): """Emit a single whitespace, shall be overridden by the prettifier subclass. :param int count: ignored in this implementation :param bool force: when ``True``, unconditionally and immediately emit a single space """ if force: self.write(' ') else: self.separator() @contextmanager def push_indent(self, amount=0, relative=True): "Create a no-op context manager, shall be overridden by the prettifier subclass." yield @contextmanager def expression(self, need_parens): """Create a context manager usable to conditionally wrap something within parentheses. :param bool need_parens: whether to emit opening and closing parentheses This method used to be used for *subexpressions*, but now is used to emit almost anything that goes within parentheses. """ if need_parens: self.write('(') yield if need_parens: self.write(')') def _concat_nodes(self, nodes, sep=' ', are_names=False, item_needs_parens=None): """Concatenate given `nodes`, using `sep` as the separator. :param scalars: a sequence of nodes :param str sep: the separator between them :param bool are_names: whether the nodes are actually *names*, which possibly require to be enclosed between double-quotes :param item_needs_parens: either ``None`` or a callable :returns: a string Use a temporary :class:`RawStream` instance to print the list of nodes and return the result. """ rawstream = RawStream( special_functions=self.special_functions, remove_pg_catalog_from_functions=self.remove_pg_catalog_from_functions) rawstream.print_list(nodes, sep, are_names=are_names, standalone_items=False, item_needs_parens=item_needs_parens) return rawstream.getvalue() def write_quoted_string(self, s): "Emit the string `s` as a single-quoted literal constant." self.write("'%s'" % s.replace("'", "''")) def _print_scalar(self, value, is_name, is_symbol): "Print the scalar `value`, special-casing string literals." is_string = isinstance(value, str) if is_symbol and is_string: self.write(value) elif is_name and is_string: self.write(maybe_double_quote_name(value)) elif is_string: self.write_quoted_string(value) else: self.write(str(value)) def print_comment(self, comment): """Print the given `comment`, unconditionally in the ``C`` syntax, joining all lines. :param comment: a :class:`Comment <.Comment>` tuple containing the original comment The comment style must change because the ``RawStream`` does not admit newlines, the whole statement is emitted in a single line of code, so ``SQL`` style comments are a no-no. .. warning:: When the original style of `comment` was ``SQL``, any occurrence of the string ``*/`` it contains is replaced with a *visually equivalent* but **different** ``*\\N{ZERO WIDTH NO-BREAK SPACE}/``, to avoid a premature end of the ``C`` style comment and thus a syntax error. """ is_sql_comment = comment.text.startswith('--') if is_sql_comment: # Issue #170: we are morphing from SQL-style to C-style comment, we must ensure # that any occurrence of "*/" in the original text gets not interpreted as the # end-of-the comment, as in ``SELECT ':*/' -- :*/ is a custom emoticon`` text = comment.text[2:].strip().replace('*/', '*\N{ZERO WIDTH NO-BREAK SPACE}/' ) else: text = comment.text[2:-2].strip() if text: self.swrite('/*') lines = text.splitlines() if len(lines) > 1: with self.push_indent(): for line in lines: self.write(line) self.write(' ') else: self.write(lines[0]) self.writes('*/') def print_name(self, nodes, sep='.'): "Helper method, execute :meth:`print_node` or :meth:`print_list` as needed." if isinstance(nodes, (list, tuple)): self.print_list(nodes, sep, standalone_items=False, are_names=True) elif isinstance(nodes, ast.Node): self.print_node(nodes, is_name=True) else: self._print_scalar(nodes, is_name=True, is_symbol=False) self.separator() def print_symbol(self, nodes, sep='.'): "Helper method, execute :meth:`print_node` or :meth:`print_list` as needed." if isinstance(nodes, (list, tuple)): self.print_list(nodes, sep, standalone_items=False, are_names=True, is_symbol=True) elif isinstance(nodes, ast.Node): self.print_node(nodes, is_name=True, is_symbol=True) else: self._print_scalar(str(nodes), is_name=True, is_symbol=True) self.separator() def print_node(self, node, is_name=False, is_symbol=False): """Lookup the specific printer for the given `node` and execute it. :param node: an instance of :class:`~.ast.Node` :param bool is_name: whether this is a *name* of something, that may need to be double quoted :param bool is_symbol: whether this is the name of an *operator*, should not be double quoted """ if self.comments: if hasattr(node, 'location') and isinstance(getattr(node, 'location'), int): node_location = getattr(node, 'location') elif hasattr(node, 'stmt_location'): node_location = getattr(node, 'stmt_location') else: node_location = None if node_location is not None: nextc = self.comments[0] if nextc.location <= node_location: self.print_comment(self.comments.pop(0)) while self.comments and self.comments[0].continue_previous: self.print_comment(self.comments.pop(0)) if is_name and isinstance(node, (list, tuple)): self.print_list(node, '.', standalone_items=False, are_names=True) elif isinstance(node, ast.Node): printer = get_printer_for_node(node) if is_name and isinstance(node, ast.String): printer(node, self, is_name=is_name, is_symbol=is_symbol) else: printer(node, self) else: self._print_scalar(node, is_name, is_symbol) self.separator() def _is_pg_catalog_func(self, items): return ( self.remove_pg_catalog_from_functions and len(items) > 1 and isinstance(items, (list, tuple)) and items[0].ancestors.parent.member == 'funcname' and items[0].sval == 'pg_catalog' # The list contains all functions that cannot be found without an # explicit pg_catalog schema. ie: # position(a,b) is invalid but pg_catalog.position(a,b) is fine and items[1].sval not in ('position', 'xmlexists') ) def _print_items(self, items, sep, newline, are_names=False, is_symbol=False, item_needs_parens=None): first = 1 if self._is_pg_catalog_func(items) else 0 last = len(items) - 1 for idx, item in enumerate(items): if idx < first: continue if idx > first: if sep == ',' and self.comma_at_eoln: self.write(sep) if newline: self.newline() else: self.write(' ') else: if not are_names: if newline: self.newline() if sep: self.write(sep) if sep != '.': self.write(' ') if item is None: self.write('None') else: if item_needs_parens is None: needs_parens = False else: needs_parens = item_needs_parens(item) with self.expression(needs_parens): self.print_node(item, is_name=are_names, is_symbol=is_symbol and idx == last) def print_list(self, nodes, sep=',', relative_indent=None, standalone_items=None, are_names=False, is_symbol=False, item_needs_parens=None): """Execute :meth:`print_node` on all the `nodes`, separating them with `sep`. :param nodes: a sequence of :class:`~.ast.Node` instances :param str sep: the separator between them :param bool relative_indent: if given, the relative amount of indentation to apply before the first item, by default computed automatically from the length of the separator `sep` :param bool standalone_items: whether a newline will be emitted before each item :param bool are_names: whether the nodes are actually *names*, which possibly require to be enclosed between double-quotes :param bool is_symbol: whether the nodes are actually a *symbol* such as an *operator name*, in which case the last one must be printed verbatim (e.g. ``"MySchema".===``) :param item_needs_parens: either ``None`` or a callable """ if relative_indent is None: if are_names or is_symbol: relative_indent = 0 else: relative_indent = (-(len(sep) + 1) if sep and (sep != ',' or not self.comma_at_eoln) else 0) if standalone_items is None: standalone_items = not all(isinstance(n, (ast.A_Const, ast.ColumnRef, ast.SetToDefault, ast.RangeVar)) for n in nodes) with self.push_indent(relative_indent): self._print_items(nodes, sep, standalone_items, are_names=are_names, is_symbol=is_symbol, item_needs_parens=item_needs_parens) def print_lists(self, lists, sep=',', relative_indent=None, standalone_items=None, are_names=False, sublist_open='(', sublist_close=')', sublist_sep=',', sublist_relative_indent=None): """Execute :meth:`print_list` on all the `lists` items. :param lists: a sequence of sequences of :class:`~.ast.Node` instances :param str sep: passed as is to :meth:`print_list` :param bool relative_indent: passed as is to :meth:`print_list` :param bool standalone_items: passed as is to :meth:`print_list` :param bool are_names: passed as is to :meth:`print_list` :param str sublist_open: the string that will be emitted before each sublist :param str sublist_close: the string that will be emitted after each sublist :param str sublist_sep: the separator between them each sublist :param bool sublist_relative_indent: if given, the relative amount of indentation to apply before the first sublist, by default computed automatically from the length of the separator `sublist_sep` """ if sublist_relative_indent is None: sublist_relative_indent = (-(len(sublist_sep) + 1) if sublist_sep and (sublist_sep != ',' or not self.comma_at_eoln) else 0) with self.push_indent(sublist_relative_indent): self.write(sublist_open) first = True for lst in lists: if first: first = False else: if self.comma_at_eoln: self.write(sublist_sep) self.newline() self.write(sublist_open) else: self.newline() self.write(sublist_sep) self.write(' ') self.write(sublist_open) self.print_list(lst, sep, relative_indent, standalone_items, are_names) self.write(sublist_close) class IndentedStream(RawStream): r"""Indented SQL parse tree writer. :param int compact_lists_margin: an integer value that, if given, is used to print lists on a single line, when they do not exceed the given margin on the right :param int split_string_literals_threshold: an integer value that, if given, is used as the threshold beyond that a string literal gets splitted in successive chunks of that length :param \*\*options: other options accepted by :class:`RawStream` This augments :class:`RawStream` to emit a prettified representation of a *parse tree*. """ def __init__(self, compact_lists_margin=None, split_string_literals_threshold=None, **options): super().__init__(**options) self.compact_lists_margin = compact_lists_margin self.split_string_literals_threshold = split_string_literals_threshold self.current_indent = 0 self.indentation_stack = [] def show(self, where=stderr): # pragma: no cover "Emit also current_indent and indentation_stack." where.write('current_indent=%d\n' % self.current_indent) where.write('indentation_stack=%r\n' % self.indentation_stack) super().show(where) def dedent(self): "Pop the indentation level from the stack and set `current_indent` to that." self.current_indent = self.indentation_stack.pop() def indent(self, amount=0, relative=True): """Push current indentation level to the stack, then set it adding `amount` to the `current_column` if `relative` is ``True`` otherwise to `current_indent`. """ self.indentation_stack.append(self.current_indent) base_indent = (self.current_column if relative else self.current_indent) assert base_indent + amount >= 0, f'base_indent={base_indent} amount={amount}' self.current_indent = base_indent + amount @contextmanager def push_indent(self, amount=0, relative=True): """Create a context manager that calls :meth:`indent` and :meth:`dedent` around a block of code. This is just an helper to simplify code that adjusts the indentation level: .. code-block:: python with output.push_indent(4): # code that emits something with the new indentation """ if self.pending_separator and relative: amount += 1 if self.current_column == 0 and relative: amount += self.current_indent self.indent(amount, relative) yield self.dedent() def newline(self): "Emit a newline." self.write('\n') def space(self, count=1, force=False): """Emit consecutive spaces. :param int count: how many spaces to emit :param bool force: ignored by this implementation, honored only by :meth:`RawStream.space` """ self.write(' '*count) def print_comment(self, comment): """Print the given `comment`, respecting the original style.""" is_sql_comment = comment.text.startswith('--') if is_sql_comment: text = comment.text[2:].strip() else: text = comment.text[2:-2].strip() if text: ci = self.current_indent cc = self.current_column if self.tell() != 0 and comment.at_start_of_line and not comment.continue_previous: self.newline() lines = comment.text.splitlines() if len(lines) > 1: with self.push_indent(): for line in lines: self.write(line) self.newline() else: self.write(lines[0]) if is_sql_comment: self.newline() else: self.space() self.current_column = cc self.current_indent = ci def print_list(self, nodes, sep=',', relative_indent=None, standalone_items=None, are_names=False, is_symbol=False, item_needs_parens=None): """Execute :meth:`print_node` on all the `nodes`, separating them with `sep`. :param nodes: a sequence of :class:`~.ast.Node` instances :param str sep: the separator between them :param bool relative_indent: if given, the relative amount of indentation to apply before the first item, by default computed automatically from the length of the separator `sep` :param bool standalone_items: whether a newline will be emitted before each item :param bool are_names: whether the nodes are actually *names*, which possibly require to be enclosed between double-quotes :param bool is_symbol: whether the nodes are actually an *operator name*, in which case the last one must be printed verbatim (such as ``"MySchema".===``) :param item_needs_parens: either ``None`` or a callable """ if standalone_items is None: clm = self.compact_lists_margin if clm is not None and clm > 0: rawlist = self._concat_nodes(nodes, sep, are_names, item_needs_parens) if self.current_column + len(rawlist) < clm: self.write(rawlist) return standalone_items = not all(isinstance(n, (ast.A_Const, ast.ColumnRef, ast.SetToDefault, ast.RangeVar)) for n in nodes) if (((sep != ',' or not self.comma_at_eoln) and len(nodes) > 1 and len(sep) > 1 and relative_indent is None and not are_names and not is_symbol and standalone_items)): self.write(' '*(len(sep) + 1)) # separator added automatically super().print_list(nodes, sep, relative_indent, standalone_items, are_names, is_symbol, item_needs_parens) def write_quoted_string(self, s): """Emit the string `s` possibly splitted in successive chunks. When the ``split_string_literals_threshold`` option is greater than 0 and the length of `s` exceeds that value, split the string into multiple chunks. """ sslt = self.split_string_literals_threshold if sslt is None or sslt <= 0: super().write_quoted_string(s) else: multiline = '\n' in s if multiline: self.write('E') with self.push_indent(): while True: chunk = s[:sslt] s = s[sslt:] # Avoid splitting on backslash while chunk.endswith("\\"): chunk += s[0] s = s[1:] chunk = chunk.replace("'", "''") if multiline: chunk = chunk.replace("\\", "\\\\") chunk = chunk.replace("\n", "\\n") self.write("'%s'" % chunk) if s: self.newline() else: # pragma: no cover break def write(self, s): """Write string `s` to the stream, adjusting the `current_column` accordingly. :param str s: the string to emit :return: the number of characters written to the stream If `s` is a newline character (``\\n``) set `current_column` to 0. Otherwise when `current_column` is 0 and `current_indent` is greater than 0 emit a number of whitespaces *before* emitting `s`, to indent it as expected. """ if s and s != '\n' and self.current_column == 0 and self.current_indent > 0: self.current_column = super().write(' ' * self.current_indent) count = super().write(s) if s == '\n': self.current_column = 0 else: self.current_column += count return count pglast-7.7/pglast/structs.pxd000066400000000000000000002001101477366773500164220ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from struct_defs.json @ 17-6.1.0-0-g1c1a32e # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021-2025 Lele Gaifax # #cython: language_level=3 cdef extern from "postgres.h": ctypedef unsigned char bool ctypedef struct Node: int type ctypedef struct Bitmapset: int nwords unsigned long *words cdef extern from "nodes/bitmapset.h": ctypedef struct Bitmapset: pass int bms_next_member(const Bitmapset *a, int prevbit) cdef extern from "nodes/nodes.h": ctypedef int ParseLoc cdef extern from "nodes/pg_list.h": ctypedef struct List: int length void* list_nth(List* list, int n) cdef extern from "nodes/value.h": ctypedef struct Integer: NodeTag type int ival ctypedef struct Float: NodeTag type char *fval ctypedef struct Boolean: NodeTag type bool boolval ctypedef struct String: NodeTag type char *sval ctypedef struct BitString: NodeTag type char *bsval int intVal(Integer v) double floatVal(Float v) bool boolVal(Boolean) char* strVal(String v) # ValUnion is a private type of the A_Const node, we need to redefine it here ctypedef union ValUnion: Node node Integer ival Float fval Boolean boolval String sval BitString bsval from libc.stdint cimport int16_t, int32_t, uint32_t, uint64_t cdef extern from *: ctypedef enum A_Expr_Kind: pass ctypedef enum AggSplit: pass ctypedef enum AggStrategy: pass ctypedef enum AlterPublicationAction: pass ctypedef enum AlterSubscriptionType: pass ctypedef enum AlterTSConfigType: pass ctypedef enum AlterTableType: pass ctypedef enum BoolExprType: pass ctypedef enum BoolTestType: pass ctypedef enum CTEMaterialize: pass ctypedef enum CmdType: pass ctypedef enum CoercionContext: pass ctypedef enum CoercionForm: pass ctypedef enum ConstrType: pass ctypedef enum DefElemAction: pass ctypedef enum DiscardMode: pass ctypedef enum DropBehavior: pass ctypedef enum FetchDirection: pass ctypedef enum FunctionParameterMode: pass ctypedef enum GrantTargetType: pass ctypedef enum GroupingSetKind: pass ctypedef enum ImportForeignSchemaType: pass ctypedef enum JoinType: pass ctypedef enum JsonBehaviorType: pass ctypedef enum JsonConstructorType: pass ctypedef enum JsonEncoding: pass ctypedef enum JsonExprOp: pass ctypedef enum JsonFormatType: pass ctypedef enum JsonQuotes: pass ctypedef enum JsonTableColumnType: pass ctypedef enum JsonValueType: pass ctypedef enum JsonWrapper: pass ctypedef enum LimitOption: pass ctypedef enum LockClauseStrength: pass ctypedef enum LockTupleMode: pass ctypedef enum LockWaitPolicy: pass ctypedef enum MergeMatchKind: pass ctypedef enum MinMaxOp: pass ctypedef enum NodeTag: T_Invalid T_List T_Alias T_RangeVar T_TableFunc T_IntoClause T_Var T_Const T_Param T_Aggref T_GroupingFunc T_WindowFunc T_WindowFuncRunCondition T_MergeSupportFunc T_SubscriptingRef T_FuncExpr T_NamedArgExpr T_OpExpr T_DistinctExpr T_NullIfExpr T_ScalarArrayOpExpr T_BoolExpr T_SubLink T_SubPlan T_AlternativeSubPlan T_FieldSelect T_FieldStore T_RelabelType T_CoerceViaIO T_ArrayCoerceExpr T_ConvertRowtypeExpr T_CollateExpr T_CaseExpr T_CaseWhen T_CaseTestExpr T_ArrayExpr T_RowExpr T_RowCompareExpr T_CoalesceExpr T_MinMaxExpr T_SQLValueFunction T_XmlExpr T_JsonFormat T_JsonReturning T_JsonValueExpr T_JsonConstructorExpr T_JsonIsPredicate T_JsonBehavior T_JsonExpr T_JsonTablePath T_JsonTablePathScan T_JsonTableSiblingJoin T_NullTest T_BooleanTest T_MergeAction T_CoerceToDomain T_CoerceToDomainValue T_SetToDefault T_CurrentOfExpr T_NextValueExpr T_InferenceElem T_TargetEntry T_RangeTblRef T_JoinExpr T_FromExpr T_OnConflictExpr T_Query T_TypeName T_ColumnRef T_ParamRef T_A_Expr T_A_Const T_TypeCast T_CollateClause T_RoleSpec T_FuncCall T_A_Star T_A_Indices T_A_Indirection T_A_ArrayExpr T_ResTarget T_MultiAssignRef T_SortBy T_WindowDef T_RangeSubselect T_RangeFunction T_RangeTableFunc T_RangeTableFuncCol T_RangeTableSample T_ColumnDef T_TableLikeClause T_IndexElem T_DefElem T_LockingClause T_XmlSerialize T_PartitionElem T_PartitionSpec T_PartitionBoundSpec T_PartitionRangeDatum T_SinglePartitionSpec T_PartitionCmd T_RangeTblEntry T_RTEPermissionInfo T_RangeTblFunction T_TableSampleClause T_WithCheckOption T_SortGroupClause T_GroupingSet T_WindowClause T_RowMarkClause T_WithClause T_InferClause T_OnConflictClause T_CTESearchClause T_CTECycleClause T_CommonTableExpr T_MergeWhenClause T_TriggerTransition T_JsonOutput T_JsonArgument T_JsonFuncExpr T_JsonTablePathSpec T_JsonTable T_JsonTableColumn T_JsonKeyValue T_JsonParseExpr T_JsonScalarExpr T_JsonSerializeExpr T_JsonObjectConstructor T_JsonArrayConstructor T_JsonArrayQueryConstructor T_JsonAggConstructor T_JsonObjectAgg T_JsonArrayAgg T_RawStmt T_InsertStmt T_DeleteStmt T_UpdateStmt T_MergeStmt T_SelectStmt T_SetOperationStmt T_ReturnStmt T_PLAssignStmt T_CreateSchemaStmt T_AlterTableStmt T_ReplicaIdentityStmt T_AlterTableCmd T_AlterCollationStmt T_AlterDomainStmt T_GrantStmt T_ObjectWithArgs T_AccessPriv T_GrantRoleStmt T_AlterDefaultPrivilegesStmt T_CopyStmt T_VariableSetStmt T_VariableShowStmt T_CreateStmt T_Constraint T_CreateTableSpaceStmt T_DropTableSpaceStmt T_AlterTableSpaceOptionsStmt T_AlterTableMoveAllStmt T_CreateExtensionStmt T_AlterExtensionStmt T_AlterExtensionContentsStmt T_CreateFdwStmt T_AlterFdwStmt T_CreateForeignServerStmt T_AlterForeignServerStmt T_CreateForeignTableStmt T_CreateUserMappingStmt T_AlterUserMappingStmt T_DropUserMappingStmt T_ImportForeignSchemaStmt T_CreatePolicyStmt T_AlterPolicyStmt T_CreateAmStmt T_CreateTrigStmt T_CreateEventTrigStmt T_AlterEventTrigStmt T_CreatePLangStmt T_CreateRoleStmt T_AlterRoleStmt T_AlterRoleSetStmt T_DropRoleStmt T_CreateSeqStmt T_AlterSeqStmt T_DefineStmt T_CreateDomainStmt T_CreateOpClassStmt T_CreateOpClassItem T_CreateOpFamilyStmt T_AlterOpFamilyStmt T_DropStmt T_TruncateStmt T_CommentStmt T_SecLabelStmt T_DeclareCursorStmt T_ClosePortalStmt T_FetchStmt T_IndexStmt T_CreateStatsStmt T_StatsElem T_AlterStatsStmt T_CreateFunctionStmt T_FunctionParameter T_AlterFunctionStmt T_DoStmt T_InlineCodeBlock T_CallStmt T_CallContext T_RenameStmt T_AlterObjectDependsStmt T_AlterObjectSchemaStmt T_AlterOwnerStmt T_AlterOperatorStmt T_AlterTypeStmt T_RuleStmt T_NotifyStmt T_ListenStmt T_UnlistenStmt T_TransactionStmt T_CompositeTypeStmt T_CreateEnumStmt T_CreateRangeStmt T_AlterEnumStmt T_ViewStmt T_LoadStmt T_CreatedbStmt T_AlterDatabaseStmt T_AlterDatabaseRefreshCollStmt T_AlterDatabaseSetStmt T_DropdbStmt T_AlterSystemStmt T_ClusterStmt T_VacuumStmt T_VacuumRelation T_ExplainStmt T_CreateTableAsStmt T_RefreshMatViewStmt T_CheckPointStmt T_DiscardStmt T_LockStmt T_ConstraintsSetStmt T_ReindexStmt T_CreateConversionStmt T_CreateCastStmt T_CreateTransformStmt T_PrepareStmt T_ExecuteStmt T_DeallocateStmt T_DropOwnedStmt T_ReassignOwnedStmt T_AlterTSDictionaryStmt T_AlterTSConfigurationStmt T_PublicationTable T_PublicationObjSpec T_CreatePublicationStmt T_AlterPublicationStmt T_CreateSubscriptionStmt T_AlterSubscriptionStmt T_DropSubscriptionStmt T_PlannerGlobal T_PlannerInfo T_RelOptInfo T_IndexOptInfo T_ForeignKeyOptInfo T_StatisticExtInfo T_JoinDomain T_EquivalenceClass T_EquivalenceMember T_PathKey T_GroupByOrdering T_PathTarget T_ParamPathInfo T_Path T_IndexPath T_IndexClause T_BitmapHeapPath T_BitmapAndPath T_BitmapOrPath T_TidPath T_TidRangePath T_SubqueryScanPath T_ForeignPath T_CustomPath T_AppendPath T_MergeAppendPath T_GroupResultPath T_MaterialPath T_MemoizePath T_UniquePath T_GatherPath T_GatherMergePath T_NestPath T_MergePath T_HashPath T_ProjectionPath T_ProjectSetPath T_SortPath T_IncrementalSortPath T_GroupPath T_UpperUniquePath T_AggPath T_GroupingSetData T_RollupData T_GroupingSetsPath T_MinMaxAggPath T_WindowAggPath T_SetOpPath T_RecursiveUnionPath T_LockRowsPath T_ModifyTablePath T_LimitPath T_RestrictInfo T_PlaceHolderVar T_SpecialJoinInfo T_OuterJoinClauseInfo T_AppendRelInfo T_RowIdentityVarInfo T_PlaceHolderInfo T_MinMaxAggInfo T_PlannerParamItem T_AggInfo T_AggTransInfo T_PlannedStmt T_Result T_ProjectSet T_ModifyTable T_Append T_MergeAppend T_RecursiveUnion T_BitmapAnd T_BitmapOr T_SeqScan T_SampleScan T_IndexScan T_IndexOnlyScan T_BitmapIndexScan T_BitmapHeapScan T_TidScan T_TidRangeScan T_SubqueryScan T_FunctionScan T_ValuesScan T_TableFuncScan T_CteScan T_NamedTuplestoreScan T_WorkTableScan T_ForeignScan T_CustomScan T_NestLoop T_NestLoopParam T_MergeJoin T_HashJoin T_Material T_Memoize T_Sort T_IncrementalSort T_Group T_Agg T_WindowAgg T_Unique T_Gather T_GatherMerge T_Hash T_SetOp T_LockRows T_Limit T_PlanRowMark T_PartitionPruneInfo T_PartitionedRelPruneInfo T_PartitionPruneStepOp T_PartitionPruneStepCombine T_PlanInvalItem T_ExprState T_IndexInfo T_ExprContext T_ReturnSetInfo T_ProjectionInfo T_JunkFilter T_OnConflictSetState T_MergeActionState T_ResultRelInfo T_EState T_WindowFuncExprState T_SetExprState T_SubPlanState T_DomainConstraintState T_ResultState T_ProjectSetState T_ModifyTableState T_AppendState T_MergeAppendState T_RecursiveUnionState T_BitmapAndState T_BitmapOrState T_ScanState T_SeqScanState T_SampleScanState T_IndexScanState T_IndexOnlyScanState T_BitmapIndexScanState T_BitmapHeapScanState T_TidScanState T_TidRangeScanState T_SubqueryScanState T_FunctionScanState T_ValuesScanState T_TableFuncScanState T_CteScanState T_NamedTuplestoreScanState T_WorkTableScanState T_ForeignScanState T_CustomScanState T_JoinState T_NestLoopState T_MergeJoinState T_HashJoinState T_MaterialState T_MemoizeState T_SortState T_IncrementalSortState T_GroupState T_AggState T_WindowAggState T_UniqueState T_GatherState T_GatherMergeState T_HashState T_SetOpState T_LockRowsState T_LimitState T_IndexAmRoutine T_TableAmRoutine T_TsmRoutine T_EventTriggerData T_TriggerData T_TupleTableSlot T_FdwRoutine T_Bitmapset T_ExtensibleNode T_ErrorSaveContext T_IdentifySystemCmd T_BaseBackupCmd T_CreateReplicationSlotCmd T_DropReplicationSlotCmd T_AlterReplicationSlotCmd T_StartReplicationCmd T_ReadReplicationSlotCmd T_TimeLineHistoryCmd T_UploadManifestCmd T_SupportRequestSimplify T_SupportRequestSelectivity T_SupportRequestCost T_SupportRequestRows T_SupportRequestIndexCondition T_SupportRequestWFuncMonotonic T_SupportRequestOptimizeWindowClause T_Integer T_Float T_Boolean T_String T_BitString T_ForeignKeyCacheInfo T_IntList T_OidList T_XidList T_AllocSetContext T_GenerationContext T_SlabContext T_BumpContext T_TIDBitmap T_WindowObjectData ctypedef enum NullTestType: pass ctypedef enum ObjectType: pass ctypedef enum OnCommitAction: pass ctypedef enum OnConflictAction: pass ctypedef enum OverridingKind: pass ctypedef enum ParamKind: pass ctypedef enum PartitionRangeDatumKind: pass ctypedef enum PartitionStrategy: pass ctypedef enum PublicationObjSpecType: pass ctypedef enum QuerySource: pass ctypedef enum RTEKind: pass ctypedef enum ReindexObjectType: pass ctypedef enum RoleSpecType: pass ctypedef enum RoleStmtType: pass ctypedef enum RowCompareType: pass ctypedef enum SQLValueFunctionOp: pass ctypedef enum ScanDirection: pass ctypedef enum SetOpCmd: pass ctypedef enum SetOpStrategy: pass ctypedef enum SetOperation: pass ctypedef enum SetQuantifier: pass ctypedef enum SortByDir: pass ctypedef enum SortByNulls: pass ctypedef enum SubLinkType: pass ctypedef enum TableFuncType: pass ctypedef enum TableLikeOption: pass ctypedef enum TransactionStmtKind: pass ctypedef enum VacOptValue: pass ctypedef enum VariableSetKind: pass ctypedef enum ViewCheckOption: pass ctypedef enum WCOKind: pass ctypedef enum XmlExprOp: pass ctypedef enum XmlOptionType: pass ctypedef enum pg_enc: pass ctypedef enum yytokentype: pass int nodeTag(void* data) cdef extern from "nodes/parsenodes.h": ctypedef struct Query: NodeTag type CmdType commandType QuerySource querySource bool canSetTag const Node* utilityStmt int resultRelation bool hasAggs bool hasWindowFuncs bool hasTargetSRFs bool hasSubLinks bool hasDistinctOn bool hasRecursive bool hasModifyingCTE bool hasForUpdate bool hasRowSecurity bool isReturn const List* cteList const List* rtable const List* rteperminfos const FromExpr* jointree const List* mergeActionList int mergeTargetRelation const Node* mergeJoinCondition const List* targetList OverridingKind override const OnConflictExpr* onConflict const List* returningList const List* groupClause bool groupDistinct const List* groupingSets const Node* havingQual const List* windowClause const List* distinctClause const List* sortClause const Node* limitOffset const Node* limitCount LimitOption limitOption const List* rowMarks const Node* setOperations const List* constraintDeps const List* withCheckOptions ParseLoc stmt_location ParseLoc stmt_len ctypedef struct TypeName: NodeTag type const List* names bool setof bool pct_type const List* typmods int32_t typemod const List* arrayBounds ParseLoc location ctypedef struct ColumnRef: NodeTag type const List* fields ParseLoc location ctypedef struct ParamRef: NodeTag type int number ParseLoc location ctypedef struct A_Expr: NodeTag type A_Expr_Kind kind const List* name const Node* lexpr const Node* rexpr ParseLoc location ctypedef struct TypeCast: NodeTag type const Node* arg const TypeName* typeName ParseLoc location ctypedef struct CollateClause: NodeTag type const Node* arg const List* collname ParseLoc location ctypedef struct RoleSpec: NodeTag type RoleSpecType roletype const char* rolename ParseLoc location ctypedef struct FuncCall: NodeTag type const List* funcname const List* args const List* agg_order const Node* agg_filter const WindowDef* over bool agg_within_group bool agg_star bool agg_distinct bool func_variadic CoercionForm funcformat ParseLoc location ctypedef struct A_Star: NodeTag type ctypedef struct A_Indices: NodeTag type bool is_slice const Node* lidx const Node* uidx ctypedef struct A_Indirection: NodeTag type const Node* arg const List* indirection ctypedef struct A_ArrayExpr: NodeTag type const List* elements ParseLoc location ctypedef struct ResTarget: NodeTag type const char* name const List* indirection const Node* val ParseLoc location ctypedef struct MultiAssignRef: NodeTag type const Node* source int colno int ncolumns ctypedef struct SortBy: NodeTag type const Node* node SortByDir sortby_dir SortByNulls sortby_nulls const List* useOp ParseLoc location ctypedef struct WindowDef: NodeTag type const char* name const char* refname const List* partitionClause const List* orderClause int frameOptions const Node* startOffset const Node* endOffset ParseLoc location ctypedef struct RangeSubselect: NodeTag type bool lateral const Node* subquery const Alias* alias ctypedef struct RangeFunction: NodeTag type bool lateral bool ordinality bool is_rowsfrom const List* functions const Alias* alias const List* coldeflist ctypedef struct RangeTableFunc: NodeTag type bool lateral const Node* docexpr const Node* rowexpr const List* namespaces const List* columns const Alias* alias ParseLoc location ctypedef struct RangeTableFuncCol: NodeTag type const char* colname const TypeName* typeName bool for_ordinality bool is_not_null const Node* colexpr const Node* coldefexpr ParseLoc location ctypedef struct RangeTableSample: NodeTag type const Node* relation const List* method const List* args const Node* repeatable ParseLoc location ctypedef struct ColumnDef: NodeTag type const char* colname const TypeName* typeName const char* compression int inhcount bool is_local bool is_not_null bool is_from_type char storage const char* storage_name const Node* raw_default const Node* cooked_default char identity const RangeVar* identitySequence char generated const CollateClause* collClause const List* constraints const List* fdwoptions ParseLoc location ctypedef struct TableLikeClause: NodeTag type const RangeVar* relation int32_t options ctypedef struct IndexElem: NodeTag type const char* name const Node* expr const char* indexcolname const List* collation const List* opclass const List* opclassopts SortByDir ordering SortByNulls nulls_ordering ctypedef struct DefElem: NodeTag type const char* defnamespace const char* defname const Node* arg DefElemAction defaction ParseLoc location ctypedef struct LockingClause: NodeTag type const List* lockedRels LockClauseStrength strength LockWaitPolicy waitPolicy ctypedef struct XmlSerialize: NodeTag type XmlOptionType xmloption const Node* expr const TypeName* typeName bool indent ParseLoc location ctypedef struct PartitionElem: NodeTag type const char* name const Node* expr const List* collation const List* opclass ParseLoc location ctypedef struct PartitionSpec: NodeTag type PartitionStrategy strategy const List* partParams ParseLoc location ctypedef struct PartitionBoundSpec: NodeTag type char strategy bool is_default int modulus int remainder const List* listdatums const List* lowerdatums const List* upperdatums ParseLoc location ctypedef struct PartitionRangeDatum: NodeTag type PartitionRangeDatumKind kind const Node* value ParseLoc location ctypedef struct SinglePartitionSpec: NodeTag type ctypedef struct PartitionCmd: NodeTag type const RangeVar* name const PartitionBoundSpec* bound bool concurrent ctypedef struct RangeTblEntry: NodeTag type const Alias* alias const Alias* eref RTEKind rtekind bool inh char relkind int rellockmode unsigned int perminfoindex const TableSampleClause* tablesample const Query* subquery bool security_barrier JoinType jointype int joinmergedcols const List* joinaliasvars const List* joinleftcols const List* joinrightcols const Alias* join_using_alias const List* functions bool funcordinality const TableFunc* tablefunc const List* values_lists const char* ctename unsigned int ctelevelsup bool self_reference const List* coltypes const List* coltypmods const List* colcollations const char* enrname double enrtuples bool lateral bool inFromCl const List* securityQuals ctypedef struct RTEPermissionInfo: NodeTag type bool inh uint64_t requiredPerms const Bitmapset* selectedCols const Bitmapset* insertedCols const Bitmapset* updatedCols ctypedef struct RangeTblFunction: NodeTag type const Node* funcexpr int funccolcount const List* funccolnames const List* funccoltypes const List* funccoltypmods const List* funccolcollations const Bitmapset* funcparams ctypedef struct TableSampleClause: NodeTag type const List* args const Expr* repeatable ctypedef struct WithCheckOption: NodeTag type WCOKind kind const char* relname const char* polname const Node* qual bool cascaded ctypedef struct SortGroupClause: NodeTag type unsigned int tleSortGroupRef bool nulls_first bool hashable ctypedef struct GroupingSet: NodeTag type GroupingSetKind kind const List* content ParseLoc location ctypedef struct WindowClause: NodeTag type const char* name const char* refname const List* partitionClause const List* orderClause int frameOptions const Node* startOffset const Node* endOffset bool inRangeAsc bool inRangeNullsFirst unsigned int winref bool copiedOrder ctypedef struct RowMarkClause: NodeTag type unsigned int rti LockClauseStrength strength LockWaitPolicy waitPolicy bool pushedDown ctypedef struct WithClause: NodeTag type const List* ctes bool recursive ParseLoc location ctypedef struct InferClause: NodeTag type const List* indexElems const Node* whereClause const char* conname ParseLoc location ctypedef struct OnConflictClause: NodeTag type OnConflictAction action const InferClause* infer const List* targetList const Node* whereClause ParseLoc location ctypedef struct CTESearchClause: NodeTag type const List* search_col_list bool search_breadth_first const char* search_seq_column ParseLoc location ctypedef struct CTECycleClause: NodeTag type const List* cycle_col_list const char* cycle_mark_column const Node* cycle_mark_value const Node* cycle_mark_default const char* cycle_path_column ParseLoc location int cycle_mark_typmod ctypedef struct CommonTableExpr: NodeTag type const char* ctename const List* aliascolnames CTEMaterialize ctematerialized const Node* ctequery const CTESearchClause* search_clause const CTECycleClause* cycle_clause ParseLoc location bool cterecursive int cterefcount const List* ctecolnames const List* ctecoltypes const List* ctecoltypmods const List* ctecolcollations ctypedef struct MergeWhenClause: NodeTag type MergeMatchKind matchKind CmdType commandType OverridingKind override const Node* condition const List* targetList const List* values ctypedef struct TriggerTransition: NodeTag type const char* name bool isNew bool isTable ctypedef struct JsonOutput: NodeTag type const TypeName* typeName const JsonReturning* returning ctypedef struct JsonArgument: NodeTag type const JsonValueExpr* val const char* name ctypedef struct JsonFuncExpr: NodeTag type JsonExprOp op const char* column_name const JsonValueExpr* context_item const Node* pathspec const List* passing const JsonOutput* output const JsonBehavior* on_empty const JsonBehavior* on_error JsonWrapper wrapper JsonQuotes quotes ParseLoc location ctypedef struct JsonTablePathSpec: NodeTag type const Node* string const char* name ParseLoc name_location ParseLoc location ctypedef struct JsonTable: NodeTag type const JsonValueExpr* context_item const JsonTablePathSpec* pathspec const List* passing const List* columns const JsonBehavior* on_error const Alias* alias bool lateral ParseLoc location ctypedef struct JsonTableColumn: NodeTag type JsonTableColumnType coltype const char* name const TypeName* typeName const JsonTablePathSpec* pathspec const JsonFormat* format JsonWrapper wrapper JsonQuotes quotes const List* columns const JsonBehavior* on_empty const JsonBehavior* on_error ParseLoc location ctypedef struct JsonKeyValue: NodeTag type const Expr* key const JsonValueExpr* value ctypedef struct JsonParseExpr: NodeTag type const JsonValueExpr* expr const JsonOutput* output bool unique_keys ParseLoc location ctypedef struct JsonScalarExpr: NodeTag type const Expr* expr const JsonOutput* output ParseLoc location ctypedef struct JsonSerializeExpr: NodeTag type const JsonValueExpr* expr const JsonOutput* output ParseLoc location ctypedef struct JsonObjectConstructor: NodeTag type const List* exprs const JsonOutput* output bool absent_on_null bool unique ParseLoc location ctypedef struct JsonArrayConstructor: NodeTag type const List* exprs const JsonOutput* output bool absent_on_null ParseLoc location ctypedef struct JsonArrayQueryConstructor: NodeTag type const Node* query const JsonOutput* output const JsonFormat* format bool absent_on_null ParseLoc location ctypedef struct JsonAggConstructor: NodeTag type const JsonOutput* output const Node* agg_filter const List* agg_order const WindowDef* over ParseLoc location ctypedef struct JsonObjectAgg: NodeTag type const JsonAggConstructor* constructor const JsonKeyValue* arg bool absent_on_null bool unique ctypedef struct JsonArrayAgg: NodeTag type const JsonAggConstructor* constructor const JsonValueExpr* arg bool absent_on_null ctypedef struct RawStmt: NodeTag type const Node* stmt ParseLoc stmt_location ParseLoc stmt_len ctypedef struct InsertStmt: NodeTag type const RangeVar* relation const List* cols const Node* selectStmt const OnConflictClause* onConflictClause const List* returningList const WithClause* withClause OverridingKind override ctypedef struct DeleteStmt: NodeTag type const RangeVar* relation const List* usingClause const Node* whereClause const List* returningList const WithClause* withClause ctypedef struct UpdateStmt: NodeTag type const RangeVar* relation const List* targetList const Node* whereClause const List* fromClause const List* returningList const WithClause* withClause ctypedef struct MergeStmt: NodeTag type const RangeVar* relation const Node* sourceRelation const Node* joinCondition const List* mergeWhenClauses const List* returningList const WithClause* withClause ctypedef struct SelectStmt: NodeTag type const List* distinctClause const IntoClause* intoClause const List* targetList const List* fromClause const Node* whereClause const List* groupClause bool groupDistinct const Node* havingClause const List* windowClause const List* valuesLists const List* sortClause const Node* limitOffset const Node* limitCount LimitOption limitOption const List* lockingClause const WithClause* withClause SetOperation op bool all const SelectStmt* larg const SelectStmt* rarg ctypedef struct SetOperationStmt: NodeTag type SetOperation op bool all const Node* larg const Node* rarg const List* colTypes const List* colTypmods const List* colCollations const List* groupClauses ctypedef struct ReturnStmt: NodeTag type const Node* returnval ctypedef struct PLAssignStmt: NodeTag type const char* name const List* indirection int nnames const SelectStmt* val ParseLoc location ctypedef struct CreateSchemaStmt: NodeTag type const char* schemaname const RoleSpec* authrole const List* schemaElts bool if_not_exists ctypedef struct AlterTableStmt: NodeTag type const RangeVar* relation const List* cmds ObjectType objtype bool missing_ok ctypedef struct ReplicaIdentityStmt: NodeTag type char identity_type const char* name ctypedef struct AlterTableCmd: NodeTag type AlterTableType subtype const char* name int16_t num const RoleSpec* newowner const Node* def_ "def" DropBehavior behavior bool missing_ok bool recurse ctypedef struct AlterCollationStmt: NodeTag type const List* collname ctypedef struct AlterDomainStmt: NodeTag type char subtype const List* typeName const char* name const Node* def_ "def" DropBehavior behavior bool missing_ok ctypedef struct GrantStmt: NodeTag type bool is_grant GrantTargetType targtype ObjectType objtype const List* objects const List* privileges const List* grantees bool grant_option const RoleSpec* grantor DropBehavior behavior ctypedef struct ObjectWithArgs: NodeTag type const List* objname const List* objargs const List* objfuncargs bool args_unspecified ctypedef struct AccessPriv: NodeTag type const char* priv_name const List* cols ctypedef struct GrantRoleStmt: NodeTag type const List* granted_roles const List* grantee_roles bool is_grant const List* opt const RoleSpec* grantor DropBehavior behavior ctypedef struct AlterDefaultPrivilegesStmt: NodeTag type const List* options const GrantStmt* action ctypedef struct CopyStmt: NodeTag type const RangeVar* relation const Node* query const List* attlist bool is_from bool is_program const char* filename const List* options const Node* whereClause ctypedef struct VariableSetStmt: NodeTag type VariableSetKind kind const char* name const List* args bool is_local ctypedef struct VariableShowStmt: NodeTag type const char* name ctypedef struct CreateStmt: NodeTag type const RangeVar* relation const List* tableElts const List* inhRelations const PartitionBoundSpec* partbound const PartitionSpec* partspec const TypeName* ofTypename const List* constraints const List* options OnCommitAction oncommit const char* tablespacename const char* accessMethod bool if_not_exists ctypedef struct Constraint: NodeTag type ConstrType contype const char* conname bool deferrable bool initdeferred bool skip_validation bool initially_valid bool is_no_inherit const Node* raw_expr const char* cooked_expr char generated_when int inhcount bool nulls_not_distinct const List* keys const List* including const List* exclusions const List* options const char* indexname const char* indexspace bool reset_default_tblspc const char* access_method const Node* where_clause const RangeVar* pktable const List* fk_attrs const List* pk_attrs char fk_matchtype char fk_upd_action char fk_del_action const List* fk_del_set_cols const List* old_conpfeqop ParseLoc location ctypedef struct CreateTableSpaceStmt: NodeTag type const char* tablespacename const RoleSpec* owner const char* location const List* options ctypedef struct DropTableSpaceStmt: NodeTag type const char* tablespacename bool missing_ok ctypedef struct AlterTableSpaceOptionsStmt: NodeTag type const char* tablespacename const List* options bool isReset ctypedef struct AlterTableMoveAllStmt: NodeTag type const char* orig_tablespacename ObjectType objtype const List* roles const char* new_tablespacename bool nowait ctypedef struct CreateExtensionStmt: NodeTag type const char* extname bool if_not_exists const List* options ctypedef struct AlterExtensionStmt: NodeTag type const char* extname const List* options ctypedef struct AlterExtensionContentsStmt: NodeTag type const char* extname int action ObjectType objtype const Node* object ctypedef struct CreateFdwStmt: NodeTag type const char* fdwname const List* func_options const List* options ctypedef struct AlterFdwStmt: NodeTag type const char* fdwname const List* func_options const List* options ctypedef struct CreateForeignServerStmt: NodeTag type const char* servername const char* servertype const char* version const char* fdwname bool if_not_exists const List* options ctypedef struct AlterForeignServerStmt: NodeTag type const char* servername const char* version const List* options bool has_version ctypedef struct CreateForeignTableStmt: CreateStmt base const char* servername const List* options ctypedef struct CreateUserMappingStmt: NodeTag type const RoleSpec* user const char* servername bool if_not_exists const List* options ctypedef struct AlterUserMappingStmt: NodeTag type const RoleSpec* user const char* servername const List* options ctypedef struct DropUserMappingStmt: NodeTag type const RoleSpec* user const char* servername bool missing_ok ctypedef struct ImportForeignSchemaStmt: NodeTag type const char* server_name const char* remote_schema const char* local_schema ImportForeignSchemaType list_type const List* table_list const List* options ctypedef struct CreatePolicyStmt: NodeTag type const char* policy_name const RangeVar* table const char* cmd_name bool permissive const List* roles const Node* qual const Node* with_check ctypedef struct AlterPolicyStmt: NodeTag type const char* policy_name const RangeVar* table const List* roles const Node* qual const Node* with_check ctypedef struct CreateAmStmt: NodeTag type const char* amname const List* handler_name char amtype ctypedef struct CreateTrigStmt: NodeTag type bool replace bool isconstraint const char* trigname const RangeVar* relation const List* funcname const List* args bool row int16_t timing int16_t events const List* columns const Node* whenClause const List* transitionRels bool deferrable bool initdeferred const RangeVar* constrrel ctypedef struct CreateEventTrigStmt: NodeTag type const char* trigname const char* eventname const List* whenclause const List* funcname ctypedef struct AlterEventTrigStmt: NodeTag type const char* trigname char tgenabled ctypedef struct CreatePLangStmt: NodeTag type bool replace const char* plname const List* plhandler const List* plinline const List* plvalidator bool pltrusted ctypedef struct CreateRoleStmt: NodeTag type RoleStmtType stmt_type const char* role const List* options ctypedef struct AlterRoleStmt: NodeTag type const RoleSpec* role const List* options int action ctypedef struct AlterRoleSetStmt: NodeTag type const RoleSpec* role const char* database const VariableSetStmt* setstmt ctypedef struct DropRoleStmt: NodeTag type const List* roles bool missing_ok ctypedef struct CreateSeqStmt: NodeTag type const RangeVar* sequence const List* options bool for_identity bool if_not_exists ctypedef struct AlterSeqStmt: NodeTag type const RangeVar* sequence const List* options bool for_identity bool missing_ok ctypedef struct DefineStmt: NodeTag type ObjectType kind bool oldstyle const List* defnames const List* args const List* definition bool if_not_exists bool replace ctypedef struct CreateDomainStmt: NodeTag type const List* domainname const TypeName* typeName const CollateClause* collClause const List* constraints ctypedef struct CreateOpClassStmt: NodeTag type const List* opclassname const List* opfamilyname const char* amname const TypeName* datatype const List* items bool isDefault ctypedef struct CreateOpClassItem: NodeTag type int itemtype const ObjectWithArgs* name int number const List* order_family const List* class_args const TypeName* storedtype ctypedef struct CreateOpFamilyStmt: NodeTag type const List* opfamilyname const char* amname ctypedef struct AlterOpFamilyStmt: NodeTag type const List* opfamilyname const char* amname bool isDrop const List* items ctypedef struct DropStmt: NodeTag type const List* objects ObjectType removeType DropBehavior behavior bool missing_ok bool concurrent ctypedef struct TruncateStmt: NodeTag type const List* relations bool restart_seqs DropBehavior behavior ctypedef struct CommentStmt: NodeTag type ObjectType objtype const Node* object const char* comment ctypedef struct SecLabelStmt: NodeTag type ObjectType objtype const Node* object const char* provider const char* label ctypedef struct DeclareCursorStmt: NodeTag type const char* portalname int options const Node* query ctypedef struct ClosePortalStmt: NodeTag type const char* portalname ctypedef struct FetchStmt: NodeTag type FetchDirection direction long howMany const char* portalname bool ismove ctypedef struct IndexStmt: NodeTag type const char* idxname const RangeVar* relation const char* accessMethod const char* tableSpace const List* indexParams const List* indexIncludingParams const List* options const Node* whereClause const List* excludeOpNames const char* idxcomment unsigned int oldNumber unsigned int oldCreateSubid unsigned int oldFirstRelfilelocatorSubid bool unique bool nulls_not_distinct bool primary bool isconstraint bool deferrable bool initdeferred bool transformed bool concurrent bool if_not_exists bool reset_default_tblspc ctypedef struct CreateStatsStmt: NodeTag type const List* defnames const List* stat_types const List* exprs const List* relations const char* stxcomment bool transformed bool if_not_exists ctypedef struct StatsElem: NodeTag type const char* name const Node* expr ctypedef struct AlterStatsStmt: NodeTag type const List* defnames const Node* stxstattarget bool missing_ok ctypedef struct CreateFunctionStmt: NodeTag type bool is_procedure bool replace const List* funcname const List* parameters const TypeName* returnType const List* options const Node* sql_body ctypedef struct FunctionParameter: NodeTag type const char* name const TypeName* argType FunctionParameterMode mode const Node* defexpr ctypedef struct AlterFunctionStmt: NodeTag type ObjectType objtype const ObjectWithArgs* func const List* actions ctypedef struct DoStmt: NodeTag type const List* args ctypedef struct InlineCodeBlock: NodeTag type const char* source_text bool langIsTrusted bool atomic ctypedef struct CallStmt: NodeTag type const FuncCall* funccall const FuncExpr* funcexpr const List* outargs ctypedef struct CallContext: NodeTag type bool atomic ctypedef struct RenameStmt: NodeTag type ObjectType renameType ObjectType relationType const RangeVar* relation const Node* object const char* subname const char* newname DropBehavior behavior bool missing_ok ctypedef struct AlterObjectDependsStmt: NodeTag type ObjectType objectType const RangeVar* relation const Node* object const String* extname bool remove ctypedef struct AlterObjectSchemaStmt: NodeTag type ObjectType objectType const RangeVar* relation const Node* object const char* newschema bool missing_ok ctypedef struct AlterOwnerStmt: NodeTag type ObjectType objectType const RangeVar* relation const Node* object const RoleSpec* newowner ctypedef struct AlterOperatorStmt: NodeTag type const ObjectWithArgs* opername const List* options ctypedef struct AlterTypeStmt: NodeTag type const List* typeName const List* options ctypedef struct RuleStmt: NodeTag type const RangeVar* relation const char* rulename const Node* whereClause CmdType event bool instead const List* actions bool replace ctypedef struct NotifyStmt: NodeTag type const char* conditionname const char* payload ctypedef struct ListenStmt: NodeTag type const char* conditionname ctypedef struct UnlistenStmt: NodeTag type const char* conditionname ctypedef struct TransactionStmt: NodeTag type TransactionStmtKind kind const List* options const char* savepoint_name const char* gid bool chain ParseLoc location ctypedef struct CompositeTypeStmt: NodeTag type const RangeVar* typevar const List* coldeflist ctypedef struct CreateEnumStmt: NodeTag type const List* typeName const List* vals ctypedef struct CreateRangeStmt: NodeTag type const List* typeName const List* params ctypedef struct AlterEnumStmt: NodeTag type const List* typeName const char* oldVal const char* newVal const char* newValNeighbor bool newValIsAfter bool skipIfNewValExists ctypedef struct ViewStmt: NodeTag type const RangeVar* view const List* aliases const Node* query bool replace const List* options ViewCheckOption withCheckOption ctypedef struct LoadStmt: NodeTag type const char* filename ctypedef struct CreatedbStmt: NodeTag type const char* dbname const List* options ctypedef struct AlterDatabaseStmt: NodeTag type const char* dbname const List* options ctypedef struct AlterDatabaseRefreshCollStmt: NodeTag type const char* dbname ctypedef struct AlterDatabaseSetStmt: NodeTag type const char* dbname const VariableSetStmt* setstmt ctypedef struct DropdbStmt: NodeTag type const char* dbname bool missing_ok const List* options ctypedef struct AlterSystemStmt: NodeTag type const VariableSetStmt* setstmt ctypedef struct ClusterStmt: NodeTag type const RangeVar* relation const char* indexname const List* params ctypedef struct VacuumStmt: NodeTag type const List* options const List* rels bool is_vacuumcmd ctypedef struct VacuumRelation: NodeTag type const RangeVar* relation const List* va_cols ctypedef struct ExplainStmt: NodeTag type const Node* query const List* options ctypedef struct CreateTableAsStmt: NodeTag type const Node* query const IntoClause* into ObjectType objtype bool is_select_into bool if_not_exists ctypedef struct RefreshMatViewStmt: NodeTag type bool concurrent bool skipData const RangeVar* relation ctypedef struct CheckPointStmt: NodeTag type ctypedef struct DiscardStmt: NodeTag type DiscardMode target ctypedef struct LockStmt: NodeTag type const List* relations int mode bool nowait ctypedef struct ConstraintsSetStmt: NodeTag type const List* constraints bool deferred ctypedef struct ReindexStmt: NodeTag type ReindexObjectType kind const RangeVar* relation const char* name const List* params ctypedef struct CreateConversionStmt: NodeTag type const List* conversion_name const char* for_encoding_name const char* to_encoding_name const List* func_name bool def_ "def" ctypedef struct CreateCastStmt: NodeTag type const TypeName* sourcetype const TypeName* targettype const ObjectWithArgs* func CoercionContext context bool inout ctypedef struct CreateTransformStmt: NodeTag type bool replace const TypeName* type_name const char* lang const ObjectWithArgs* fromsql const ObjectWithArgs* tosql ctypedef struct PrepareStmt: NodeTag type const char* name const List* argtypes const Node* query ctypedef struct ExecuteStmt: NodeTag type const char* name const List* params ctypedef struct DeallocateStmt: NodeTag type const char* name bool isall ParseLoc location ctypedef struct DropOwnedStmt: NodeTag type const List* roles DropBehavior behavior ctypedef struct ReassignOwnedStmt: NodeTag type const List* roles const RoleSpec* newrole ctypedef struct AlterTSDictionaryStmt: NodeTag type const List* dictname const List* options ctypedef struct AlterTSConfigurationStmt: NodeTag type AlterTSConfigType kind const List* cfgname const List* tokentype const List* dicts bool override bool replace bool missing_ok ctypedef struct PublicationTable: NodeTag type const RangeVar* relation const Node* whereClause const List* columns ctypedef struct PublicationObjSpec: NodeTag type PublicationObjSpecType pubobjtype const char* name const PublicationTable* pubtable ParseLoc location ctypedef struct CreatePublicationStmt: NodeTag type const char* pubname const List* options const List* pubobjects bool for_all_tables ctypedef struct AlterPublicationStmt: NodeTag type const char* pubname const List* options const List* pubobjects bool for_all_tables AlterPublicationAction action ctypedef struct CreateSubscriptionStmt: NodeTag type const char* subname const char* conninfo const List* publication const List* options ctypedef struct AlterSubscriptionStmt: NodeTag type AlterSubscriptionType kind const char* subname const char* conninfo const List* publication const List* options ctypedef struct DropSubscriptionStmt: NodeTag type const char* subname bool missing_ok DropBehavior behavior cdef extern from "nodes/primnodes.h": ctypedef struct Alias: NodeTag type const char* aliasname const List* colnames ctypedef struct RangeVar: NodeTag type const char* catalogname const char* schemaname const char* relname bool inh char relpersistence const Alias* alias ParseLoc location ctypedef struct TableFunc: NodeTag type TableFuncType functype const List* ns_uris const List* ns_names const Node* docexpr const Node* rowexpr const List* colnames const List* coltypes const List* coltypmods const List* colcollations const List* colexprs const List* coldefexprs const List* colvalexprs const List* passingvalexprs const Bitmapset* notnulls const Node* plan int ordinalitycol ParseLoc location ctypedef struct IntoClause: NodeTag type const RangeVar* rel const List* colNames const char* accessMethod const List* options OnCommitAction onCommit const char* tableSpaceName const Node* viewQuery bool skipData ctypedef struct Expr: NodeTag type ctypedef struct Var: int varno int varattno int32_t vartypmod const Bitmapset* varnullingrels unsigned int varlevelsup ParseLoc location ctypedef struct Param: ParamKind paramkind int paramid int32_t paramtypmod ParseLoc location ctypedef struct Aggref: const List* aggargtypes const List* aggdirectargs const List* args const List* aggorder const List* aggdistinct const Expr* aggfilter bool aggstar bool aggvariadic char aggkind unsigned int agglevelsup AggSplit aggsplit int aggno int aggtransno ParseLoc location ctypedef struct GroupingFunc: const List* args const List* refs unsigned int agglevelsup ParseLoc location ctypedef struct WindowFunc: const List* args const Expr* aggfilter const List* runCondition unsigned int winref bool winstar bool winagg ParseLoc location ctypedef struct WindowFuncRunCondition: bool wfunc_left const Expr* arg ctypedef struct MergeSupportFunc: ParseLoc location ctypedef struct SubscriptingRef: int32_t reftypmod const List* refupperindexpr const List* reflowerindexpr const Expr* refexpr const Expr* refassgnexpr ctypedef struct FuncExpr: bool funcretset bool funcvariadic CoercionForm funcformat const List* args ParseLoc location ctypedef struct NamedArgExpr: const Expr* arg const char* name int argnumber ParseLoc location ctypedef struct OpExpr: bool opretset const List* args ParseLoc location ctypedef struct ScalarArrayOpExpr: bool useOr const List* args ParseLoc location ctypedef struct BoolExpr: BoolExprType boolop const List* args ParseLoc location ctypedef struct SubLink: SubLinkType subLinkType int subLinkId const Node* testexpr const List* operName const Node* subselect ParseLoc location ctypedef struct SubPlan: SubLinkType subLinkType const Node* testexpr const List* paramIds int plan_id const char* plan_name int32_t firstColTypmod bool useHashTable bool unknownEqFalse bool parallel_safe const List* setParam const List* parParam const List* args double startup_cost double per_call_cost ctypedef struct AlternativeSubPlan: const List* subplans ctypedef struct FieldSelect: const Expr* arg int fieldnum int32_t resulttypmod ctypedef struct FieldStore: const Expr* arg const List* newvals const List* fieldnums ctypedef struct RelabelType: const Expr* arg int32_t resulttypmod CoercionForm relabelformat ParseLoc location ctypedef struct CoerceViaIO: const Expr* arg CoercionForm coerceformat ParseLoc location ctypedef struct ArrayCoerceExpr: const Expr* arg const Expr* elemexpr int32_t resulttypmod CoercionForm coerceformat ParseLoc location ctypedef struct ConvertRowtypeExpr: const Expr* arg CoercionForm convertformat ParseLoc location ctypedef struct CollateExpr: const Expr* arg ParseLoc location ctypedef struct CaseExpr: const Expr* arg const List* args const Expr* defresult ParseLoc location ctypedef struct CaseWhen: const Expr* expr const Expr* result ParseLoc location ctypedef struct CaseTestExpr: int32_t typeMod ctypedef struct ArrayExpr: const List* elements bool multidims ParseLoc location ctypedef struct RowExpr: const List* args CoercionForm row_format const List* colnames ParseLoc location ctypedef struct RowCompareExpr: RowCompareType rctype const List* opnos const List* opfamilies const List* inputcollids const List* largs const List* rargs ctypedef struct CoalesceExpr: const List* args ParseLoc location ctypedef struct MinMaxExpr: MinMaxOp op const List* args ParseLoc location ctypedef struct SQLValueFunction: SQLValueFunctionOp op int32_t typmod ParseLoc location ctypedef struct XmlExpr: XmlExprOp op const char* name const List* named_args const List* arg_names const List* args XmlOptionType xmloption bool indent int32_t typmod ParseLoc location ctypedef struct JsonFormat: NodeTag type JsonFormatType format_type JsonEncoding encoding ParseLoc location ctypedef struct JsonReturning: NodeTag type const JsonFormat* format int32_t typmod ctypedef struct JsonValueExpr: NodeTag type const Expr* raw_expr const Expr* formatted_expr const JsonFormat* format ctypedef struct JsonConstructorExpr: JsonConstructorType type const List* args const Expr* func const Expr* coercion const JsonReturning* returning bool absent_on_null bool unique ParseLoc location ctypedef struct JsonIsPredicate: NodeTag type const Node* expr const JsonFormat* format JsonValueType item_type bool unique_keys ParseLoc location ctypedef struct JsonBehavior: NodeTag type JsonBehaviorType btype const Node* expr bool coerce ParseLoc location ctypedef struct JsonExpr: JsonExprOp op const char* column_name const Node* formatted_expr const JsonFormat* format const Node* path_spec const JsonReturning* returning const List* passing_names const List* passing_values const JsonBehavior* on_empty const JsonBehavior* on_error bool use_io_coercion bool use_json_coercion JsonWrapper wrapper bool omit_quotes ParseLoc location ctypedef struct NullTest: const Expr* arg NullTestType nulltesttype bool argisrow ParseLoc location ctypedef struct BooleanTest: const Expr* arg BoolTestType booltesttype ParseLoc location ctypedef struct MergeAction: NodeTag type MergeMatchKind matchKind CmdType commandType OverridingKind override const Node* qual const List* targetList const List* updateColnos ctypedef struct CoerceToDomain: const Expr* arg int32_t resulttypmod CoercionForm coercionformat ParseLoc location ctypedef struct CoerceToDomainValue: int32_t typeMod ParseLoc location ctypedef struct SetToDefault: int32_t typeMod ParseLoc location ctypedef struct CurrentOfExpr: unsigned int cvarno const char* cursor_name int cursor_param ctypedef struct InferenceElem: const Node* expr ctypedef struct TargetEntry: const Expr* expr int resno const char* resname unsigned int ressortgroupref int resorigcol bool resjunk ctypedef struct RangeTblRef: NodeTag type int rtindex ctypedef struct JoinExpr: NodeTag type JoinType jointype bool isNatural const Node* larg const Node* rarg const List* usingClause const Alias* join_using_alias const Node* quals const Alias* alias int rtindex ctypedef struct FromExpr: NodeTag type const List* fromlist const Node* quals ctypedef struct OnConflictExpr: NodeTag type OnConflictAction action const List* arbiterElems const Node* arbiterWhere const List* onConflictSet const Node* onConflictWhere int exclRelIndex const List* exclRelTlist cdef extern from "nodes/value.h": ctypedef struct Integer: long ival ctypedef struct Float: const char* fval ctypedef struct Boolean: bool boolval ctypedef struct String: const char* sval ctypedef struct BitString: const char* bsval ctypedef struct A_Const: bool isnull ValUnion val pglast-7.7/pglast/visitors.py000066400000000000000000000422371477366773500164500ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Visitors base machinery # :Created: dom 9 mag 2021, 16:15:05 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021, 2022, 2024 Lele Gaifax # from collections import deque from inspect import getmembers, ismethod from . import ast from .stream import maybe_double_quote_name class ActionMeta(type): "Metaclass used to implement action singleton." def __repr__(cls): return cls.__name__ class Action(metaclass=ActionMeta): "Abstract action singleton." def __new__(cls): # pragma: no cover return cls class Add(Action): "Marker used to tell the iterator to insert nodes in the current sequence." class Continue(Action): "Marker used to tell the iterator to keep going." class Delete(Action): "Marker used to tell the iterator to delete current node." class Skip(Action): "Marker used to tell the iterator to not descend into the current node." class Ancestor: """Simple object to keep track of the node's ancestors while it's being visited. :param Ancestor parent: the parent of the new instance :param node: the tracked object :param member: either the name of the attribute or the index in the sequence that points to the tracked object in the parent container An instance of this class represent a particular ancestor in the hierarchy chain: it carries a reference that points to the higher item in the chain, the associated :class:`.ast.Node` instance and a *member*, either the attribute name or sequential index in the parent node: the latter happens when the parent node is actually a tuple, not an ``Node`` instance. Accessing an instance with a positive index returns the nth node up in the hierarchy. When applied (using the ``@`` operator) to an :class:`.ast.Node` instance will traverse that node returning the leaf one corresponding to the whole chain. Example: .. testsetup:: * from pglast import parse_sql from pglast.visitors import Ancestor .. doctest:: >>> tree = parse_sql('select 1') >>> root = Ancestor() >>> root ROOT >>> root@tree is tree True >>> root[0] is None True >>> select_stmt_path = root / (tree, 0) / (tree[0], 'stmt') >>> select_stmt_path ROOT → 0 → stmt >>> select_stmt_path@tree is tree[0].stmt True >>> select_stmt_path[0] is tree[0] True >>> columns_path = (select_stmt_path ... / (tree[0].stmt, 'targetList')) >>> first_col_path = (columns_path ... / (tree[0].stmt.targetList[0], 0)) >>> first_col_path ROOT → 0 → stmt → targetList → 0 >>> first_col_path[0] >> >>> first_col_path[1] is columns_path[0] True As said, the `node` is not always a :class:`.ast.Node`, but may be a tuple, possibly containing *subtuples*, for example the ``functions`` slot of :class:`~.ast.RangeFunction` that is a tuple of tuples, each containing a :class:`~.ast.FuncCall` and possibly other values: .. testsetup:: * from pglast.visitors import Visitor .. doctest:: >>> tree = parse_sql('SELECT * FROM ROWS' ... ' FROM (generate_series(10,11),' ... ' get_users())') >>> class VerboseVisitor(Visitor): ... all_ancestors = [] ... def visit(self, ancestors, node): ... print(f'{len(self.all_ancestors):2d}.', ... "node:", type(node).__name__, ... "ancestor:", type(ancestors.node).__name__) ... self.all_ancestors.append(ancestors) >>> VerboseVisitor()(tree) 0. node: RawStmt ancestor: tuple 1. node: SelectStmt ancestor: RawStmt 2. node: ResTarget ancestor: tuple 3. node: RangeFunction ancestor: tuple 4. node: ColumnRef ancestor: ResTarget 5. node: A_Star ancestor: tuple 6. node: FuncCall ancestor: tuple 7. node: FuncCall ancestor: tuple 8. node: String ancestor: tuple 9. node: A_Const ancestor: tuple 10. node: A_Const ancestor: tuple 11. node: String ancestor: tuple 12. node: Integer ancestor: A_Const 13. node: Integer ancestor: A_Const ... To find the closest ancestor that is actually pointing to an AST node you may use the ``abs()`` function: .. doctest:: >>> range_function = tree[0].stmt.fromClause[0] >>> gen_series_funccall = range_function.functions[0][0] >>> gen_series_funccall ,) ...> >>> generate_series_ancestry = VerboseVisitor.all_ancestors[6] >>> generate_series_ancestry@tree is gen_series_funccall True >>> abs(generate_series_ancestry).node is range_function True As an aid to visitors that apply changes to the AST, there are two methods, :meth:`update` and :meth:`apply`, that takes care of the different cases, when `node` is an AST instance or instead it's a tuple (or subtuple); the former does not directly change the AST tree, but postpones that when the latter is called. """ __slots__ = ('parent', 'node', 'member', 'pending_update') def __init__(self, parent=None, node=None, member=None): self.parent = parent self.node = node self.member = member self.pending_update = None def _iter_members(self): "Return the sequence of `member` of the whole hierarchy." ancestors = [] path = self while True: ancestors.append(path.member) if path.parent is None: return reversed(ancestors) path = path.parent def __repr__(self): return ' → '.join('ROOT' if m is None else str(m) for m in self._iter_members()) def __getitem__(self, n): path = self while n > 0: path = path.parent n -= 1 return path.node def __abs__(self): path = self while path: if isinstance(path.node, ast.Node): return path path = path.parent def find_nearest(self, cls): "Find the nearest ancestor with a node of the given `cls`." path = self while True: if isinstance(path.node, cls): return path path = path.parent if path is None: break def __contains__(self, cls): "Tell whether there is a node of type `cls` in the ancestry." return self.find_nearest(cls) is not None def __truediv__(self, node_and_member): "Create a new instance pointing to the given child node." return Ancestor(self, *node_and_member) def __matmul__(self, root): "Resolve the ancestry chain against the given `root` node, returning the leaf node." node = root for member in self._iter_members(): if member is not None: if isinstance(member, int): node = node[member] else: node = getattr(node, member) return node def update(self, new_value): "Set `new_value` as a pending change to the tracked node." if isinstance(self.member, int): # We are pointing to one particular item in a tuple, so we need to build a new one, # replacing it with the new value and then update the parent node accordingly: # since there may be further changes, temporarily use a list instead of a tuple, at # apply() time it will be coerced back to a tuple. Note that there are "list of # lists" cases, that are handled at apply time. if self.parent.pending_update is None: self.parent.pending_update = list(self.node) self.parent.pending_update[self.member] = new_value return self.parent else: self.pending_update = new_value return self def apply(self): "Apply the pending change, if any, to the actual node." if self.pending_update is not None: if isinstance(self.pending_update, list): value = tuple(filter(lambda item: item is not Delete, self.pending_update)) else: value = self.pending_update if isinstance(self.member, int): pvalue = list(self.node) pvalue[self.member] = value or None self.parent.update(pvalue) self.parent.apply() else: if self.member is None: self.node = value or None else: setattr(self.node, self.member, value or None) self.pending_update = None class Visitor: """Base class implementing the `visitor pattern`__. __ https://en.wikipedia.org/wiki/Visitor_pattern To use it, you shall write a subclass that implements a set of particular named methods, specifically ``visit_XYZ`` where ``XYZ`` is the name of a class name defined in the :mod:`pglast.ast` module. Instances of this class are *callables* and accept either a :class:`.ast.Node` instance or a sequence of instances, typically the result of :func:`parse_sql `. The argument will be *traversed* in a `breadth first`__ order and each :class:`Node <.ast.Node>` instance will be passed to the corresponding ``visit_XYZ`` method if it is implemented, falling back to the default ``visit`` method. If none of them are defined, the node will be ignored. The ``visit_XYZ`` methods receive two arguments: the *ancestry chain* of the node, an instance of :class:`Ancestor` and the :class:`Node <.ast.Node>` instance itself. The methods may return either ``None``, an *action* or a new node that will replace the original one. __ https://en.wikipedia.org/wiki/Breadth-first_search """ def __call__(self, root): "Iteratively visit the `root` node calling related ``visit_XYZ`` methods." self.root = root by_ast_class = {} for name, method in getmembers(self, ismethod): if not name.startswith('visit_'): continue clsname = name[6:] cls = getattr(ast, clsname, None) if cls is not None: by_ast_class[cls] = method default_method = self.visit generator = self.iterate(root) try: ancestors, node = generator.send(None) except StopIteration: return while True: method = by_ast_class.get(node.__class__, default_method) if method is not None: result = method(ancestors, node) else: result = None try: ancestors, node = generator.send(Continue if result is None else result) except StopIteration: break return self.root def iterate(self, node): """Iterate thru `node`'s AST using a breadth-first traversing. :param node: either a :class:`.ast.Node` instance or a tuple of those This is a generator, that yields ``Node`` instances together with their *ancestors chain* as it finds them while traversing the tree. """ pending_updates = [] todo = deque() if isinstance(node, (tuple, ast.Node)): todo.append((Ancestor(), node)) else: raise ValueError('Bad argument, expected a ast.Node instance or a tuple') while todo: ancestors, node = todo.popleft() # Here `node` may be either one AST node, a tuple of AST nodes (e.g. # SelectStmt.targetList), or even a tuple of tuples of AST nodes (e.g. # SelectStmt.valuesList). To simplify code, coerce it to a sequence. is_sequence = isinstance(node, tuple) if is_sequence: nodes = list(node) else: nodes = [node] index = 0 while nodes: sub_node = nodes.pop(0) if is_sequence: sub_ancestors = ancestors / (node, index) else: sub_ancestors = ancestors if isinstance(sub_node, ast.Node): action = yield sub_ancestors, sub_node if action is Continue: for member in sub_node: value = getattr(sub_node, member) if isinstance(value, (tuple, ast.Node)): todo.append((sub_ancestors / (sub_node, member), value)) elif action is Skip: pass else: pending_updates.append(sub_ancestors.update(action)) elif isinstance(sub_node, tuple): for sub_index, value in enumerate(sub_node): if isinstance(value, (tuple, ast.Node)): todo.append((sub_ancestors / (sub_node, sub_index), value)) index += 1 for pending_update in pending_updates: pending_update.apply() if pending_update.member is None: self.root = pending_update.node visit = None """ The default *visit* method for any node without a specific one. When ``None``, nothing happens. """ class ReferencedRelations(Visitor): """Concrete implementation of the :func:`.referenced_relations` function. :param set cte_names: the set of surrounding CTE names :param WithClause skip_with_clause: skip this clause, when specified Calling an instance of this class will return a set of the names of the relations referenced by the given :class:`node `. """ def __init__(self, cte_names=None, skip_with_clause=None): super().__init__() self.cte_names = set() if cte_names is None else cte_names.copy() self.skip_with_clause = skip_with_clause self.r_names = set() def __call__(self, node): super().__call__(node) return self.r_names def visit_DropStmt(self, ancestors, node): from .enums import ObjectType if node.removeType in (ObjectType.OBJECT_TABLE, ObjectType.OBJECT_VIEW): for obj in node.objects: self.r_names.add('.'.join(maybe_double_quote_name(n.sval) for n in obj)) def visit_SelectStmt(self, ancestors, node): if node.withClause and node.withClause is not self.skip_with_clause: # CTEs are tricky to get right, as issue #106 demonstrates! # # We must first collect the CTE names as well as the table referenced by their # queries, and then process the statement with that knowledge. # # In the normal case, each CTE must be processed in order, with the CTE names found # earlier; in the "WITH RECURSIVE" case all its CTEs must be considered valid at # the same time. with_clause = node.withClause if with_clause.recursive: self.cte_names.update(maybe_double_quote_name(cte.ctename) for cte in with_clause.ctes) self.r_names.update(ReferencedRelations(self.cte_names)(with_clause)) else: for cte in with_clause.ctes: cte_name = maybe_double_quote_name(cte.ctename) self.r_names.update(ReferencedRelations(self.cte_names)(cte)) self.cte_names.add(cte_name) self.r_names.update(ReferencedRelations(self.cte_names, with_clause)(node)) return Skip visit_UpdateStmt = visit_InsertStmt = visit_DeleteStmt = visit_SelectStmt def visit_WithClause(self, ancestors, node): if node is self.skip_with_clause: return Skip def visit_RangeVar(self, ancestors, node): "Collect relation names, taking into account defined CTE names" tname = maybe_double_quote_name(node.relname) if node.schemaname: tname = f'{maybe_double_quote_name(node.schemaname)}.{tname}' if node.catalogname: tname = f'{maybe_double_quote_name(node.catalogname)}.{tname}' if tname not in self.cte_names: self.r_names.add(tname) def referenced_relations(stmt): """Return the set of relation names referenced in the given `stmt`. :param stmt: either a string containing the ``SQL`` statement or a :class:`.ast.Node` instance :returns: a set of strings, the names of the relations Example: .. testsetup:: from pglast.visitors import referenced_relations .. doctest:: >>> referenced_relations('WITH q1(x,y) AS (SELECT 1,2)' ... ' SELECT * FROM q1, q2') {'q2'} """ from .parser import parse_sql return ReferencedRelations()(parse_sql(stmt) if isinstance(stmt, str) else stmt) pglast-7.7/requirements-test.txt000066400000000000000000000005621477366773500171560ustar00rootroot00000000000000# -*- coding: utf-8; mode: conf-unix -*- # :Project: pglast — Test requirements # :Created: lun 07 ago 2017 00:43:41 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Lele Gaifax # coverage==7.8.0 pytest-cov==6.1.0 pytest==8.3.5 pglast-7.7/requirements.txt000066400000000000000000000007331477366773500162010ustar00rootroot00000000000000# -*- coding: utf-8; mode: conf-unix -*- # :Project: pglast — Development requirements # :Created: ven 04 ago 2017 08:40:30 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025 Lele Gaifax -r requirements-test.txt bump-my-version==1.1.1 cython==3.0.12 pycparser==2.22 readme-renderer==44.0 setuptools==78.1.0 sphinx==8.2.3 twine==6.1.0 pglast-7.7/setup.cfg000066400000000000000000000011051477366773500145300ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Additional package configuration # :Created: ven 04 ago 2017 08:54:55 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2021, 2024 Lele Gaifax # [tool:pytest] addopts=--cov=pglast --cov-report term-missing [coverage:report] exclude_lines = pragma: no cover def __repr__ raise AssertionError raise NotImplementedError if __name__ == .__main__.: show_missing = True skip_covered = True [flake8] max-line-length = 95 pglast-7.7/setup.py000066400000000000000000000061211477366773500144240ustar00rootroot00000000000000# -*- coding: utf-8; mode: python -*- # :Project: pglast — PostgreSQL Languages AST # :Created: mer 02 ago 2017 15:20:43 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2024, 2025 Lele Gaifax # from pathlib import Path import subprocess import sys from setuptools import Extension, setup, find_packages from setuptools.command.build_ext import build_ext here = Path(__file__).absolute().parent with (here / 'README.rst').open(encoding='utf-8') as f: README = f.read() with (here / 'CHANGES.rst').open(encoding='utf-8') as f: CHANGES = f.read() LIBPG_QUERY_DIR = here / 'libpg_query' INCLUDE_DIR = LIBPG_QUERY_DIR / 'src' / 'postgres' / 'include' VENDOR_DIR = LIBPG_QUERY_DIR / 'vendor' class BuildLibPgQueryFirst(build_ext): def run(self): if sys.platform == 'win32': make = ['nmake', '/F', 'Makefile.msvc', 'build'] else: make = ['make', '-s', 'build'] subprocess.check_call(make, cwd=LIBPG_QUERY_DIR) super().run() setup( name="pglast", version="7.7", url="https://github.com/lelit/pglast", description="PostgreSQL Languages AST and statements prettifier", long_description=README + '\n\n' + CHANGES, long_description_content_type='text/x-rst', author="Lele Gaifax", author_email="lele@metapensiero.it", license="GPL-3.0-or-later", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: SQL", # "Programming Language :: PL/SQL", "Topic :: Database", "Topic :: Utilities", ], keywords="postgresql parser sql prettifier", packages=find_packages('.'), cmdclass={'build_ext': BuildLibPgQueryFirst}, ext_modules=[ Extension('pglast.parser', sources=['pglast/parser.c'], libraries=['pg_query'], include_dirs=list( map(str, (LIBPG_QUERY_DIR, VENDOR_DIR, INCLUDE_DIR) + ((INCLUDE_DIR / 'port' / 'win32', INCLUDE_DIR / 'port' / 'win32_msvc') if sys.platform == 'win32' else ()))), library_dirs=[str(LIBPG_QUERY_DIR)]), ], install_requires=[ 'setuptools', ], extras_require={ 'dev': [ 'cython', 'metapensiero.tool.bump_version', 'pycparser', 'readme_renderer', ] }, entry_points="""\ [console_scripts] pgpp = pglast.__main__:main """, ) pglast-7.7/tests/000077500000000000000000000000001477366773500140545ustar00rootroot00000000000000pglast-7.7/tests/test_ast.py000066400000000000000000000127421477366773500162620ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Tests ast module # :Created: sab 29 mag 2021, 21:25:46 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021, 2022, 2023, 2024 Lele Gaifax # import pytest from pglast import ast, enums, parse_sql def test_compare(): assert ast.String() != ast.Integer() def test_bad_values(): with pytest.raises(ValueError) as e: ast.VariableShowStmt({'@': 'SelectStmt'}) assert "expected 'VariableShowStmt', got 'SelectStmt'" in str(e.value) def test_call(): raw = parse_sql('select 1')[0] assert raw(0) == {'@': 'RawStmt', 'stmt': ..., 'stmt_len': 0, 'stmt_location': 0} assert raw(1)['stmt']['targetList'] == ... assert raw(1)['stmt']['targetList'] != 1 raw = parse_sql('alter table t add constraint c' ' exclude using gist (f with operator(&&))')[0] assert raw.stmt.cmds[0].def_(None, skip_none=True)['exclusions'] == ( ({'@': 'IndexElem', 'name': 'f', 'ordering': {'#': 'SortByDir', 'name': 'SORTBY_DEFAULT', 'value': 0}, 'nulls_ordering': {'#': 'SortByNulls', 'name': 'SORTBY_NULLS_DEFAULT', 'value': 0}}, ({'@': 'String', 'sval': '&&'},)), ) def test_setattr(): raw = ast.RawStmt() with pytest.raises(ValueError): raw.stmt = 'foo' raw.stmt = {'@': 'SelectStmt', 'all': True} with pytest.raises(ValueError): raw.stmt = {'@': 'SelectStmt', 'all': 'foo'} raw.stmt = {'@': 'SelectStmt', 'fromClause': ({'@': 'RangeVar', 'relname': 'sometable', 'relpersistence': 'p'},)} raw.stmt = {'@': 'SelectStmt', 'fromClause': ({'@': 'RangeVar', 'relname': 'sometable', 'relpersistence': ord('p')},)} with pytest.raises(ValueError): raw.stmt = {'@': 'SelectStmt', 'fromClause': ({'@': 'RangeVar', 'relname': 'sometable', 'relpersistence': 'foo'},)} raw.stmt = {'@': 'VariableShowStmt', 'name': 'all'} with pytest.raises(ValueError): raw.stmt = {'@': 'VariableShowStmt', 'name': True} with pytest.raises(ValueError): raw.stmt = {'@': 'SelectStmt', 'limitOption': {'#': 'foo'}} raw.stmt = {'@': 'SelectStmt', 'limitOption': {'#': 'LimitOption', 'name': 'LIMIT_OPTION_DEFAULT'}} raw.stmt = {'@': 'SelectStmt', 'limitOption': {'#': 'LimitOption', 'value': 0}} with pytest.raises(ValueError): raw.stmt = {'@': 'SelectStmt', 'limitOption': {'#': 'LimitOption'}} with pytest.raises(ValueError): raw.stmt = {'@': 'SelectStmt', 'limitOption': {'#': 'LimitOption', 'name': 'foo'}} with pytest.raises(ValueError): raw.stmt = {'@': 'SelectStmt', 'limitOption': {'#': 'LimitOption', 'value': -1}} raw.stmt = {'@': 'FunctionParameter'} raw.stmt.argType = {'@': 'TypeName'} raw.stmt = ast.CreateForeignTableStmt() raw.stmt.base = {'@': 'CreateStmt'} def test_issue_97(): ast.SubLink({ "@": "SubLink", "subLinkType": enums.SubLinkType.ANY_SUBLINK, "testexpr": ast.ColumnRef( { "@": "ColumnRef", "fields": ( ast.String({"@": "String", "val": "tab"}), ast.String({"@": "String", "val": "_id"}), ), } ), }) def test_issue_138(): raw = parse_sql('select * from foo')[0] ast.RawStmt(raw()) def test_issue_153(): selstmt = parse_sql('select t.y from f(5) as t')[0].stmt serialized = selstmt() assert serialized['@'] == 'SelectStmt' clone = ast.SelectStmt(serialized) orig_fromc = selstmt.fromClause[0] orig_fc_funcs = orig_fromc.functions clone_fromc = clone.fromClause[0] clone_fc_funcs = clone_fromc.functions assert orig_fc_funcs == clone_fc_funcs assert selstmt == clone def test_issue_153b(): serialized = { '@': 'RangeFunction', 'alias': {'@': 'Alias', 'aliasname': 'tmp', 'colnames': None}, 'coldeflist': None, 'functions': (({'@': 'FuncCall', 'agg_distinct': False, 'agg_filter': None, 'agg_order': None, 'agg_star': False, 'agg_within_group': False, 'args': ({'@': 'A_Const', 'isnull': False, 'val': {'@': 'Integer', 'ival': 5}},), 'func_variadic': False, 'funcformat': {'#': 'CoercionForm', 'name': 'COERCE_EXPLICIT_CALL', 'value': 0}, 'funcname': ({'@': 'String', 'sval': 'f'},), 'location': 21, 'over': None}, None),), 'is_rowsfrom': False, 'lateral': False, 'ordinality': False} rf = ast.RangeFunction(serialized) assert isinstance(rf.functions[0][0], ast.FuncCall) pglast-7.7/tests/test_cli.py000066400000000000000000000211551477366773500162400ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Test the __main__.py module # :Created: lun 07 ago 2017 12:50:37 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2024 Lele Gaifax # from contextlib import _RedirectStream, redirect_stdout from io import StringIO from os import unlink from tempfile import NamedTemporaryFile import pytest from pglast.__main__ import main class redirect_stdin(_RedirectStream): _stream = "stdin" class UnclosableStream(StringIO): def close(self): pass def test_cli_workhorse(): with StringIO() as output: with redirect_stdout(output): with pytest.raises(SystemExit) as status: main(['-h']) assert status.value.args[0] == 0 assert 'usage:' in output.getvalue() with StringIO("Select foo,bar Fron sometable") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): with pytest.raises(SystemExit) as status: main([]) assert str(status.value.args[0]) == \ 'syntax error at or near "sometable", at index 20' with StringIO("Select foo,bar From sometable Where foo<>0") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main([]) assert output.getvalue() == """\ SELECT foo , bar FROM sometable WHERE foo <> 0 """ output = NamedTemporaryFile(delete=False) try: main(['-S', "select 1", '-', output.name]) with open(output.name) as f: assert f.read() == "SELECT 1\n" finally: try: unlink(output.name) except PermissionError: # This happens under Windows, for some reason the file is still # in use... pass with StringIO("Select 1") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--parse-tree']) assert "'val': {'@': 'Integer', 'ival': 1}" in output.getvalue() with StringIO("select a,b,c from st where a='foo'") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--normalize']) assert output.getvalue() == "SELECT a, b, c FROM st WHERE a = 'foo'\n" with StringIO("""\ CREATE FUNCTION add (a integer, b integer) RETURNS integer AS $$ BEGIN RETURN a + b; END; $$ LANGUAGE plpgsql""") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--plpgsql', '--parse-tree']) assert '"PLpgSQL_function":' in output.getvalue() with StringIO("Select 1") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main([]) assert output.getvalue() == "SELECT 1\n" with StringIO("Select 1;") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main([]) assert output.getvalue() == "SELECT 1\n" with StringIO("Select 1; Select 2") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main([]) assert output.getvalue() == "SELECT 1;\n\nSELECT 2\n" with StringIO("Select 1; Select 2") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--semicolon-after-last-statement']) assert output.getvalue() == "SELECT 1;\n\nSELECT 2;\n" with StringIO("Select 'abcdef'") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--split-string-literals', '0']) assert output.getvalue() == "SELECT 'abcdef'\n" with StringIO("Select 'abcdef'") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--split-string-literals', '3']) assert output.getvalue() == """\ SELECT 'abc' 'def' """ with StringIO("Select /* one */ 1") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--preserve-comments']) assert output.getvalue() == "SELECT /* one */ 1\n" with StringIO("CREATE TABLESPACE tbl LOCATION 'dir' -- comment") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--preserve-comments']) assert output.getvalue() == "CREATE TABLESPACE tbl LOCATION 'dir' -- comment\n\n" with StringIO("""\ select collation for ('abc'), normalize('abc', nfc), overlay('Txxxxas' placing 'hom' FROM 2 for 4), position('bc' in 'abcd'), trim(both ' abc '), trim(both '*' from '***abc***'), trim(leading '*' from '***abc***'), trim(trailing '*' from '***abc***'), xmlexists('//town[text() = ''Toronto'']' passing 'TorontoOttawa'); """) as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--special-functions', '--compact-lists-margin', '100']) assert output.getvalue() == """\ SELECT COLLATION FOR ('abc') , normalize('abc', NFC) , overlay('Txxxxas' PLACING 'hom' FROM 2 FOR 4) , position('bc' IN 'abcd') , trim(BOTH FROM ' abc ') , trim(BOTH '*' FROM '***abc***') , trim(LEADING '*' FROM '***abc***') , trim(TRAILING '*' FROM '***abc***') , xmlexists('//town[text() = ''Toronto'']'\ PASSING BY REF 'TorontoOttawa') """ with StringIO("select extract(hour from t1.modtime), count(*) from t1") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--special-functions', '--compact-lists-margin', '120']) assert output.getvalue() == ("SELECT EXTRACT(HOUR FROM t1.modtime), count(*)\n" "FROM t1\n") with StringIO("select extract(hour from t1.modtime), count(*) from t1") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--special-functions', '--compact-lists-margin', '40']) assert output.getvalue() == ("SELECT EXTRACT(HOUR FROM t1.modtime)\n" " , count(*)\n" "FROM t1\n") with StringIO("select substring('123' from 1 for 2)") as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--special-functions', '--compact-lists-margin', '40']) assert output.getvalue() == "SELECT substring('123' FROM 1 FOR 2)\n" in_stmt = """\ select substring('123',2,3), regexp_split_to_array('x,x,x', ','), btrim('xxx'), trim('xxx'), POSITION('hour' in trim(substring('xyz hour ',1,6))) """ with StringIO(in_stmt) as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--compact-lists-margin', '100']) assert output.getvalue() == """\ SELECT substring('123', 2, 3) , regexp_split_to_array('x,x,x', ',') , btrim('xxx') , pg_catalog.btrim('xxx') , pg_catalog.position(pg_catalog.btrim(substring('xyz hour ', 1, 6)), 'hour') """ with StringIO(in_stmt) as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--remove-pg_catalog-from-functions', '--compact-lists-margin', '100']) assert output.getvalue() == """\ SELECT substring('123', 2, 3) , regexp_split_to_array('x,x,x', ',') , btrim('xxx') , btrim('xxx') , pg_catalog.position(btrim(substring('xyz hour ', 1, 6)), 'hour') """ with StringIO('SELECT NULLIF(1, 0)') as input: with UnclosableStream() as output: with redirect_stdin(input), redirect_stdout(output): main(['--remove-pg_catalog-from-functions']) assert output.getvalue() == "SELECT NULLIF(1, 0)\n" pglast-7.7/tests/test_parser.py000066400000000000000000000210411477366773500167570ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Test the parser.pyx module # :Created: ven 04 ago 2017 08:37:10 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2023, 2024 Lele Gaifax # import json import pytest from pglast import Error, ast, parse_plpgsql, parse_sql from pglast.parser import Displacements, ParseError, deparse_protobuf, fingerprint from pglast.parser import get_postgresql_version, parse_sql_json, parse_sql_protobuf from pglast.parser import scan, split def test_parse_sql(): assert parse_sql('') == () assert parse_sql('-- nothing') == () with pytest.raises(ParseError): parse_sql('foo') ptree = parse_sql('SELECT 1') assert isinstance(ptree, tuple) assert len(ptree) == 1 rawstmt = ptree[0] assert isinstance(rawstmt, ast.RawStmt) def test_parse_plpgsql(): ptree = parse_plpgsql('CREATE FUNCTION add (a integer, b integer)' ' RETURNS integer AS $$ BEGIN RETURN a + b; END; $$' ' LANGUAGE plpgsql') assert len(ptree) == 1 function = ptree[0] assert isinstance(function, dict) assert function.keys() == {'PLpgSQL_function'} # See https://github.com/pganalyze/libpg_query/issues/122 ptree = parse_plpgsql("""\ CREATE OR REPLACE FUNCTION test_parse ( p_time_start timestamptz, p_time_end timestamptz, p_time_interval interval default NULL ) RETURNS TABLE ( ts timestamptz, arbitrary_return bigint ) AS $$ BEGIN IF p_time_interval IS NULL THEN p_time_interval := INTERVAL '1 hour'; END IF; RETURN QUERY SELECT p_time_start + p_time_interval, 1234::bigint; END; $$ LANGUAGE plpgsql;""") function = ptree[0] assert isinstance(function, dict) assert function.keys() == {'PLpgSQL_function'} # See https://github.com/lelit/pglast/issues/156 ptree = parse_plpgsql("""\ CREATE FUNCTION public.dz_sumfunc( IN p_in INTEGER ,OUT p_out public.dz_sumthing ) AS $BODY$ DECLARE BEGIN p_out.sumattribute := p_in; END; $BODY$ LANGUAGE plpgsql""") function = ptree[0] assert isinstance(function, dict) assert function.keys() == {'PLpgSQL_function'} def test_fingerprint(): sql1 = "SELECT a as b, c as d FROM atable AS btable WHERE a = 1 AND b in (1, 2)" sql2 = "SELECT a, c FROM atable WHERE a = 2 AND b IN (2, 3, 4) " assert fingerprint(sql1) == fingerprint(sql2) def test_errors(): with pytest.raises(Error) as exc: parse_sql('FooBar') assert exc.typename == 'ParseError' errmsg, index = exc.value.args assert errmsg == 'syntax error at or near "FooBar"' assert index == 0 with pytest.raises(Error) as exc: parse_sql('SELECT foo FRON bar') assert exc.typename == 'ParseError' errmsg, index = exc.value.args assert errmsg == 'syntax error at or near "bar"' assert index == 16 assert str(exc.value) == f'{errmsg}, at index {index}' with pytest.raises(Error) as exc: parse_plpgsql('CREATE FUMCTION add (a integer, b integer)' ' RETURNS integer AS $$ BEGIN RETURN a + b; END; $$' ' LANGUAGE plpgsql') assert exc.typename == 'ParseError' errmsg, index = exc.value.args assert errmsg == 'syntax error at or near "FUMCTION"' assert index == 7 with pytest.raises(Error) as exc: fingerprint('SELECT foo FRON bar') assert exc.typename == 'ParseError' errmsg, index = exc.value.args assert errmsg == 'syntax error at or near "bar"' assert index == 16 def test_unicode(): ptree = parse_sql('SELECT 1 AS "Naïve"') target = ptree[0].stmt.targetList[0] assert target.name == "Naïve" def test_locations_fixup(): sql = 'SELECT 1 AS "Naïve" /* there is an "ı" with a \u0308 above */ FROM somewhere' sql3 = ';'.join([sql]*3) ptree = parse_sql(sql3) assert len(ptree) == 3 raw = ptree[0] assert raw.stmt_location == 0 assert raw.stmt_len == len(sql) fromc = raw.stmt.fromClause[0] assert sql3[fromc.location:].startswith('somewhere') raw = ptree[1] assert raw.stmt_location == len(sql)+1 assert raw.stmt_len == len(sql) fromc = raw.stmt.fromClause[0] assert sql3[fromc.location:].startswith('somewhere') raw = ptree[2] assert raw.stmt_location == len(sql)*2+2 # For the last stmt, the stmt_len is 0... assert raw.stmt_len == 0 fromc = raw.stmt.fromClause[0] assert sql3[fromc.location:].startswith('somewhere') def test_pg_version(): pg_version = get_postgresql_version() assert isinstance(pg_version, tuple) assert len(pg_version) == 2 def test_clone(): from pglast import ast stmts = parse_sql('SELECT 1') stmt = stmts[0].stmt clone = ast.SelectStmt(stmt()) assert clone is not stmt assert clone == stmt assert repr(clone) == repr(stmt) assert clone() == stmt() def test_split(): sql = 'select 1; select 2; select "€€€€ ·"; select 4' expected = ('select 1', 'select 2', 'select "€€€€ ·"', 'select 4') assert split(sql) == expected assert tuple(sql[s] for s in split(sql, only_slices=True)) == expected def test_scan(): sql = 'select /* something here */ 1' result = scan(sql) assert result == [( 0, 5, 'SELECT', 'RESERVED_KEYWORD'), # noqa E201 ( 7, 26, 'C_COMMENT', 'NO_KEYWORD'), # noqa E201 (28, 28, 'ICONST', 'NO_KEYWORD')] assert sql[result[1].start:result[1].end+1] == '/* something here */' sql = 'select 0.01 as "€" -- one €-cent' assert [sql[t.start:t.end+1] for t in scan(sql)] == [ 'select', '0.01', 'as', '"€"', '-- one €-cent'] # Combining character sql = 'SELECT 1 AS "\u0101\u0301" -- etc' assert [sql[t.start:t.end+1] for t in scan(sql)] == [ 'SELECT', '1', 'AS', '"ā́"', '-- etc'] # Invalid input, see https://github.com/pganalyze/libpg_query/issues/108 sql = 'SELECT \\s 1' result = scan(sql) assert result == [( 0, 5, 'SELECT', 'RESERVED_KEYWORD'), # noqa E201 ( 7, 7, 'ASCII_92', 'NO_KEYWORD'), # noqa E201 ( 8, 8, 'IDENT', 'NO_KEYWORD'), # noqa E201 (10, 10, 'ICONST', 'NO_KEYWORD')] assert sql[result[1].start] == '\\' def test_deparse_protobuf(): assert deparse_protobuf(parse_sql_protobuf('select 1')) == 'SELECT 1' def test_parse_sql_json(): # See issue #128 def _find(tree, subtree_key): """ Recursive searcher. """ for key, val in tree.items(): if key == subtree_key: yield val elif type(val) == list: for i in val: yield from _find(i, subtree_key) elif type(val) == dict: yield from _find(val, subtree_key) def used_tables(sql_query): disp = Displacements(sql_query) json_str = parse_sql_json(sql_query) parse_tree = json.loads(json_str) deps = set() for subtree in _find(parse_tree, 'RangeVar'): # Instead of using `schemaname` and `relname`, I use the location to # extract the dependency in a case-sensitive manner. tot_length = len(subtree['schemaname']) + len(subtree['relname']) + 1 start_idx = disp(subtree['location']) dep = sql_query[start_idx:start_idx + tot_length] deps.add(dep) return deps # Note that the last word of first line is not "Satis" but "Satış" with a # dotless i and an s with cedilla. turkish_chars = ''' select t1.Sales Satış from Schema.Table t1 join Schema2.Table2 t2 on t1.col = t2.col ''' assert used_tables(turkish_chars) == {'Schema.Table', 'Schema2.Table2'} @pytest.mark.xfail def test_issue157(): # See https://github.com/pganalyze/libpg_query/issues/261 query = """\ CREATE OR REPLACE FUNCTION update_customer_total_sales(customer_id INT) RETURNS VOID AS $$ DECLARE total NUMERIC; BEGIN -- Calculate the total sales for the specified customer SELECT COALESCE(SUM(amount), 0) INTO total FROM orders WHERE customer_id $1; -- <------ this part is invalid -- Update the total_sales in the customers table UPDATE customers SET total_sales = total WHERE customer_id; -- Optionally, you can return the total for confirmation RAISE NOTICE 'Total sales for customer ID %: %', customer_id, total; END; $$ LANGUAGE plpgsql""" with pytest.raises(Error) as exc: parse_plpgsql(query) pglast-7.7/tests/test_printers.py000066400000000000000000000067221477366773500173420ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Tests on the printers registry # :Created: sab 05 ago 2017 10:31:23 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2024 Lele Gaifax # import warnings import pytest from pglast import ast, enums, prettify from pglast.printers import IntEnumPrinter, NODE_PRINTERS, PrinterAlreadyPresentError from pglast.printers import get_printer_for_node, node_printer def test_registry(): with pytest.raises(ValueError): get_printer_for_node(None) with pytest.raises(ValueError): @node_printer() def missing_node(node, output): pass with pytest.raises(ValueError): @node_printer(1) def invalid_node(node, output): pass with pytest.raises(ValueError): @node_printer(ast.RawStmt, ast.SelectStmt, ast.UpdateStmt) def too_many_nodes(node, output): pass with pytest.raises(ValueError): @node_printer('RawStmt') def invalid_node(node, output): pass with pytest.raises(ValueError): @node_printer((ast.RawStmt, 'foo'), ast.SelectStmt) def invalid_parents(node, output): pass raw_stmt = NODE_PRINTERS.pop(ast.RawStmt) try: @node_printer(ast.RawStmt) def raw(node, output): pass assert NODE_PRINTERS[ast.RawStmt] is raw with pytest.raises(PrinterAlreadyPresentError): @node_printer(ast.RawStmt) def other_raw(node, output): pass finally: NODE_PRINTERS[ast.RawStmt] = raw_stmt def test_prettify_safety_belt(): raw_stmt_printer = NODE_PRINTERS.pop(ast.RawStmt, None) try: @node_printer(ast.RawStmt) def raw_stmt_1(node, output): output.write('Yeah') output = prettify('select 42') assert output == 'Yeah' with warnings.catch_warnings(record=True) as w: output = prettify('select 42', safety_belt=True) assert output == 'select 42' assert 'Detected a bug' in str(w[0].message) @node_printer(ast.RawStmt, override=True) def raw_stmt_2(node, output): output.write('select 1') output = prettify('select 42') assert output == 'select 1' with warnings.catch_warnings(record=True) as w: output = prettify('select 42', safety_belt=True) assert output == 'select 42' assert 'Detected a non-cosmetic difference' in str(w[0].message) finally: if raw_stmt_printer is not None: NODE_PRINTERS[ast.RawStmt] = raw_stmt_printer else: NODE_PRINTERS.pop(ast.RawStmt, None) def test_int_enum_printer(): class LockWaitPrinter(IntEnumPrinter): enum = enums.LockWaitPolicy def LockWaitBlock(self, node, output): output.append('block') lwp = LockWaitPrinter() result = [] lwp('LockWaitBlock', object(), result) assert result == ['block'] with pytest.raises(NotImplementedError): lwp('LockWaitError', object(), result) with pytest.raises(ValueError): lwp('FooBar', object(), result) lwp(None, object(), result) assert result == ['block']*2 def test_not_int_enum_printer(): class NotIntEnum(IntEnumPrinter): enum = enums.FunctionParameterMode with pytest.raises(ValueError): NotIntEnum() pglast-7.7/tests/test_printers_prettification.py000066400000000000000000000055441477366773500224470ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Assert printers emit beautiful code # :Created: dom 17 mar 2019 10:46:03 CET # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2019, 2020, 2021, 2024, 2025 Lele Gaifax # from ast import literal_eval from pathlib import Path import pytest from pglast import _extract_comments from pglast.stream import IndentedStream, RawStream import pglast.printers # noqa this = Path(__file__) this_dir = this.parent tests_dir = this_dir / this.stem def cases(src): lineno = 1 for case in src.read_text().split('\n\n'): yield lineno, case.strip() lineno += case.count('\n') + 2 def make_id(arg): if isinstance(arg, Path): return str(arg.relative_to(this_dir)) elif isinstance(arg, int): return str(arg) # Prettification cases: each case may be composed by either two or three parts, # respectively the original statement, the expected outcome and an optional options # dictionary. The original and the expected statements are separated by a standalone "=", # while the options dictionary is introduced by a standalone ":". Thus something like # this: # # RAW_STATEMENT # = # PRETTIFIED_STATEMENT # # or this: # # RAW_STATEMENT # = # PRETTIFIED_STATEMENT # : # INDENTEDSTREAM_OPTIONS_DICTIONARY # # The prettified statement may contain standalone "\n\" lines, that are replaced with single # newlines, to allow "empty lines"; in other words, the following expected statement # # SELECT foo # # INTERSECT # # SELECT bar # # must be written as # # SELECT foo # \n\ # INTERSECT # \n\ # SELECT bar # # When it ends with a "\", it is replaced with a final newline. @pytest.mark.parametrize('src,lineno,case', ((src, lineno, case) for src in sorted(tests_dir.glob('**/*.sql')) for (lineno, case) in cases(src)), ids=make_id) def test_prettification(src, lineno, case): parts = case.split('\n=\n') original = parts[0].strip() parts = parts[1].split('\n:\n') expected = parts[0].strip().replace('\\n\\\n', '\n').replace('\\s', ' ') if expected.endswith('\\'): expected = expected[:-1] + '\n' if '{ZERO WIDTH NO-BREAK SPACE}' in expected: expected = expected.replace('{ZERO WIDTH NO-BREAK SPACE}', '\N{ZERO WIDTH NO-BREAK SPACE}') if len(parts) == 2: options = literal_eval(parts[1]) else: options = {} if options.pop('preserve_comments', False): options['comments'] = _extract_comments(original) raw = options.pop('raw_stream', False) prettified = (RawStream if raw else IndentedStream)(**options)(original) assert expected == prettified, "%s:%d:%r != %r" % (src, lineno, expected, prettified) pglast-7.7/tests/test_printers_prettification/000077500000000000000000000000001477366773500220655ustar00rootroot00000000000000pglast-7.7/tests/test_printers_prettification/ddl/000077500000000000000000000000001477366773500226305ustar00rootroot00000000000000pglast-7.7/tests/test_printers_prettification/ddl/alter_default_privileges.sql000066400000000000000000000006001477366773500304110ustar00rootroot00000000000000ALTER DEFAULT PRIVILEGES FOR ROLE admin REVOKE execute ON FUNCTIONS FROM PUBLIC = ALTER DEFAULT PRIVILEGES FOR ROLE admin REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC ALTER DEFAULT PRIVILEGES FOR ROLE role1 REVOKE GRANT OPTION FOR ALL ON SCHEMAS FROM PUBLIC CASCADE = ALTER DEFAULT PRIVILEGES FOR ROLE role1 REVOKE GRANT OPTION FOR ALL PRIVILEGES ON SCHEMAS FROM PUBLIC CASCADE pglast-7.7/tests/test_printers_prettification/ddl/alter_subscription.sql000066400000000000000000000020441477366773500272640ustar00rootroot00000000000000alter subscription mysub set publication insert_only = ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only alter subscription mysub set publication insert_only with (enabled = false) = ALTER SUBSCRIPTION mysub SET PUBLICATION insert_only WITH (enabled = false) alter subscription "Mysub" add publication insert_only = ALTER SUBSCRIPTION "Mysub" ADD PUBLICATION insert_only alter subscription "Mysub" add publication insert_only with (enabled = true) = ALTER SUBSCRIPTION "Mysub" ADD PUBLICATION insert_only WITH (enabled = true) alter subscription "Mysub" drop publication insert_only = ALTER SUBSCRIPTION "Mysub" DROP PUBLICATION insert_only alter subscription "Mysub" DROP publication insert_only with (enabled = false) = ALTER SUBSCRIPTION "Mysub" DROP PUBLICATION insert_only WITH (enabled = false) alter subscription "Mysub" refresh publication = ALTER SUBSCRIPTION "Mysub" REFRESH PUBLICATION alter subscription "Mysub" refresh publication with (copy_data = True) = ALTER SUBSCRIPTION "Mysub" REFRESH PUBLICATION WITH (copy_data = true) pglast-7.7/tests/test_printers_prettification/ddl/alter_table.sql000066400000000000000000000013061477366773500256270ustar00rootroot00000000000000ALTER TABLE tab1 ADD CONSTRAINT foo FOREIGN KEY (id1) REFERENCES tab2 (id2) DEFERRABLE INITIALLY DEFERRED = ALTER TABLE tab1 ADD CONSTRAINT foo FOREIGN KEY (id1) REFERENCES tab2 (id2) DEFERRABLE INITIALLY DEFERRED ALTER TABLE color ALTER COLUMN color_id ADD GENERATED BY DEFAULT AS IDENTITY = ALTER TABLE color ALTER COLUMN color_id ADD GENERATED BY DEFAULT AS IDENTITY; : {'semicolon_after_last_statement': True} ALTER TABLE books ADD CONSTRAINT distfk FOREIGN KEY (author_id) REFERENCES authors (author_id) ON UPDATE RESTRICT NOT VALID = ALTER TABLE books ADD CONSTRAINT distfk FOREIGN KEY (author_id) REFERENCES authors (author_id) ON UPDATE RESTRICT NOT VALID; : {'semicolon_after_last_statement': True} pglast-7.7/tests/test_printers_prettification/ddl/alter_text_search.sql000066400000000000000000000001471477366773500270530ustar00rootroot00000000000000alter text search dictionary foo (x=1, y=2) = ALTER TEXT SEARCH DICTIONARY foo ( x = 1 , y = 2 ) pglast-7.7/tests/test_printers_prettification/ddl/comment.sql000066400000000000000000000010441477366773500250120ustar00rootroot00000000000000COMMENT ON VIEW "MySchema"."MyView" IS 'Lorem ipsum dolor sit amet, consectetur adipisicing elit,' ' sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' ' Ut enimad minim veniam, quis nostrud exercitation ullamco laboris.' = COMMENT ON VIEW "MySchema"."MyView" IS 'Lorem ipsum dolor sit amet, consectetur adipisicin' 'g elit, sed do eiusmod tempor incididunt ut labore' ' et dolore magna aliqua. Ut enimad minim veniam, q' 'uis nostrud exercitation ullamco laboris.' : {'split_string_literals_threshold': 50} pglast-7.7/tests/test_printers_prettification/ddl/create_aggregate.sql000066400000000000000000000013601477366773500266220ustar00rootroot00000000000000CREATE AGGREGATE percentile_disc (float8 ORDER BY anyelement) ( sfunc = ordered_set_transition, stype = internal, finalfunc = percentile_disc_final, finalfunc_extra ) = CREATE AGGREGATE percentile_disc (float8 ORDER BY anyelement) ( sfunc = ordered_set_transition , stype = internal , finalfunc = percentile_disc_final , finalfunc_extra ) CREATE AGGREGATE percentile_disc (float8 ORDER BY anyelement) ( sfunc = ordered_set_transition, stype = internal, finalfunc = percentile_disc_final, finalfunc_extra ) = CREATE AGGREGATE percentile_disc (float8 ORDER BY anyelement) ( sfunc = ordered_set_transition, stype = internal, finalfunc = percentile_disc_final, finalfunc_extra ) : {'comma_at_eoln': True} pglast-7.7/tests/test_printers_prettification/ddl/create_database.sql000066400000000000000000000007401477366773500264410ustar00rootroot00000000000000CREATE DATABASE "NewDB" WITH ENCODING = 'UTF8' TEMPLATE = 'template0' LC_COLLATE = 'it_IT.UTF-8' LC_CTYPE = 'it_IT.UTF-8' ALLOW_CONNECTIONS = true CONNECTION LIMIT = 2 IS_TEMPLATE = false = CREATE DATABASE "NewDB" WITH encoding = 'UTF8' template = 'template0' lc_collate = 'it_IT.UTF-8' lc_ctype = 'it_IT.UTF-8' allow_connections = true connection limit = 2 is_template = false pglast-7.7/tests/test_printers_prettification/ddl/create_domain.sql000066400000000000000000000007011477366773500261410ustar00rootroot00000000000000CREATE DOMAIN foo integer = CREATE DOMAIN foo AS integer CREATE DOMAIN "Foo" integer CONSTRAINT "Non_Negative" CHECK (value > 0) = CREATE DOMAIN "Foo" AS integer CONSTRAINT "Non_Negative" CHECK (value > 0) CREATE DOMAIN foo varchar(10) not null default 'null' = CREATE DOMAIN foo AS varchar(10) NOT NULL DEFAULT 'null' CREATE DOMAIN foo varchar(10) collate "it_IT" default 'null' = CREATE DOMAIN foo AS varchar(10) COLLATE "it_IT" DEFAULT 'null' pglast-7.7/tests/test_printers_prettification/ddl/create_event_trigger.sql000066400000000000000000000012071477366773500275400ustar00rootroot00000000000000CREATE EVENT TRIGGER abort_ddl ON ddl_command_start EXECUTE PROCEDURE abort_any_command() = CREATE EVENT TRIGGER abort_ddl ON ddl_command_start EXECUTE PROCEDURE abort_any_command() create event trigger abort_ddl on ddl_command_start when tag in ('foo', 'bar') execute procedure a() = CREATE EVENT TRIGGER abort_ddl ON ddl_command_start WHEN tag IN ('foo', 'bar') EXECUTE PROCEDURE a() create event trigger abort_ddl on ddl_command_start when tag in ('foo', 'bar') and tag in ('other') execute procedure a() = CREATE EVENT TRIGGER abort_ddl ON ddl_command_start WHEN tag IN ('foo', 'bar') AND tag IN ('other') EXECUTE PROCEDURE a() pglast-7.7/tests/test_printers_prettification/ddl/create_extension.sql000066400000000000000000000004131477366773500267060ustar00rootroot00000000000000CREATE EXTENSION IF NOT EXISTS hstore = CREATE EXTENSION IF NOT EXISTS hstore CREATE EXTENSION "Foobar" VERSION '1' CASCADE = CREATE EXTENSION "Foobar" WITH VERSION '1' CASCADE CREATE EXTENSION foo SCHEMA addons = CREATE EXTENSION foo WITH SCHEMA addons pglast-7.7/tests/test_printers_prettification/ddl/create_foreign_data_wrapper.sql000066400000000000000000000017411477366773500310610ustar00rootroot00000000000000CREATE FOREIGN DATA WRAPPER mywrapper validator myvalf OPTIONS (debug 'true', foo 'bar') = CREATE FOREIGN DATA WRAPPER mywrapper VALIDATOR myvalf OPTIONS (debug 'true' , foo 'bar') CREATE FOREIGN DATA WRAPPER mywrapper validator myvalf OPTIONS (debug 'true', foo 'bar') = CREATE FOREIGN DATA WRAPPER mywrapper VALIDATOR myvalf OPTIONS (debug 'true', foo 'bar') : {'compact_lists_margin': 40} CREATE FOREIGN DATA WRAPPER mywrapper validator myvalf OPTIONS (debug 'true', foo 'bar', abra 'cadabra') = CREATE FOREIGN DATA WRAPPER mywrapper VALIDATOR myvalf OPTIONS (debug 'true' , foo 'bar' , abra 'cadabra') : {'compact_lists_margin': 40} CREATE FOREIGN DATA WRAPPER file HANDLER myhandler validator myvalf = CREATE FOREIGN DATA WRAPPER file HANDLER myhandler VALIDATOR myvalf CREATE FOREIGN DATA WRAPPER file HANDLER myhandler validator myvalf = CREATE FOREIGN DATA WRAPPER file HANDLER myhandler VALIDATOR myvalf : {'compact_lists_margin': 40} pglast-7.7/tests/test_printers_prettification/ddl/create_foreign_table.sql000066400000000000000000000023561477366773500275020ustar00rootroot00000000000000CREATE FOREIGN TABLE films ( code char(5) NOT NULL, title varchar(40) NOT NULL, did integer NOT NULL, date_prod date, kind varchar(10), len interval hour to minute ) SERVER film_server = CREATE FOREIGN TABLE films ( code char(5) NOT NULL , title varchar(40) NOT NULL , did integer NOT NULL , date_prod date , kind varchar(10) , len interval hour to minute ) SERVER film_server CREATE FOREIGN TABLE films ( code char(5) NOT NULL, title varchar(40) NOT NULL, did integer NOT NULL, date_prod date, kind varchar(10), len interval hour to minute ) SERVER film_server OPTIONS (foo 'bar', bar 'foo') = CREATE FOREIGN TABLE films ( code char(5) NOT NULL , title varchar(40) NOT NULL , did integer NOT NULL , date_prod date , kind varchar(10) , len interval hour to minute ) SERVER film_server OPTIONS (foo 'bar' , bar 'foo') CREATE FOREIGN TABLE measurement_y2016m07 PARTITION OF measurement FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') SERVER server_07 = CREATE FOREIGN TABLE measurement_y2016m07 PARTITION OF measurement FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') SERVER server_07 pglast-7.7/tests/test_printers_prettification/ddl/create_function.sql000066400000000000000000000040511477366773500265210ustar00rootroot00000000000000CREATE OR REPLACE FUNCTION auth.login(usr varchar(16), pwd varchar(16), OUT user_id integer, OUT first_name varchar(32), OUT last_name varchar(32)) AS $$ SELECT u.id, u.first_name, u.last_name FROM auth.users u WHERE u.name = usr AND crypt(pwd, u.password) = u.password AND u.validity @> CURRENT_DATE; $$ LANGUAGE sql STABLE = CREATE OR REPLACE FUNCTION auth.login(usr varchar(16) , pwd varchar(16) , OUT user_id integer , OUT first_name varchar(32) , OUT last_name varchar(32)) AS $$ SELECT u.id, u.first_name, u.last_name FROM auth.users u WHERE u.name = usr AND crypt(pwd, u.password) = u.password AND u.validity @> CURRENT_DATE; $$ LANGUAGE sql STABLE CREATE FUNCTION funcb(somearg text) RETURNS TABLE(c1 int, c2 text) AS $$ SELECT 1, 'Label 1' $$ language sql stable SECURITY INVOKER = CREATE FUNCTION funcb(somearg text) RETURNS TABLE (c1 integer, c2 text) AS $$ SELECT 1, 'Label 1' $$ LANGUAGE sql STABLE SECURITY INVOKER CREATE OR REPLACE FUNCTION auth.crypt_user_password() RETURNS TRIGGER AS $$ BEGIN IF new.password IS NOT NULL AND (char_length(new.password) <> 60 OR substring(new.password, 1, 1) <> '$') THEN new.password := crypt(new.password, gen_salt('bf')); END IF; RETURN new; END; $$ LANGUAGE plpgsql = CREATE OR REPLACE FUNCTION auth.crypt_user_password() RETURNS trigger AS $$ BEGIN IF new.password IS NOT NULL AND (char_length(new.password) <> 60 OR substring(new.password, 1, 1) <> '$') THEN new.password := crypt(new.password, gen_salt('bf')); END IF; RETURN new; END; $$ LANGUAGE plpgsql CREATE FUNCTION func() RETURNS void AS ' SELECT $_$$_$; ' LANGUAGE sql = CREATE FUNCTION func() RETURNS void AS $__$ SELECT $_$$_$; $__$ LANGUAGE sql create procedure test() begin atomic insert into foo values (1, 2); insert into bar values (2, 3); end = CREATE PROCEDURE test() BEGIN ATOMIC INSERT INTO foo VALUES (1, 2); INSERT INTO bar VALUES (2, 3); END pglast-7.7/tests/test_printers_prettification/ddl/create_index.sql000066400000000000000000000003531477366773500260040ustar00rootroot00000000000000create index concurrently aidx on atbl using gin (value) with (fastupdate = ON, gin_pending_list_limit = 100) = CREATE INDEX CONCURRENTLY aidx ON atbl USING gin (value) WITH (fastupdate = 'on' , gin_pending_list_limit = 100) pglast-7.7/tests/test_printers_prettification/ddl/create_language.sql000066400000000000000000000004521477366773500264600ustar00rootroot00000000000000CREATE OR REPLACE LANGUAGE lang = CREATE EXTENSION IF NOT EXISTS lang CREATE OR REPLACE TRUSTED LANGUAGE trustlang HANDLER s1.fhandler INLINE s1.finline VALIDATOR fvalidator = CREATE OR REPLACE TRUSTED PROCEDURAL LANGUAGE trustlang HANDLER s1.fhandler INLINE s1.finline VALIDATOR fvalidator pglast-7.7/tests/test_printers_prettification/ddl/create_rule.sql000066400000000000000000000016041477366773500256440ustar00rootroot00000000000000create rule foo as on delete to bar do instead select baz(old.id, null::text) AS qux = CREATE RULE foo AS ON DELETE TO bar DO INSTEAD SELECT baz(old.id , CAST(NULL AS text)) AS qux create rule "XX" as on insert to bar do nothing = CREATE RULE "XX" AS ON INSERT TO bar DO ALSO NOTHING create rule "XX" as on insert to bar where new.x is null do nothing = CREATE RULE "XX" AS ON INSERT TO bar WHERE new.x IS NULL DO ALSO NOTHING CREATE RULE notify_me AS ON UPDATE TO mytable DO ALSO (insert into audit (foo) values ('before'); NOTIFY mytable; insert into audit (foo) values ('after');) = CREATE RULE notify_me AS ON UPDATE TO mytable DO ALSO ( INSERT INTO audit (foo) VALUES ('before') ; NOTIFY mytable ; INSERT INTO audit (foo) VALUES ('after') ) alter rule "XX" on "Foo" rename to "YY" = ALTER RULE "XX" ON "Foo" RENAME TO "YY" pglast-7.7/tests/test_printers_prettification/ddl/create_schema.sql000066400000000000000000000004541477366773500261370ustar00rootroot00000000000000CREATE SCHEMA hollywood CREATE TABLE films (title text, release date, awards text[]) CREATE INDEX by_release ON films (release) = CREATE SCHEMA hollywood CREATE TABLE films ( title text , release date , awards text[] ) CREATE INDEX by_release ON films (release) pglast-7.7/tests/test_printers_prettification/ddl/create_sequence.sql000066400000000000000000000002701477366773500265030ustar00rootroot00000000000000CREATE TEMP SEQUENCE serial INCREMENT 2 MINVALUE 5 MAXVALUE 15 START WITH 7 CYCLE = CREATE TEMPORARY SEQUENCE serial INCREMENT BY 2 MINVALUE 5 MAXVALUE 15 START WITH 7 CYCLE pglast-7.7/tests/test_printers_prettification/ddl/create_table.sql000066400000000000000000000040011477366773500257560ustar00rootroot00000000000000create table a (id serial primary key, value integer) = CREATE TABLE a ( id serial PRIMARY KEY , value integer ) CREATE TABLE films ( code char(5), title varchar(40), did integer, date_prod date, kind varchar(10), len interval hour to second(3), CONSTRAINT code_title PRIMARY KEY(code,title) ) = CREATE TABLE films ( code char(5) , title varchar(40) , did integer , date_prod date , kind varchar(10) , len interval hour to second (3) , CONSTRAINT code_title PRIMARY KEY (code, title) ) create temporary table a (id serial) on commit drop = CREATE TEMPORARY TABLE a ( id serial ) ON COMMIT DROP CREATE TABLE distributors ( did integer, name varchar(40), UNIQUE(name) WITH (fillfactor=70) USING INDEX TABLESPACE indexes ) WITH (fillfactor=70) = CREATE TABLE distributors ( did integer , name varchar(40) , UNIQUE (name) WITH (fillfactor = 70) USING INDEX TABLESPACE indexes ) WITH (fillfactor = 70) CREATE TABLE distributors ( did integer, name varchar(40), UNIQUE(name) WITH (fillfactor=70) USING INDEX TABLESPACE indexes ) WITH (fillfactor=70) = CREATE TABLE distributors ( did integer, name varchar(40), UNIQUE (name) WITH (fillfactor = 70) USING INDEX TABLESPACE indexes ) WITH (fillfactor = 70) : {'comma_at_eoln': True} CREATE TABLE measurement_y2016m07 PARTITION OF measurement ( unitsales DEFAULT 0 ) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') TABLESPACE olddata = CREATE TABLE measurement_y2016m07 PARTITION OF measurement ( unitsales WITH OPTIONS DEFAULT 0 ) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') TABLESPACE olddata CREATE TEMP TABLE films_recent (title, director) ON COMMIT DELETE ROWS AS SELECT title, director FROM films WHERE date_prod >= '2002-01-01' = CREATE TEMPORARY TABLE films_recent (title, director) ON COMMIT DELETE ROWS AS SELECT title , director FROM films WHERE date_prod >= '2002-01-01' pglast-7.7/tests/test_printers_prettification/ddl/create_transform.sql000066400000000000000000000004621477366773500267110ustar00rootroot00000000000000CREATE OR REPLACE TRANSFORM FOR int LANGUAGE SQL ( FROM SQL WITH FUNCTION prsd_lextype(internal), TO SQL WITH FUNCTION int4recv(internal)) = CREATE OR REPLACE TRANSFORM FOR integer LANGUAGE sql ( FROM SQL WITH FUNCTION prsd_lextype (internal), TO SQL WITH FUNCTION int4recv (internal)) pglast-7.7/tests/test_printers_prettification/ddl/create_trigger.sql000066400000000000000000000046631477366773500263500ustar00rootroot00000000000000CREATE TRIGGER trg_auth_users_100_log_changes BEFORE INSERT OR UPDATE OF password ON auth.users FOR EACH ROW EXECUTE PROCEDURE auth.crypt_user_password() = CREATE TRIGGER trg_auth_users_100_log_changes BEFORE INSERT OR UPDATE OF password ON auth.users FOR EACH ROW EXECUTE PROCEDURE auth.crypt_user_password() CREATE TRIGGER trig2 INSTEAD OF UPDATE ON table1 FOR EACH ROW EXECUTE PROCEDURE trigfunc('param') = CREATE TRIGGER trig2 INSTEAD OF UPDATE ON table1 FOR EACH ROW EXECUTE PROCEDURE trigfunc('param') CREATE TRIGGER trg_celery_periodic_tasks_950_after_update AFTER UPDATE ON celery.periodic_tasks FOR EACH ROW WHEN (OLD.active IS DISTINCT FROM NEW.active OR OLD.args IS DISTINCT FROM NEW.args OR OLD.kwargs IS DISTINCT FROM NEW.kwargs OR OLD.options IS DISTINCT FROM NEW.options OR OLD.run_every IS DISTINCT FROM NEW.run_every OR OLD.run_at_minutes IS DISTINCT FROM NEW.run_at_minutes OR OLD.run_at_hours IS DISTINCT FROM NEW.run_at_hours OR OLD.run_on_weekdays IS DISTINCT FROM NEW.run_on_weekdays OR OLD.run_on_days IS DISTINCT FROM NEW.run_on_days OR OLD.run_on_months IS DISTINCT FROM NEW.run_on_months) EXECUTE PROCEDURE celery.notify_periodic_tasks_changed() = CREATE TRIGGER trg_celery_periodic_tasks_950_after_update AFTER UPDATE ON celery.periodic_tasks FOR EACH ROW WHEN (old.active IS DISTINCT FROM new.active OR old.args IS DISTINCT FROM new.args OR old.kwargs IS DISTINCT FROM new.kwargs OR old.options IS DISTINCT FROM new.options OR old.run_every IS DISTINCT FROM new.run_every OR old.run_at_minutes IS DISTINCT FROM new.run_at_minutes OR old.run_at_hours IS DISTINCT FROM new.run_at_hours OR old.run_on_weekdays IS DISTINCT FROM new.run_on_weekdays OR old.run_on_days IS DISTINCT FROM new.run_on_days OR old.run_on_months IS DISTINCT FROM new.run_on_months) EXECUTE PROCEDURE celery.notify_periodic_tasks_changed() CREATE TRIGGER trig1 AFTER UPDATE ON schema1.table1 FOR EACH ROW WHEN (new.col1 IS DISTINCT FROM old.col1) EXECUTE PROCEDURE schema1.func1() = CREATE TRIGGER trig1 AFTER UPDATE ON schema1.table1 FOR EACH ROW WHEN (new.col1 IS DISTINCT FROM old.col1) EXECUTE PROCEDURE schema1.func1() CREATE TRIGGER trig2 AFTER DELETE OR TRUNCATE ON schema2.table2 FOR EACH STATEMENT EXECUTE PROCEDURE schema2.func2() = CREATE TRIGGER trig2 AFTER DELETE OR TRUNCATE ON schema2.table2 FOR EACH STATEMENT EXECUTE PROCEDURE schema2.func2() pglast-7.7/tests/test_printers_prettification/ddl/create_type.sql000066400000000000000000000000421477366773500256510ustar00rootroot00000000000000CREATE TYPE foo = CREATE TYPE foo pglast-7.7/tests/test_printers_prettification/ddl/create_view.sql000066400000000000000000000001711477366773500256450ustar00rootroot00000000000000CREATE OR REPLACE VIEW foo AS SELECT a,b FROM bar = CREATE OR REPLACE VIEW foo AS SELECT a , b FROM bar pglast-7.7/tests/test_printers_prettification/ddl/grant.sql000066400000000000000000000005341477366773500244660ustar00rootroot00000000000000GRANT ALL ON SCHEMA foo TO role1, role2 WITH GRANT OPTION = GRANT ALL PRIVILEGES ON SCHEMA foo TO role1, role2 WITH GRANT OPTION GRANT update(field1) ON TABLE tab1 TO role1 = GRANT UPDATE (field1) ON TABLE tab1 TO role1 GRANT all(field1, field2) ON TABLE tab2 TO role2 = GRANT ALL PRIVILEGES (field1, field2) ON TABLE tab2 TO role2 pglast-7.7/tests/test_printers_prettification/ddl/issue110.sql000066400000000000000000000014401477366773500247220ustar00rootroot00000000000000CREATE CAST (foo AS bar)WITHOUT FUNCTION = CREATE CAST (foo AS bar) WITHOUT FUNCTION VACUUM (ANALYZE)stxdinp = VACUUM (ANALYZE) stxdinp ALTER OPERATOR FAMILY alt_opf18 USING btree ADD FUNCTION 4 (int4, int2)btequalimage = ALTER OPERATOR FAMILY alt_opf18 USING btree ADD FUNCTION 4 (int4, int2) btequalimage CREATE TABLE coll_pruning_multi (a text) PARTITION BY range ((substr(a, 1))COLLATE "POSIX", (substr(a, 1))COLLATE "C") = CREATE TABLE coll_pruning_multi ( a text ) PARTITION BY range ((substr(a, 1)) COLLATE "POSIX" , (substr(a, 1)) COLLATE "C") DECLARE tablesample_cur CURSOR FOR SELECT id FROM test_tablesample TABLESAMPLE system(50)REPEATABLE (0) = DECLARE tablesample_cur CURSOR FOR SELECT id FROM test_tablesample TABLESAMPLE system(50) REPEATABLE (0) pglast-7.7/tests/test_printers_prettification/ddl/notify.sql000066400000000000000000000001411477366773500246550ustar00rootroot00000000000000notify foo = NOTIFY foo notify foo,'bar' = NOTIFY foo, 'bar' notify "Notify" = NOTIFY "Notify" pglast-7.7/tests/test_printers_prettification/ddl/show.sql000066400000000000000000000000241477366773500243250ustar00rootroot00000000000000show all = SHOW ALL pglast-7.7/tests/test_printers_prettification/dml/000077500000000000000000000000001477366773500226415ustar00rootroot00000000000000pglast-7.7/tests/test_printers_prettification/dml/copy.sql000066400000000000000000000010131477366773500243270ustar00rootroot00000000000000COPY manual_export TO STDOUT CSV HEADER = COPY manual_export TO STDOUT WITH CSV HEADER COPY manual_export TO STDOUT WITH (FORMAT CSV, HEADER FALSE) = COPY manual_export TO STDOUT WITH (FORMAT csv , HEADER FALSE) COPY country TO STDOUT (format csv, delimiter '|', null '~', freeze 0) = COPY country TO STDOUT WITH (FORMAT csv , DELIMITER '|' , NULL '~' , FREEZE 0) COPY country TO PROGRAM 'gzip > /usr1/proj/bray/sql/country_data.gz' = COPY country TO PROGRAM 'gzip > /usr1/proj/bray/sql/country_data.gz' pglast-7.7/tests/test_printers_prettification/dml/fetch.sql000066400000000000000000000006271477366773500244600ustar00rootroot00000000000000fetch all foo = FETCH FORWARD ALL FROM foo fetch next in foo = FETCH NEXT FROM foo fetch forward 1 from foo = FETCH NEXT FROM foo fetch 1 from foo = FETCH NEXT FROM foo fetch backward 1 from foo = FETCH PRIOR FROM foo fetch prior in foo = FETCH PRIOR FROM foo fetch absolute 1 foo = FETCH FIRST FROM foo fetch absolute -1 foo = FETCH LAST FROM foo fetch absolute 42 foo = FETCH ABSOLUTE 42 FROM foo pglast-7.7/tests/test_printers_prettification/dml/insert.sql000066400000000000000000000016131477366773500246670ustar00rootroot00000000000000insert into t (id, description) values (1, 'this is short enough'), (2, 'this is too long, and will be splitted') = INSERT INTO t (id , description) VALUES (1, 'this is short enough') , (2, 'this is too long, and will be splitted') insert into t (id, description) values (1, 'this is short enough'), (2, 'this is too long, and will be splitted') = INSERT INTO t (id , description) VALUES (1, 'this is short enough') , (2, 'this is too long, an' 'd will be splitted') : {'split_string_literals_threshold': 20} insert into t (id, description) values (1, 'this is short enough'), (2, 'this is too long, and will be splitted') = INSERT INTO t (id, description) VALUES (1, 'this is short enough'), (2, 'this is too long, and will be splitted') : {'comma_at_eoln': True} insert into foo select * from bar = INSERT INTO foo SELECT * FROM bar pglast-7.7/tests/test_printers_prettification/dml/move.sql000066400000000000000000000005631477366773500243340ustar00rootroot00000000000000move all foo = MOVE FORWARD ALL IN foo move next in foo = MOVE NEXT IN foo move forward 1 from foo = MOVE NEXT IN foo move 1 from foo = MOVE NEXT IN foo move backward 1 from foo = MOVE PRIOR IN foo move prior in foo = MOVE PRIOR IN foo move absolute 1 foo = MOVE FIRST IN foo move absolute -1 foo = MOVE LAST IN foo move absolute 42 foo = MOVE ABSOLUTE 42 IN foo pglast-7.7/tests/test_printers_prettification/dml/select.sql000066400000000000000000000351611477366773500246470ustar00rootroot00000000000000select * from sometable = SELECT * FROM sometable select from sometable = SELECT FROM sometable select 'foo' as barname,b,c from sometable where c between 1 and 2 = SELECT 'foo' AS barname , b , c FROM sometable WHERE c BETWEEN 1 AND 2 select 'foo' as barname,b,c from sometable where c between 1 and 2 = SELECT 'foo' AS barname, b, c FROM sometable WHERE c BETWEEN 1 AND 2 : {'compact_lists_margin': 80} select * from fmt a, fmt b where a.id <> b.id and (not a.f or b.f) = SELECT * FROM fmt AS a, fmt AS b WHERE a.id <> b.id AND (NOT a.f OR b.f) select * from fmt a, fmt b where a.id <> b.id and (not a.f or b.f) = SELECT * FROM fmt AS a, fmt AS b WHERE a.id <> b.id AND (NOT a.f OR b.f) : {'compact_lists_margin': 30} select * from fmt a, fmt b where a.id <> b.id and (not a.f or b.f) = SELECT * FROM fmt AS a, fmt AS b WHERE a.id <> b.id AND (NOT a.f OR b.f) : {'compact_lists_margin': 120} select 'foo' as barname,b,c, (select somevalue from othertable where othertable.x = 1 and othertable.y = 2 and othertable.z = 3) from sometable where c between 1 and 2 = SELECT 'foo' AS barname , b , c , (SELECT somevalue FROM othertable WHERE othertable.x = 1 AND othertable.y = 2 AND othertable.z = 3) FROM sometable WHERE c BETWEEN 1 AND 2 select 'foo' as barname,b,c, (select somevalue from othertable where othertable.x = 1 and othertable.y = 2 and othertable.z = 3) from sometable where c between 1 and 2 = SELECT 'foo' AS barname , b , c , (SELECT somevalue FROM othertable WHERE othertable.x = 1 AND othertable.y = 2 AND othertable.z = 3) FROM sometable WHERE c BETWEEN 1 AND 2 : {'compact_lists_margin': 80} select 'foo' as barname,b,c, (select somevalue from othertable where othertable.x = 1 and othertable.y = 2 and othertable.z = 3) from sometable where c between 1 and 2 = SELECT 'foo' AS barname , b , c , (SELECT somevalue FROM othertable WHERE othertable.x = 1 AND othertable.y = 2 AND othertable.z = 3) FROM sometable WHERE c BETWEEN 1 AND 2 : {'compact_lists_margin': 60} select 'foo' as barname,b,c, (select somevalue from othertable where othertable.x = 1 and othertable.y = 2 and othertable.z = 3) from sometable where c between 1 and 2 = SELECT 'foo' AS barname, b, c, (SELECT somevalue FROM othertable WHERE othertable.x = 1 AND othertable.y = 2 AND othertable.z = 3) FROM sometable WHERE c BETWEEN 1 AND 2 : {'comma_at_eoln': True} select 'foo' as barname,b,c from sometable where c between 1 and c.threshold = SELECT 'foo' AS barname , b , c FROM sometable WHERE c BETWEEN 1 AND c.threshold select somefunc(1, 2, 3) = SELECT somefunc(1, 2, 3) SELECT pe.id FROM table1 as pe INNER JOIN table2 AS pr ON pe.project_id = pr.id LEFT JOIN table3 AS cp ON cp.person_id = pe.id INNER JOIN table4 AS c ON cp.company_id = c.id = SELECT pe.id FROM table1 AS pe INNER JOIN table2 AS pr ON pe.project_id = pr.id LEFT JOIN table3 AS cp ON cp.person_id = pe.id INNER JOIN table4 AS c ON cp.company_id = c.id SELECT pe.id FROM table1 as pe INNER JOIN table2 AS pr ON pe.project_id = pr.id LEFT JOIN (table3 AS cp INNER JOIN table4 AS c ON cp.company_id = c.id) ON cp.person_id = pe.id = SELECT pe.id FROM table1 AS pe INNER JOIN table2 AS pr ON pe.project_id = pr.id LEFT JOIN (table3 AS cp INNER JOIN table4 AS c ON cp.company_id = c.id) ON cp.person_id = pe.id SELECT sum(salary) OVER (x), avg(salary) OVER y FROM empsalary WINDOW x AS (PARTITION BY depname ORDER BY salary DESC), y as (order by salary) = SELECT sum(salary) OVER (x) , avg(salary) OVER y FROM empsalary WINDOW x AS (PARTITION BY depname ORDER BY salary DESC) , y AS (ORDER BY salary) select c_id from (select c_id, row_number() over (order by c_d_id) as rn, count(*) over() max_rn from customer where c_d_id=5) t where rn = (select floor(random()*(max_rn))+1) = SELECT c_id FROM (SELECT c_id , row_number() OVER (ORDER BY c_d_id) AS rn , count(*) OVER () AS max_rn FROM customer WHERE c_d_id = 5) AS t WHERE rn = (SELECT floor(random() * max_rn) + 1) select a.* from a left join (select distinct id from b) as b on a.id = b.id = SELECT a.* FROM a LEFT JOIN (SELECT DISTINCT id FROM b) AS b ON a.id = b.id select a.one, not a.bool_flag and a.something is null or a.other = 3 as foo, a.value1 + b.value2 * b.value3 as bar from sometable as a where not a.bool_flag2 and a.something2 is null or a.other2 = 3 = SELECT a.one , (NOT a.bool_flag AND a.something IS NULL) OR a.other = 3 AS foo , a.value1 + (b.value2 * b.value3) AS bar FROM sometable AS a WHERE (NOT a.bool_flag2 AND a.something2 IS NULL) OR a.other2 = 3 select p.name, (select format('[%s] %s', count(*), r.name) from c join r on r.contract_id = c.id where c.person_id = p.id) as roles from persons as p where p.name like 'lele%' and ((select format('[%s] %s', count(*), r.name) from c join r on r.contract_id = c.id where c.person_id = p.id) ilike 'manager%') = SELECT p.name , (SELECT format('[%s] %s' , count(*) , r.name) FROM c INNER JOIN r ON r.contract_id = c.id WHERE c.person_id = p.id) AS roles FROM persons AS p WHERE p.name LIKE 'lele%' AND (SELECT format('[%s] %s' , count(*) , r.name) FROM c INNER JOIN r ON r.contract_id = c.id WHERE c.person_id = p.id) ILIKE 'manager%' SELECT 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl' 'mnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' = SELECT 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX' 'YZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV' 'WXYZ1234567890' : {'split_string_literals_threshold': 50} SELECT 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkl' 'mnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890' = SELECT E'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX' 'YZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV' 'WXYZ\n1234567890' : {'split_string_literals_threshold': 50} SELECT '1234567890\abcdefghi' = SELECT '1234567890\a' 'bcdefghi' : {'split_string_literals_threshold': 11} SELECT TIMESTAMP '2001-02-16 20:38:40' AT TIME ZONE 'MST' = SELECT pg_catalog.timezone('MST' , CAST('2001-02-16 20:38:40' AS timestamp)) SELECT TIMESTAMP '2001-02-16 20:38:40' AT TIME ZONE 'MST' = SELECT CAST('2001-02-16 20:38:40' AS timestamp) AT TIME ZONE 'MST' : {'special_functions': True} SELECT * FROM manufacturers ORDER BY EXTRACT('year' FROM deliver_date) ASC, EXTRACT('month' FROM deliver_date) ASC, EXTRACT('day' FROM deliver_date) ASC = SELECT * FROM manufacturers ORDER BY pg_catalog.extract('year', deliver_date) ASC , pg_catalog.extract('month', deliver_date) ASC , pg_catalog.extract('day', deliver_date) ASC SELECT * FROM manufacturers ORDER BY EXTRACT('year' FROM deliver_date) ASC, EXTRACT(month FROM deliver_date) ASC, EXTRACT('day' FROM deliver_date) ASC = SELECT * FROM manufacturers ORDER BY EXTRACT(YEAR FROM deliver_date) ASC , EXTRACT(MONTH FROM deliver_date) ASC , EXTRACT(DAY FROM deliver_date) ASC : {'special_functions': True} SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS (DATE '2001-10-30', DATE '2002-10-30') = SELECT pg_catalog."overlaps"(CAST('2001-02-16' AS date) , CAST('2001-12-21' AS date) , CAST('2001-10-30' AS date) , CAST('2002-10-30' AS date)) SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS (DATE '2001-10-30', DATE '2002-10-30') = SELECT (CAST('2001-02-16' AS date), CAST('2001-12-21' AS date)) OVERLAPS (CAST('2001-10-30' AS date), CAST('2002-10-30' AS date)) : {'special_functions': True} select email from subscribed where email not in (select email from tracks) = SELECT email FROM subscribed WHERE NOT email IN (SELECT email FROM tracks) SELECT true FROM sometable WHERE value = ANY(ARRAY[1,2]) = SELECT TRUE FROM sometable WHERE value = ANY(ARRAY[1, 2]) SELECT false FROM sometable WHERE value != ALL(ARRAY[1,2]) = SELECT FALSE FROM sometable WHERE value <> ALL(ARRAY[1, 2]) select c.name from table_a a, table_b b join table_c c on c.b_id = b.id where a.code = b.code = SELECT c.name FROM table_a AS a , table_b AS b INNER JOIN table_c AS c ON c.b_id = b.id WHERE a.code = b.code select c.name from table_b b join table_c c on c.b_id = b.id, table_a a where a.code = b.code = SELECT c.name FROM table_b AS b INNER JOIN table_c AS c ON c.b_id = b.id , table_a AS a WHERE a.code = b.code SELECT id, CASE WHEN (NOT EXISTS (SELECT TRUE FROM aaa WHERE a = 1) or exists (select true from bbb where b = 2)) and id=1 THEN NULL ELSE NOT EXISTS (SELECT TRUE FROM ccc WHERE c = 1) END FROM bar = SELECT id , CASE WHEN (NOT EXISTS (SELECT TRUE FROM aaa WHERE a = 1) OR EXISTS (SELECT TRUE FROM bbb WHERE b = 2)) AND id = 1 THEN NULL ELSE NOT EXISTS (SELECT TRUE FROM ccc WHERE c = 1) END FROM bar select case a.a when 1 then 'one' when 2 then 'two' else 'something else' end from a = SELECT CASE a.a WHEN 1 THEN 'one' WHEN 2 THEN 'two' ELSE 'something else' END FROM a select case a.a when 1 then (select b from b) when 2 then (select c from c) else (select d from d) end from a = SELECT CASE a.a WHEN 1 THEN (SELECT b FROM b) WHEN 2 THEN (SELECT c FROM c) ELSE (SELECT d FROM d) END FROM a select x from d limit all = SELECT x FROM d LIMIT ALL select x from d limit null = SELECT x FROM d LIMIT ALL (select x from d1 order by y) intersect (select n from d2 group by y limit 3) limit 2 = (SELECT x FROM d1 ORDER BY y) \n\ INTERSECT \n\ (SELECT n FROM d2 GROUP BY y LIMIT 3) LIMIT 2 /* header */ select /*one*/ 1 /*footer*/ = /* header */ SELECT /*one*/ 1 /*footer*/\s : {'preserve_comments': True} -- header 1 -- header 2 select /*one*/ 1 /* long footer */ = -- header 1 -- header 2 SELECT /*one*/ 1 /* long footer */\ : {'preserve_comments': True} -- header 1 -- header 2 select /*one*/ 1 /* long footer */ = /*header 1*/ /*header 2*/ SELECT /*one*/ 1 /*long footer */ : {'preserve_comments': True, 'raw_stream': True} select 1 -- */ foobar = SELECT 1 /**{ZERO WIDTH NO-BREAK SPACE}/ foobar*/ : {'preserve_comments': True, 'raw_stream': True} select 4294967310 = SELECT 4294967310 select t1.* from tab1 as t1 where t1.code like (select t2.code||'.%' from tab1 t2 where t2.id = 'foo') = SELECT t1.* FROM tab1 AS t1 WHERE t1.code LIKE (SELECT t2.code || '.%' FROM tab1 AS t2 WHERE t2.id = 'foo') with recursive t(n) as (values (1) union all select n+1 from t where n < 100) select sum(n) from t; = WITH RECURSIVE t(n) AS (VALUES (1) \n\ UNION ALL \n\ SELECT n + 1 FROM t WHERE n < 100) \n\ SELECT sum(n) FROM t with cte_1 as (select 1), cte_2 as (select * from cte_1) select * from cte_2 = WITH cte_1 AS (SELECT 1) \n\ , cte_2 AS (SELECT * FROM cte_1) \n\ SELECT * FROM cte_2 with cte_1 as (select 1), cte_2 as (select * from cte_1) select * from cte_2 = WITH cte_1 AS (SELECT 1), cte_2 AS (SELECT * FROM cte_1) SELECT * FROM cte_2 : {'raw_stream': True} SELECT 1 FROM ONLY "public"."produit" x WHERE "produit_id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x = SELECT 1 FROM ONLY public.produit AS x WHERE produit_id OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x create table my_table (created_at timestamptz not null default (current_timestamp at time zone 'UTC'), constraint in_the_past check (created_at <= (current_timestamp at time zone 'UTC'))) = CREATE TABLE my_table ( created_at timestamptz NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') , CONSTRAINT in_the_past CHECK (created_at <= CURRENT_TIMESTAMP AT TIME ZONE 'UTC') ) : {'special_functions': True} create table my_table (created_at timestamptz not null default ('1 hour'::interval + current_timestamp at time zone 'UTC')) = CREATE TABLE my_table ( created_at timestamptz NOT NULL DEFAULT CAST('1 hour' AS interval) + (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') ) : {'special_functions': True} create table my_table (created_at timestamptz not null default (now() at local)) = CREATE TABLE my_table ( created_at timestamptz NOT NULL DEFAULT (now() AT LOCAL) ) : {'special_functions': True} SELECT jt.* FROM my_films, JSON_TABLE (js, '$.favorites[*]' COLUMNS ( id FOR ORDINALITY, kind text PATH '$.kind', title text PATH '$.films[*].title' WITH WRAPPER, director text PATH '$.films[*].director' WITH WRAPPER)) AS jt = SELECT jt.* FROM my_films , json_table(js, '$.favorites[*]' COLUMNS (id FOR ORDINALITY , kind text PATH '$.kind' , title text PATH '$.films[*].title' WITH UNCONDITIONAL WRAPPER , director text PATH '$.films[*].director' WITH UNCONDITIONAL WRAPPER)) AS jt SELECT * FROM JSON_TABLE (favorites, '$.favorites[*]' COLUMNS ( user_id FOR ORDINALITY, NESTED '$.movies[*]' COLUMNS ( movie_id FOR ORDINALITY, mname text PATH '$.name', director text), NESTED '$.books[*]' COLUMNS ( book_id FOR ORDINALITY, bname text PATH '$.name', NESTED '$.authors[*]' COLUMNS ( author_id FOR ORDINALITY, author_name text PATH '$.name')))) = SELECT * FROM json_table(favorites, '$.favorites[*]' COLUMNS (user_id FOR ORDINALITY , NESTED PATH '$.movies[*]' COLUMNS (movie_id FOR ORDINALITY , mname text PATH '$.name' , director text) , NESTED PATH '$.books[*]' COLUMNS (book_id FOR ORDINALITY , bname text PATH '$.name' , NESTED PATH '$.authors[*]' COLUMNS (author_id FOR ORDINALITY , author_name text PATH '$.name')))) pglast-7.7/tests/test_printers_prettification/dml/truncate.sql000066400000000000000000000003301477366773500252030ustar00rootroot00000000000000truncate sometable cascade = TRUNCATE TABLE sometable CASCADE truncate foo, only bar = TRUNCATE TABLE foo, ONLY bar TRUNCATE bigtable, fattable RESTART IDENTITY = TRUNCATE TABLE bigtable, fattable RESTART IDENTITY pglast-7.7/tests/test_printers_prettification/dml/update.sql000066400000000000000000000011761477366773500246510ustar00rootroot00000000000000update sometable set value='foo', changed=NOW where id='bar' and value<>'foo' = UPDATE sometable SET value = 'foo' , changed = now WHERE id = 'bar' AND value <> 'foo' update sometable set value=null = UPDATE sometable SET value = NULL update sometable set value='foo', changed=NOW where id='bar' and value<>'foo' = UPDATE sometable SET value = 'foo', changed = now WHERE id = 'bar' AND value <> 'foo' : {'compact_lists_margin': 80} update sometable set value='foo', changed=NOW where id='bar' and value<>'foo' = UPDATE sometable SET value = 'foo', changed = now WHERE id = 'bar' AND value <> 'foo' : {'compact_lists_margin': 33} pglast-7.7/tests/test_printers_roundtrip.py000066400000000000000000000141411477366773500214420ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Assert printers eat their own result # :Created: dom 17 mar 2019 09:24:11 CET # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2019, 2021, 2022, 2023, 2024 Lele Gaifax # from pathlib import Path from re import sub, subn import sys import pytest from pglast import parse_sql, split from pglast.parser import ParseError from pglast.stream import RawStream, IndentedStream import pglast.printers # noqa this = Path(__file__) this_dir = this.parent tests_dir = this_dir / this.stem def statements(src): lineno = 1 for statement in src.read_text().split('\n\n'): yield lineno, statement.strip() lineno += statement.count('\n') + 2 def make_id(arg): if isinstance(arg, Path): return str(arg.relative_to(this_dir)) elif isinstance(arg, int): return str(arg) @pytest.mark.parametrize('src,lineno,statement', ((src, lineno, statement) for src in sorted(tests_dir.glob('**/*.sql')) for (lineno, statement) in statements(src)), ids=make_id) def test_printers_roundtrip(src, lineno, statement): try: orig_ast = parse_sql(statement) except: # noqa raise RuntimeError("%s:%d:Could not parse “%s”" % (src, lineno, statement)) serialized = RawStream()(orig_ast) try: serialized_ast = parse_sql(serialized) except: # noqa raise RuntimeError("%s:%d:Could not reparse “%s”" % (src, lineno, serialized)) assert orig_ast == serialized_ast, ("Statement “%s” from %s at line %d != “%s”" % (statement, src, lineno, serialized)) indented = IndentedStream()(orig_ast) try: indented_ast = parse_sql(indented) except: # noqa raise RuntimeError("%s:%d:Could not reparse “%s”" % (src, lineno, indented)) assert orig_ast == indented_ast, ("Statement “%s” from %s at line %d != “%s”" % (statement, src, lineno, indented)) # Run ``pytest -s tests/`` to see the following output print() print(indented) @pytest.mark.parametrize('src,lineno,statement', ((src, lineno, statement) for src in sorted(tests_dir.glob('**/*.sql')) for (lineno, statement) in statements(src)), ids=make_id) def test_stream_call_with_single_node(src, lineno, statement): # See https://github.com/lelit/pglast/pull/10 and https://github.com/lelit/pglast/issues/79 try: parsed = parse_sql(statement) except: # noqa raise RuntimeError("%s:%d:Could not parse “%s”" % (src, lineno, statement)) for rawstmt in parsed: stmt = rawstmt.stmt try: RawStream()(stmt) except Exception: raise AssertionError('Could not serialize single statement %r' % stmt) pg_regressions_dir = this_dir / '..' / 'libpg_query' / 'test' / 'sql' / 'postgres_regress' # Following scripts contain intentional errors which are difficult to isolate, or # are systems specific skip_for_good_reasons = { 'unicode.sql', 'collate.icu.utf8.sql' if sys.platform == 'win32' else 'collate.windows.win1252.sql' } @pytest.mark.parametrize('filename', (src.name for src in sorted(pg_regressions_dir.glob('*.sql')) if src.name not in skip_for_good_reasons), ids=make_id) def test_pg_regress_corpus(filename): # we do this dance to minimize the length of the test name src = pg_regressions_dir / filename source = src.read_text() try: slices = split(source, with_parser=False, only_slices=True) except Exception: return for slice in slices: stmt = source[slice] lineno = source[:slice.start].count('\n') + 1 # Remove comments and replace \n to make it easier cut&pasting the stmt # in `pgpp -t` trimmed_stmt = stmt.strip() while trimmed_stmt.startswith('--'): trimmed_stmt = sub(r'--.*\n', '', trimmed_stmt) lineno += 1 trimmed_stmt = subn(r'[\n\t]+', ' ', trimmed_stmt)[0].strip() rel_src = src.relative_to(this_dir / '..') try: orig_ast = parse_sql(stmt) except ParseError: continue except Exception as e: raise RuntimeError("Statement “%s” from %s at line %d, could not parse: %s" % (trimmed_stmt, rel_src, lineno, e)) try: serialized = RawStream()(orig_ast) except NotImplementedError as e: raise NotImplementedError("Statement “%s” from %s at line %d, could not reprint: %s" % (trimmed_stmt, rel_src, lineno, e)) except Exception as e: raise RuntimeError("Statement “%s” from %s at line %d, could not reprint: %s" % (trimmed_stmt, rel_src, lineno, e)) try: serialized_ast = parse_sql(serialized) except Exception as e: raise RuntimeError("Statement “%s” from %s at line %d, could not reparse “%s”: %s" % (trimmed_stmt, rel_src, lineno, serialized, e)) assert orig_ast == serialized_ast, "Statement “%s” from %s at line %d != “%s”" % ( trimmed_stmt, rel_src, lineno, serialized) @pytest.mark.parametrize('src,lineno,statement', ((src, lineno, statement) for src in sorted(tests_dir.glob('**/*.sql')) for (lineno, statement) in statements(src)), ids=make_id) def test_ast_serialization_roundtrip(src, lineno, statement): try: orig_ast = parse_sql(statement) except: # noqa raise RuntimeError("%s:%d:Could not parse %r" % (src, lineno, statement)) stmt = orig_ast[0].stmt serialized = stmt() clone = stmt.__class__(serialized) assert stmt == clone pglast-7.7/tests/test_printers_roundtrip/000077500000000000000000000000001477366773500210675ustar00rootroot00000000000000pglast-7.7/tests/test_printers_roundtrip/ddl/000077500000000000000000000000001477366773500216325ustar00rootroot00000000000000pglast-7.7/tests/test_printers_roundtrip/ddl/alter_database.sql000066400000000000000000000001731477366773500253070ustar00rootroot00000000000000ALTER DATABASE db1 ALLOW_CONNECTIONS true ALTER DATABASE db1 CONNECTION LIMIT 10 ALTER DATABASE db1 SET work_mem = '2GB' pglast-7.7/tests/test_printers_roundtrip/ddl/alter_default_privileges.sql000066400000000000000000000003601477366773500274160ustar00rootroot00000000000000ALTER DEFAULT PRIVILEGES FOR ROLE role1, role2 IN SCHEMA s1, s2 GRANT ALL PRIVILEGES ON TABLES TO grantee1, grantee2 ALTER DEFAULT PRIVILEGES FOR ROLE role1, role2 IN SCHEMA s1, s2 REVOKE INSERT, UPDATE ON TABLES FROM grantee1, grantee2 pglast-7.7/tests/test_printers_roundtrip/ddl/alter_domain.sql000066400000000000000000000000641477366773500250110ustar00rootroot00000000000000ALTER DOMAIN zipcode DROP CONSTRAINT zipchk CASCADE pglast-7.7/tests/test_printers_roundtrip/ddl/alter_extension.sql000066400000000000000000000002671477366773500255630ustar00rootroot00000000000000ALTER EXTENSION foo UPDATE TO '2.0' ALTER EXTENSION hstore ADD FUNCTION populate_record(anyelement, hstore) ALTER EXTENSION hstore DROP FUNCTION populate_record(anyelement, hstore) pglast-7.7/tests/test_printers_roundtrip/ddl/alter_fdw.sql000066400000000000000000000000521477366773500243170ustar00rootroot00000000000000ALTER FOREIGN DATA WRAPPER foo NO HANDLER pglast-7.7/tests/test_printers_roundtrip/ddl/alter_function.sql000066400000000000000000000003001477366773500253600ustar00rootroot00000000000000ALTER FUNCTION funca(somearg text) COST 100 ALTER FUNCTION func_without_args() IMMUTABLE ALTER FUNCTION func() SET search_path TO public,schema2 ALTER PROCEDURE func() SET schema TO public pglast-7.7/tests/test_printers_roundtrip/ddl/alter_owner.sql000066400000000000000000000003151477366773500246730ustar00rootroot00000000000000ALTER FUNCTION fonction1() OWNER TO rol1 ALTER VIEW v1 OWNER TO rol2 ALTER TABLE t1 OWNER TO rol3 ALTER SCHEMA schema1 OWNER TO rol4 ALTER OPERATOR CLASS public.ean13_ops USING btree OWNER TO postgres pglast-7.7/tests/test_printers_roundtrip/ddl/alter_policy.sql000066400000000000000000000001741477366773500250430ustar00rootroot00000000000000ALTER POLICY test_policy ON some_table TO some_role USING ( current_user = c1 ) WITH CHECK ( current_user = c2) pglast-7.7/tests/test_printers_roundtrip/ddl/alter_rename.sql000066400000000000000000000007411477366773500250130ustar00rootroot00000000000000ALTER TABLE told RENAME to tnew ALTER TABLE told RENAME cold TO cnew ALTER TABLE IF EXISTS told RENAME cold TO cnew ALTER TABLE IF EXISTS cold RENAME TO told ALTER FUNCTION oldfunc(int) RENAME TO newfunc ALTER SCHEMA s1 RENAME TO s2 ALTER DATABASE db1 RENAME TO db2 ALTER TYPE test RENAME TO test2 ALTER TYPE my.test RENAME TO test2 ALTER VIEW vold RENAME TO zold ALTER VIEW IF EXISTS vold RENAME TO zold ALTER OPERATOR FAMILY foo.alt_opf1 USING hash RENAME TO alt_opf2 pglast-7.7/tests/test_printers_roundtrip/ddl/alter_role.sql000066400000000000000000000003021477366773500244760ustar00rootroot00000000000000ALTER ROLE r1 LOGIN ALTER ROLE r1 NOLOGIN ALTER ROLE r2 CONNECTION LIMIT 10 ALTER ROLE r2 VALID UNTIL '1900-01-01' SUPERUSER ALTER ROLE ALL IN DATABASE devel SET client_min_messages = DEBUG pglast-7.7/tests/test_printers_roundtrip/ddl/alter_sequence.sql000066400000000000000000000001121477366773500253440ustar00rootroot00000000000000ALTER SEQUENCE serial MINVALUE 2 ALTER SEQUENCE IF EXISTS foo AS integer pglast-7.7/tests/test_printers_roundtrip/ddl/alter_server.sql000066400000000000000000000000361477366773500250470ustar00rootroot00000000000000ALTER SERVER foo VERSION NULL pglast-7.7/tests/test_printers_roundtrip/ddl/alter_set_schema.sql000066400000000000000000000001431477366773500256530ustar00rootroot00000000000000ALTER TABLE t1 SET SCHEMA s2 ALTER FUNCTION func1(int) SET SCHEMA s2 ALTER TYPE t1 SET SCHEMA s2 pglast-7.7/tests/test_printers_roundtrip/ddl/alter_subscription.sql000066400000000000000000000003221477366773500262630ustar00rootroot00000000000000alter subscription foo disable alter subscription foo set publication x, y with (refresh = true) alter subscription foo refresh publication alter subscription foo refresh publication with (copy_data = true) pglast-7.7/tests/test_printers_roundtrip/ddl/alter_table.sql000066400000000000000000000044121477366773500246320ustar00rootroot00000000000000ALTER TABLE t1 ALTER c1 TYPE varchar(20) ALTER TABLE t1 ALTER c1 TYPE montype USING mafonction(c1) ALTER TABLE t1 OWNER TO role1 ALTER TABLE t1 ALTER c1 SET STATISTICS 1000 ALTER TABLE t1 ALTER COLUMN c1 SET STORAGE EXTERNAL ALTER TABLE t1 ALTER C1 SET DEFAULT 'default' ALTER TABLE IF EXISTS t1 ALTER C1 DROP DEFAULT ALTER TABLE t1 ADD COLUMN IF NOT EXISTS c1 int ALTER TABLE t2 DROP COLUMN IF EXISTS c1 ALTER TABLE t2 DROP COLUMN IF EXISTS c1 CASCADE ALTER TABLE t2 ENABLE TRIGGER trig1 ALTER TABLE t2 DISABLE TRIGGER trig1 ALTER TABLE t1 ALTER COLUMN c1 DROP NOT NULL ALTER TABLE t1 ALTER COLUMN c2 SET NOT NULL ALTER TABLE t1 ADD FOREIGN KEY (c1) REFERENCES t2(c1) DEFERRABLE INITIALLY DEFERRED NOT VALID ALTER TABLE t1 DROP CONSTRAINT IF EXISTS c1_check ALTER TABLE t1 CLUSTER ON c1_idx ALTER TABLE t1 ENABLE ROW LEVEL SECURITY ALTER TABLE t1 DISABLE ROW LEVEL SECURITY ALTER TABLE t1 VALIDATE CONSTRAINT c1_check ALTER TABLE t1 ADD PRIMARY KEY USING INDEX t1_idx ALTER TABLE t1 ADD CONSTRAINT con1 UNIQUE USING INDEX t1_idx DEFERRABLE INITIALLY DEFERRED ALTER TABLE t1 ADD CONSTRAINT con1 EXCLUDE USING gist (f WITH OPERATOR(intarray.&&)) ALTER FOREIGN TABLE c1 ADD COLUMN c1 int ALTER TABLE t1 RENAME CONSTRAINT con1 TO con2 ALTER INDEX idx1 ALTER COLUMN c1 SET STATISTICS 100 ALTER INDEX idx1 ALTER COLUMN 2 SET STATISTICS 100 ALTER TABLE t1 SET LOGGED ALTER TABLE t1 SET UNLOGGED ALTER TABLE t1 ALTER COLUMN c1 RESTART ALTER TABLE t1 ALTER COLUMN c1 RESTART WITH 42 ALTER TABLE t1 ALTER COLUMN c1 SET CACHE 1 ALTER TABLE t1 ALTER COLUMN c1 SET CYCLE ALTER TABLE t1 ALTER COLUMN c1 SET NO CYCLE ALTER TABLE t1 ALTER COLUMN c1 SET NO MAXVALUE ALTER TABLE t1 ALTER COLUMN c1 SET MAXVALUE 1 ALTER TABLE t1 ALTER COLUMN c1 SET NO MINVALUE ALTER TABLE t1 ALTER COLUMN c1 SET MINVALUE 1 ALTER TABLE t1 ALTER COLUMN c1 SET SEQUENCE NAME foo ALTER TABLE t1 ENABLE REPLICA TRIGGER foo ALTER TABLE x ADD UNIQUE (k) WITH (foo='bar', bar='foo') ALTER TABLE ALL IN TABLESPACE foo OWNED BY me SET TABLESPACE bar NOWAIT ALTER TABLE table_name ENABLE TRIGGER ALL ALTER TABLE sch3ma.t1 ALTER COLUMN c1 ADD GENERATED BY DEFAULT AS IDENTITY ( SEQUENCE NAME sch3ma.t1 START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1 ) ALTER TABLE t1 ALTER COLUMN c1 SET GENERATED ALWAYS pglast-7.7/tests/test_printers_roundtrip/ddl/alter_text_search.sql000066400000000000000000000004031477366773500260500ustar00rootroot00000000000000ALTER TEXT SEARCH CONFIGURATION my_config ALTER MAPPING FOR word, asciiword REPLACE english WITH swedish ALTER TEXT SEARCH CONFIGURATION my_config ADD MAPPING FOR word WITH english ALTER TEXT SEARCH CONFIGURATION my_config DROP MAPPING IF EXISTS FOR word pglast-7.7/tests/test_printers_roundtrip/ddl/alter_type.sql000066400000000000000000000003511477366773500245220ustar00rootroot00000000000000ALTER TYPE t1 ADD VALUE 'value3' ALTER TYPE t1 ADD VALUE 'value2.5' BEFORE 'value3' ALTER TYPE t1 ADD VALUE 'value3.5' AFTER 'value3' ALTER TYPE t1 ADD VALUE IF NOT EXISTS 'value3' ALTER TYPE t1 RENAME VALUE 'value1' TO 'value2' pglast-7.7/tests/test_printers_roundtrip/ddl/analyze.sql000066400000000000000000000000601477366773500240120ustar00rootroot00000000000000ANALYZE T1(c1) ANALYZE VERBOSE t2(c1) ANALYZE pglast-7.7/tests/test_printers_roundtrip/ddl/cluster.sql000066400000000000000000000000651477366773500240350ustar00rootroot00000000000000CLUSTER t1 USING idx1 CLUSTER VERBOSE t1 USING idx1 pglast-7.7/tests/test_printers_roundtrip/ddl/comment.sql000066400000000000000000000054411477366773500240210ustar00rootroot00000000000000COMMENT ON ACCESS METHOD rtree IS 'R-Tree access method' COMMENT ON AGGREGATE my_aggregate (double precision) IS 'Computes sample variance' COMMENT ON CAST (text AS int4) IS 'Allow casts from text to int4' COMMENT ON COLLATION "fr_CA" IS 'Canadian French' COMMENT ON COLUMN my_table.my_column IS 'Employee ID number' COMMENT ON CONVERSION my_conv IS 'Conversion to UTF8' COMMENT ON CONSTRAINT bar_col_cons ON bar IS 'Constrains column col' COMMENT ON CONSTRAINT dom_col_constr ON DOMAIN dom IS 'Constrains col of domain' COMMENT ON DATABASE my_database IS 'Development Database' COMMENT ON DOMAIN my_domain IS 'Email Address Domain' COMMENT ON EXTENSION hstore IS 'implements the hstore data type' COMMENT ON FOREIGN DATA WRAPPER mywrapper IS 'my foreign data wrapper' COMMENT ON FOREIGN TABLE my_foreign_table IS 'Employee Information in other database' COMMENT ON FUNCTION my_function (timestamp) IS 'Returns Roman Numeral' COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee ID' COMMENT ON LANGUAGE plpython IS 'Python support for stored procedures' COMMENT ON LARGE OBJECT 346344 IS 'Planning document' COMMENT ON MATERIALIZED VIEW my_matview IS 'Summary of order history' COMMENT ON OPERATOR ^ (text, text) IS 'Performs intersection of two texts' COMMENT ON OPERATOR - (NONE, integer) IS 'Unary minus' COMMENT ON OPERATOR CLASS int4ops USING btree IS '4 byte integer operators for btrees' COMMENT ON OPERATOR FAMILY integer_ops USING btree IS 'all integer operators for btrees' COMMENT ON POLICY my_policy ON mytable IS 'Filter rows by users' COMMENT ON ROLE my_role IS 'Administration group for finance tables' COMMENT ON RULE my_rule ON my_table IS 'Logs updates of employee records' COMMENT ON SCHEMA my_schema IS 'Departmental data' COMMENT ON SEQUENCE my_sequence IS 'Used to generate primary keys' COMMENT ON SERVER myserver IS 'my foreign server' COMMENT ON STATISTICS my_statistics IS 'Improves planner row estimations' COMMENT ON TABLE my_schema.my_table IS 'Employee Information' COMMENT ON TABLESPACE my_tablespace IS 'Tablespace for indexes' COMMENT ON TEXT SEARCH CONFIGURATION my_config IS 'Special word filtering' COMMENT ON TEXT SEARCH DICTIONARY swedish IS 'Snowball stemmer for Swedish language' COMMENT ON TEXT SEARCH PARSER my_parser IS 'Splits text into words' COMMENT ON TEXT SEARCH TEMPLATE snowball IS 'Snowball stemmer' COMMENT ON TRANSFORM FOR hstore LANGUAGE plpythonu IS 'Transform between hstore and Python dict' COMMENT ON TRIGGER my_trigger ON my_table IS 'Used for RI' COMMENT ON TYPE complex IS 'Complex number data type' COMMENT ON VIEW my_view IS 'Lorem ipsum dolor sit amet, consectetur adipisicing elit,' ' sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.' ' Ut enimad minim veniam, quis nostrud exercitation ullamco laboris.' pglast-7.7/tests/test_printers_roundtrip/ddl/create_access_method.sql000066400000000000000000000002121477366773500264720ustar00rootroot00000000000000CREATE ACCESS METHOD heptree TYPE INDEX HANDLER heptree_handler CREATE ACCESS METHOD "Heptree" TYPE INDEX HANDLER "MySchema"."MyHandler" pglast-7.7/tests/test_printers_roundtrip/ddl/create_aggregate.sql000066400000000000000000000023121477366773500256220ustar00rootroot00000000000000CREATE AGGREGATE sum (complex) ( sfunc = complex_add, stype = complex, initcond = '(0,0)' ) CREATE AGGREGATE sum (complex) ( sfunc = complex_add, stype = complex, initcond = '(0,0)', parallel = safe ) CREATE AGGREGATE avg (float8) ( sfunc = float8_accum, stype = float8[], finalfunc = float8_avg, initcond = '{0,0,0}' ) CREATE AGGREGATE sum (complex) ( sfunc = complex_add, stype = complex, initcond = '(0,0)', msfunc = complex_add, minvfunc = complex_sub, mstype = complex, minitcond = '(0,0)' ) CREATE AGGREGATE array_accum (anyelement) ( sfunc = array_append, stype = anyarray, initcond = '{}' ) CREATE AGGREGATE array_agg (anynonarray) ( sfunc = array_agg_transfn, stype = internal, finalfunc = array_agg_finalfn, finalfunc_extra ) CREATE AGGREGATE percentile_disc (float8 ORDER BY anyelement) ( sfunc = ordered_set_transition, stype = internal, finalfunc = percentile_disc_final, finalfunc_extra ) CREATE AGGREGATE percentile_disc (float8 ORDER BY anyelement) ( sfunc = ordered_set_transition, stype = internal, finalfunc = percentile_disc_final, finalfunc_extra, hypotetical ) pglast-7.7/tests/test_printers_roundtrip/ddl/create_cast.sql000066400000000000000000000006771477366773500246420ustar00rootroot00000000000000CREATE CAST (bigint AS int4) WITH FUNCTION int4(bigint) AS ASSIGNMENT CREATE CAST (varchar AS citext) WITHOUT FUNCTION AS ASSIGNMENT CREATE CAST (citext AS varchar) WITHOUT FUNCTION AS IMPLICIT CREATE CAST (text AS casttesttype) WITHOUT FUNCTION CREATE CAST (text AS casttesttype) WITHOUT FUNCTION AS IMPLICIT CREATE CAST (int4 AS casttesttype) WITH INOUT CREATE CAST (int4 AS casttesttype) WITH FUNCTION int4_casttesttype(int4) AS IMPLICIT pglast-7.7/tests/test_printers_roundtrip/ddl/create_collation.sql000066400000000000000000000005401477366773500256610ustar00rootroot00000000000000CREATE COLLATION french (locale = 'fr_FR.utf8') CREATE COLLATION IF NOT EXISTS french (locale = 'fr_FR.utf8') CREATE COLLATION german_phonebook (provider = icu, locale = 'de-u-co-phonebk') CREATE COLLATION german FROM "de_DE" CREATE COLLATION IF NOT EXISTS german FROM "de_DE" CREATE COLLATION mycoll2 ( LC_COLLATE = "POSIX", LC_CTYPE = "POSIX" ) pglast-7.7/tests/test_printers_roundtrip/ddl/create_conversion.sql000066400000000000000000000002011477366773500260540ustar00rootroot00000000000000CREATE CONVERSION myconv FOR 'UTF8' TO 'LATIN1' FROM myfunc CREATE DEFAULT CONVERSION myconv FOR 'UTF8' TO 'LATIN1' FROM myfunc pglast-7.7/tests/test_printers_roundtrip/ddl/create_database.sql000066400000000000000000000004221477366773500254400ustar00rootroot00000000000000CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace CREATE DATABASE music LC_COLLATE 'sv_SE.utf8' LC_CTYPE 'sv_SE.utf8' TEMPLATE template0 CREATE DATABASE music2 LC_COLLATE 'sv_SE.iso885915' LC_CTYPE 'sv_SE.iso885915' ENCODING LATIN9 TEMPLATE template0 pglast-7.7/tests/test_printers_roundtrip/ddl/create_fdw.sql000066400000000000000000000002331477366773500244540ustar00rootroot00000000000000CREATE FOREIGN DATA WRAPPER dummy CREATE FOREIGN DATA WRAPPER file HANDLER file_fdw_handler CREATE FOREIGN DATA WRAPPER mywrapper OPTIONS (debug 'true') pglast-7.7/tests/test_printers_roundtrip/ddl/create_function.sql000066400000000000000000000016661477366773500255340ustar00rootroot00000000000000CREATE OR REPLACE FUNCTION funca(somearg text, someotherarg text) RETURNS void AS $$ BEGIN PERFORM $function$$function$; RETURN; END; $$ language plpgsql IMMUTABLE PARALLEL SAFE STRICT CREATE FUNCTION funcb(somearg text) RETURNS TABLE(c1 int, c2 text) AS $$ SELECT 1, 'Label 1' $$ language sql SECURITY INVOKER CREATE FUNCTION funcb() RETURNS TABLE(c1 int, c2 text) AS $$ SELECT 1, 'Label 1' $$ language sql SECURITY DEFINER CREATE FUNCTION func_in_c(arg text) RETURNS text AS 'function_name', 'lib.so' LANGUAGE C CREATE FUNCTION funcc(arg text = 'default_val', OUT arg2 text, INOUT arg3 text, VARIADIC arglist text[]) RETURNS SETOF integer AS $$ $$ language sql CREATE FUNCTION func() RETURNS SETOF montype AS $$ $$ language sql CREATE PROCEDURE func() AS $$ $$ language sql CREATE FUNCTION funcb(somearg text) RETURNS TABLE(c1 int, c2 text) AS $$ SELECT 1, 'Label 1' $$ language sql SET search_path FROM CURRENT pglast-7.7/tests/test_printers_roundtrip/ddl/create_index.sql000066400000000000000000000012331477366773500250040ustar00rootroot00000000000000create index aidx on atbl (value) create index aidx on atbl using gin (value) create unique index if not exists aidx on atbl (value) create index aidx on atbl (value) where value is not null create index aidx on atbl (value1 asc nulls first, value2 desc nulls last) create index concurrently aidx on atbl using gin (value) with (fastupdate = ON, gin_pending_list_limit = 100) create index aidx on atbl (value) tablespace foo create index aidx on atbl (value collate "it_IT") CREATE INDEX test_index ON test_table (col varchar_pattern_ops) CREATE INDEX aidx ON atbl USING gin(value public.trgm_pattern_ops) CREATE INDEX aidx ON atbl (id) INCLUDE (col, col2) pglast-7.7/tests/test_printers_roundtrip/ddl/create_operator.sql000066400000000000000000000011321477366773500255260ustar00rootroot00000000000000CREATE OPERATOR "MySchema".+ ( LEFTARG = box, RIGHTARG = box, PROCEDURE = area_sum_procedure ) CREATE OPERATOR === ( LEFTARG = box, RIGHTARG = box, PROCEDURE = area_equal_procedure, COMMUTATOR = ===, NEGATOR = !==, RESTRICT = area_restriction_procedure, JOIN = area_join_procedure, HASHES, MERGES ) CREATE OPERATOR === ( LEFTARG = box, RIGHTARG = box, PROCEDURE = area_equal_procedure, COMMUTATOR = OPERATOR("MySchema".===), NEGATOR = !==, RESTRICT = area_restriction_procedure, JOIN = area_join_procedure, HASHES, MERGES ) pglast-7.7/tests/test_printers_roundtrip/ddl/create_operator_class.sql000066400000000000000000000021071477366773500267160ustar00rootroot00000000000000CREATE OPERATOR CLASS bloom_uuid_ops DEFAULT FOR TYPE uuid USING bloom AS OPERATOR 1 =(uuid, uuid), FUNCTION 1 uuid_hash(uuid) CREATE OPERATOR CLASS alt_opc1 FOR TYPE macaddr USING hash AS STORAGE macaddr CREATE OPERATOR CLASS box_ops DEFAULT FOR TYPE box USING gist2 AS OPERATOR 1 <<, OPERATOR 2 &<, OPERATOR 3 &&, OPERATOR 4 &>, OPERATOR 5 >>, OPERATOR 6 ~=, OPERATOR 7 @>, OPERATOR 8 <@, OPERATOR 9 &<|, OPERATOR 10 <<|, OPERATOR 11 |>>, OPERATOR 12 |&>, OPERATOR 13 ~, OPERATOR 14 @, FUNCTION 1 gist_box_consistent(internal, box, smallint, oid, internal), FUNCTION 2 gist_box_union(internal, internal), -- don't need compress, decompress, or fetch functions FUNCTION 5 gist_box_penalty(internal, internal, internal), FUNCTION 6 gist_box_picksplit(internal, internal), FUNCTION 7 gist_box_same(box, box, internal) pglast-7.7/tests/test_printers_roundtrip/ddl/create_policy.sql000066400000000000000000000004221477366773500251730ustar00rootroot00000000000000CREATE POLICY test_policy ON some_table AS PERMISSIVE FOR ALL TO some_role USING ( current_user = c1 ) WITH CHECK ( current_user = c2) CREATE POLICY test_policy ON some_table AS RESTRICTIVE FOR UPDATE TO CURRENT_USER USING ( current_user = c1 ) pglast-7.7/tests/test_printers_roundtrip/ddl/create_role.sql000066400000000000000000000001051477366773500246330ustar00rootroot00000000000000CREATE ROLE lele WITH SYSID 1000 CREATE ROLE lele WITH ADMIN r1, r2 pglast-7.7/tests/test_printers_roundtrip/ddl/create_schema.sql000066400000000000000000000003631477366773500251400ustar00rootroot00000000000000create schema myschema create schema authorization joe create schema if not exists test authorization joe create schema test authorization public create schema test authorization current_user create schema test authorization session_user pglast-7.7/tests/test_printers_roundtrip/ddl/create_sequence.sql000066400000000000000000000006031477366773500255050ustar00rootroot00000000000000CREATE SEQUENCE serial START 101 CREATE TEMP SEQUENCE serial CREATE TEMP SEQUENCE serial NO CYCLE CREATE SEQUENCE IF NOT EXISTS "SomeSchema"."SomeSerial" as smallint CREATE TEMP SEQUENCE serial INCREMENT 2 MINVALUE 5 NO MAXVALUE CREATE TEMP SEQUENCE serial INCREMENT 2 MINVALUE 5 MAXVALUE 15 START WITH 7 CYCLE CREATE SEQUENCE serial OWNED BY "SomeSchema"."SomeTable"."SomeColumn" pglast-7.7/tests/test_printers_roundtrip/ddl/create_table.sql000066400000000000000000000155511477366773500247740ustar00rootroot00000000000000create table a (id serial primary key, value integer) create table a (id serial, value integer null unique) create table a (id serial, value integer not null) create table a (id serial, value integer not null default 1) create table if not exists a (id serial) create temporary table if not exists a (id serial) create temporary table a (id serial) on commit drop create temporary table a (id serial) on commit delete rows create temporary table a (id serial) on commit preserve rows create temporary table a (id serial) inherits ("BaseTable") on commit preserve rows create unlogged table if not exists a (id serial) create table a (value integer) inherits (b, c) create table a (name text not null check (position('@' in name) = 0)) create table a (value integer not null check (value < 10) no inherit) create table "Someschema"."Sometable" (a integer primary key) create table a ( id serial primary key, v integer references b(id) on delete cascade on update cascade ) create table a ( id serial primary key, v integer references b(id) on delete set default on update restrict ) create table a ( id serial primary key, v integer references b(id) on delete restrict on update set default ) create table a ( id serial primary key, v integer references b(id) on delete restrict on update set null ) CREATE TABLE a(t text collate "C") CREATE TABLE a(t text collate pg_catalog."C" NOT NULL) CREATE TABLE ages ( id integer primary key, age1 interval year, age2 interval month, age3 interval day, age4 interval hour, age5 interval minute, age6a interval second, age6b interval second (5), age7 interval year to month, age8 interval day to hour, age9 interval day to minute, age10a interval day to second, age10b interval day to second (5), age11 interval hour to minute, age11 interval hour to second, age11a interval minute to second, age11b interval minute to second (5) ) CREATE TABLE films ( code char(5) CONSTRAINT firstkey PRIMARY KEY, title varchar(40) NOT NULL, did integer NOT NULL, date_prod date, kind varchar(10), len interval hour to minute ) CREATE TABLE distributors ( did integer PRIMARY KEY DEFAULT nextval('serial'), name varchar(40) NOT NULL CHECK (name <> '') ) CREATE TABLE array_int ( vector int[][] ) CREATE TABLE films ( code char(5), title varchar(40), did integer, date_prod date, kind varchar(10), len interval hour to minute, CONSTRAINT production UNIQUE(date_prod) ) CREATE TABLE distributors ( did integer, name varchar(40) CONSTRAINT con1 CHECK (did > 100 AND name <> '') ) CREATE TABLE films ( code char(5), title varchar(40), did integer, date_prod date, kind varchar(10), len interval hour to second(3), CONSTRAINT code_title PRIMARY KEY(code,title) ) CREATE TABLE distributors ( did integer, name varchar(40), UNIQUE(name) USING INDEX TABLESPACE indexes ) CREATE TABLE distributors ( did integer, name varchar(40), UNIQUE(name) WITH (fillfactor=70) USING INDEX TABLESPACE indexes ) WITH (fillfactor=70) CREATE TABLE distributors ( did integer, name varchar(40) ) INHERITS ("BaseTable") WITH (fillfactor=70) CREATE TABLE circles ( c circle, EXCLUDE USING gist (c WITH &&) ) CREATE TABLE contracts ( id id_t NOT NULL, company_id id_t NOT NULL, company_contract_kind_id id_t NULL REFERENCES company_contract_kinds (id) ON DELETE SET NULL ON UPDATE CASCADE, validity period_t NOT NULL, PRIMARY KEY (id), EXCLUDE USING gist (cast(company_id AS text) WITH =, validity WITH &&) ) CREATE TABLE contracts ( company_id id_t NOT NULL, validity period_t NOT NULL, EXCLUDE USING gist ((company_id::text) WITH =, validity WITH &&) ) CREATE TABLE cities ( id id_t NOT NULL, name text NOT NULL, region_id id_t NOT NULL, country_id id_t NOT NULL, PRIMARY KEY (id), FOREIGN KEY (region_id, country_id) REFERENCES regions (id, country_id) MATCH FULL ) CREATE TABLE cities ( id id_t NOT NULL, name text NOT NULL, region_id id_t NOT NULL, country_id id_t NOT NULL, PRIMARY KEY (id), FOREIGN KEY (region_id, country_id) REFERENCES regions (id, country_id) MATCH SIMPLE ON DELETE RESTRICT ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED ) CREATE TABLE test ( id int NOT NULL REFERENCES t2 DEFERRABLE INITIALLY DEFERRED ) CREATE TABLE cinemas ( id serial, name text, location text ) TABLESPACE diskvol1 CREATE TABLE employees OF employee_type ( PRIMARY KEY (name), salary WITH OPTIONS DEFAULT 1000 ) CREATE TABLE measurement ( logdate date not null, peaktemp int, unitsales int ) PARTITION BY RANGE (logdate) CREATE TABLE measurement_year_month ( logdate date not null, peaktemp int, unitsales int ) PARTITION BY RANGE (EXTRACT(YEAR FROM logdate), EXTRACT(MONTH FROM logdate)) CREATE TABLE cities ( city_id bigserial not null, name text not null, population bigint ) PARTITION BY LIST (left(lower(name), 1)) CREATE TABLE measurement_y2016m07 PARTITION OF measurement ( unitsales DEFAULT 0 ) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01') CREATE TABLE measurement_ym_older PARTITION OF measurement_year_month FOR VALUES FROM (MINVALUE, MINVALUE) TO (2016, MAXVALUE) CREATE TABLE cities_ab PARTITION OF cities ( CONSTRAINT city_id_nonzero CHECK (city_id != 0) ) FOR VALUES IN ('a', 'b') CREATE TABLE films2 AS TABLE films CREATE TABLE films2 AS TABLE films WITH NO DATA CREATE TABLE films2 AS VALUES (1,2) CREATE TEMPORARY TABLE films2 AS VALUES (1,2) CREATE TABLE films2 WITH (fillfactor=70) ON COMMIT PRESERVE ROWS AS VALUES (1,2) CREATE TABLE films2 ON COMMIT DELETE ROWS TABLESPACE "Foo" AS TABLE films CREATE TABLE films2 ON COMMIT DROP AS TABLE films CREATE UNLOGGED TABLE IF NOT EXISTS "SomeSchema".films2 (id, title) AS SELECT id, title FROM films CREATE TABLE films_recent AS SELECT * FROM films WHERE date_prod >= '2002-01-01' CREATE TEMP TABLE films_recent ON COMMIT PRESERVE ROWS AS SELECT * FROM films WHERE date_prod >= '2002-01-01' CREATE TEMP TABLE films_recent ON COMMIT DELETE ROWS AS SELECT * FROM films WHERE date_prod >= '2002-01-01' CREATE TEMP TABLE films_recent ON COMMIT DROP AS EXECUTE recentfilms('2002-01-01') CREATE TABLE test AS SELECT * FROM t1 LIMIT 1 CREATE TABLE test WITHOUT OIDS AS SELECT * FROM t1 create table t1 (id int) using heap create table t1 (like t2 including comments) create table t1 (like t2 including indexes including statistics) create tablespace foo location '/bar' create tablespace foo owner current_user location '/bar' create tablespace foo owner me location '/bar' create tablespace foo location '/bar' with (seq_page_cost=1) pglast-7.7/tests/test_printers_roundtrip/ddl/create_trigger.sql000066400000000000000000000015521477366773500253440ustar00rootroot00000000000000CREATE TRIGGER trig1 BEFORE INSERT OR UPDATE OF c1 OR DELETE ON table1 FOR EACH ROW EXECUTE PROCEDURE trigfunc() CREATE TRIGGER trig2 INSTEAD OF UPDATE ON table1 FOR EACH ROW EXECUTE PROCEDURE trigfunc('param') CREATE TRIGGER trig3 AFTER INSERT ON table1 FOR EACH ROW WHEN (OLD.c1 != NEW.c1) EXECUTE PROCEDURE trigfunc() CREATE CONSTRAINT TRIGGER trig4 AFTER INSERT ON table1 DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE PROCEDURE trigfunc() CREATE TRIGGER trig5 AFTER INSERT ON table2 REFERENCING OLD TABLE as t1 NEW TABLE as t2 FOR EACH STATEMENT EXECUTE PROCEDURE trigfunc() CREATE CONSTRAINT TRIGGER monitor_account_status AFTER UPDATE ON accounts DEFERRABLE INITIALLY DEFERRED FOR EACH ROW WHEN ((((new.status_id = ANY (ARRAY[4, 5, 6])) <> (old.status_id = ANY (ARRAY[4, 5, 6]))) OR (new.status_id = 7))) EXECUTE PROCEDURE log_account_status_change() pglast-7.7/tests/test_printers_roundtrip/ddl/create_type.sql000066400000000000000000000001311477366773500246520ustar00rootroot00000000000000CREATE TYPE t1 AS ENUM ('value1', 'value2') CREATE TYPE tcomposite AS (c1 int, c2 text) pglast-7.7/tests/test_printers_roundtrip/ddl/create_view.sql000066400000000000000000000002201477366773500246420ustar00rootroot00000000000000CREATE OR REPLACE VIEW v1 AS SELECT 1 CREATE VIEW v2 AS SELECT 2 CREATE MATERIALIZED VIEW v3 AS SELECT 3 CREATE UNLOGGED VIEW v4 AS SELECT 4 pglast-7.7/tests/test_printers_roundtrip/ddl/discard.sql000066400000000000000000000000741477366773500237650ustar00rootroot00000000000000DISCARD ALL DISCARD PLANS DISCARD SEQUENCES DISCARD TEMP pglast-7.7/tests/test_printers_roundtrip/ddl/do.sql000066400000000000000000000000511477366773500227510ustar00rootroot00000000000000DO $$ some_code $$ language somelanguage pglast-7.7/tests/test_printers_roundtrip/ddl/drop.sql000066400000000000000000000035561477366773500233300ustar00rootroot00000000000000drop access method some_name cascade DROP AGGREGATE myrank(VARIADIC "any" ORDER BY VARIADIC "any") DROP AGGREGATE myavg(integer), myavg(bigint) DROP CAST (text AS int) DROP COLLATION german DROP CONVERSION myname drop database if exists mydb DROP DOMAIN "NameSpace"."Domain" DROP EVENT TRIGGER snitch DROP EXTENSION hstore DROP FOREIGN DATA WRAPPER dbi DROP FOREIGN TABLE films, distributors drop function slower_one(int, int) drop function if exists "Mine".generic_function DROP INDEX title_idx DROP INDEX CONCURRENTLY title_idx DROP LANGUAGE plsample DROP MATERIALIZED VIEW order_summary DROP OPERATOR ^ (integer, integer) DROP OPERATOR ~ (none, bit), ! (bigint, none) DROP OPERATOR CLASS widget_ops USING btree DROP OPERATOR FAMILY "My".float_ops USING btree drop owned by "White" drop owned by current_user cascade DROP POLICY p1 ON my_table DROP PUBLICATION mypublication DROP ROLE myrole DROP RULE newrule ON mytable DROP SEQUENCE serial DROP SCHEMA a,"B" CASCADE DROP SERVER IF EXISTS foo CASCADE DROP STATISTICS IF EXISTS accounting.users_uid_creation, public.grants_user_role DROP SUBSCRIPTION mysub DROP SUBSCRIPTION IF EXISTS mysub CASCADE drop table foo.bar DROP TABLESPACE IF EXISTS mystuff DROP TEXT SEARCH CONFIGURATION my_english DROP TEXT SEARCH CONFIGURATION IF EXISTS my_english CASCADE DROP TEXT SEARCH DICTIONARY english DROP TEXT SEARCH DICTIONARY IF EXISTS english CASCADE DROP TEXT SEARCH TEMPLATE thesaurus DROP TEXT SEARCH TEMPLATE IF EXISTS "Thesaurus" CASCADE DROP TRANSFORM FOR hstore LANGUAGE plpythonu DROP TRIGGER "If_dist_exists" ON "Films" DROP TRIGGER trig1 ON public."Films" DROP USER IF EXISTS barry, "White" DROP USER MAPPING IF EXISTS FOR bob SERVER foo DROP USER MAPPING FOR user SERVER "Foo" DROP USER MAPPING FOR current_user SERVER foo DROP TYPE "Foo", bar RESTRICT DROP VIEW x.y DROP PROCEDURE test pglast-7.7/tests/test_printers_roundtrip/ddl/grant.sql000066400000000000000000000004521477366773500234670ustar00rootroot00000000000000GRANT SELECT ON ALL TABLES IN SCHEMA public TO role1, role2 GRANT EXECUTE ON FUNCTION func1() TO role1 GRANT SELECT, INSERT ON TABLE t1 TO role1 GRANT role1 TO role2 GRANT role1 TO role2 WITH ADMIN OPTION GRANT USAGE ON TYPE foo TO CURRENT_USER GRANT CREATE ON TABLESPACE foo TO SESSION_USER pglast-7.7/tests/test_printers_roundtrip/ddl/lock_table.sql000066400000000000000000000001251477366773500244500ustar00rootroot00000000000000LOCK t1 IN ROW SHARE MODE LOCK t1, t2 IN ROW SHARE MODE NOWAIT LOCK TABLE ONLY t1 pglast-7.7/tests/test_printers_roundtrip/ddl/reindex.sql000066400000000000000000000001321477366773500240050ustar00rootroot00000000000000reindex database foo reindex (verbose false) table bar reindex (verbose true) table bar pglast-7.7/tests/test_printers_roundtrip/ddl/revoke.sql000066400000000000000000000001411477366773500236420ustar00rootroot00000000000000REVOKE ALL ON TABLE t1 FROM role1 REVOKE SELECT ON TABLE t1 FROM role1 REVOKE role1 FROM role2 pglast-7.7/tests/test_printers_roundtrip/ddl/security_label.sql000066400000000000000000000000641477366773500253610ustar00rootroot00000000000000SECURITY LABEL FOR selinux ON TABLE mytable IS NULL pglast-7.7/tests/test_printers_roundtrip/ddl/vacuum.sql000066400000000000000000000002511477366773500236510ustar00rootroot00000000000000VACUUM t1 VACUUM VACUUM ANALYZE t1(c1) VACUUM FULL FREEZE t1 VACUUM FULL VACUUM FULL FREEZE VERBOSE t3 VACUUM (VERBOSE, ANALYZE, DISABLE_PAGE_SKIPPING, FREEZE) t4 pglast-7.7/tests/test_printers_roundtrip/dml/000077500000000000000000000000001477366773500216435ustar00rootroot00000000000000pglast-7.7/tests/test_printers_roundtrip/dml/copy.sql000066400000000000000000000006421477366773500233400ustar00rootroot00000000000000copy binary manual_export TO STDOUT with null as '@' copy binary manual_export from stdin using delimiters '|' with null as '@' copy manual_export (a, b) to '/tmp/me.txt' with csv header escape as '^' copy manual_export (a, b) to '/tmp/me.txt' with binary escape '^' copy manual_export (a, b) to '/tmp/me.txt' with delimiter '|' csv header escape '^' copy manual_export (a, b) to '/tmp/me.txt' with (header true) pglast-7.7/tests/test_printers_roundtrip/dml/cursor.sql000066400000000000000000000001061477366773500236760ustar00rootroot00000000000000DECLARE c INSENSITIVE CURSOR FOR SELECT ctid,cmin,* FROM combocidtest pglast-7.7/tests/test_printers_roundtrip/dml/delete.sql000066400000000000000000000010501477366773500236220ustar00rootroot00000000000000DELETE FROM films DELETE FROM ONLY films DELETE FROM tasks WHERE status = 'DONE' RETURNING * DELETE FROM employees WHERE EXISTS(SELECT id FROM acme_persons WHERE name='lele') DELETE FROM employees WHERE id != ALL(SELECT id FROM acme_persons WHERE name='lele') WITH acme_persons(id) as (SELECT id FROM accounts WHERE name = 'Acme Corporation') DELETE FROM employees WHERE id IN (SELECT id FROM acme_persons) DELETE FROM films USING producers WHERE producer_id = producers.id AND producers.name = 'foo' DELETE FROM extensions WHERE values[0] = $1 pglast-7.7/tests/test_printers_roundtrip/dml/insert.sql000066400000000000000000000030011477366773500236620ustar00rootroot00000000000000INSERT INTO films VALUES ('UA502', 'Bananas', 105, '1971-07-13', 'Comedy', '82 minutes') INSERT INTO films (code, title, did, date_prod, kind) VALUES ('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'), ('HG120', 'The Dinner Game', 140, DEFAULT, 'Comedy') INSERT INTO films DEFAULT VALUES INSERT INTO films SELECT * FROM tmp_films WHERE date_prod < '2004-05-07' INSERT INTO distributors ("Did", dname) VALUES (DEFAULT, 'XYZ Widgets') RETURNING "Did", changed INSERT INTO tictactoe (game, board[1:3][1:3]) VALUES (1, '{{" "," "," "},{" "," "," "},{" "," "," "}}') WITH upd AS ( UPDATE employees SET sales_count = sales_count + 1 WHERE id = (SELECT sales_person FROM accounts WHERE name = 'Acme Corporation') RETURNING * ) INSERT INTO employees_log SELECT *, current_timestamp FROM upd INSERT INTO distributors (did, dname) VALUES (7, 'Redline GmbH') ON CONFLICT (did) DO NOTHING INSERT INTO distributors (did, dname) VALUES (9, 'Antwerp Design') ON CONFLICT ON CONSTRAINT distributors_pkey DO NOTHING INSERT INTO distributors (did, dname) VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname INSERT INTO distributors AS d (did, dname) VALUES (8, 'Anvil Distribution') ON CONFLICT (did) DO UPDATE SET dname = EXCLUDED.dname || ' (formerly ' || d.dname || ')' WHERE d.zipcode <> '21201' INSERT INTO distributors (did, dname) VALUES (10, 'Conrad International') ON CONFLICT (did) WHERE is_active DO NOTHING pglast-7.7/tests/test_printers_roundtrip/dml/reset.sql000066400000000000000000000000351477366773500235040ustar00rootroot00000000000000RESET search_path RESET ALL pglast-7.7/tests/test_printers_roundtrip/dml/select.sql000066400000000000000000000341301477366773500236440ustar00rootroot00000000000000SELECT m.name FROM manufacturers m WHERE (m.deliver_date = CURRENT_DATE OR m.deliver_time = CURRENT_TIME OR m.deliver_ts IN (LOCALTIME, CURRENT_TIMESTAMP, LOCALTIMESTAMP)) AND m.who = CURRENT_USER AND m.role = CURRENT_ROLE SELECT 'a', 123, 3.14159, $$this is a "complex" string containing apostrophe (') and newline (\n)$$, U&'Euro symbol: \20ac', 'Naïve', B'01', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' SELECT pc.id, pc.values[1] FROM ONLY ns.table SELECT 'accbf276-705b-11e7-b8e4-0242ac120002'::UUID as "X" SELECT 'foo' as "Naïve" SELECT 'foo' as """DoubleQuoted""" SELECT 0.0e1 SELECT CAST('accbf276-705b-11e7-b8e4-0242ac120002' AS uuid) as "X" SELECT CAST('accbf276-705b-11e7-b8e4-0242ac120002' AS "MySchema"."MyType") as "X" SELECT pc.id as x, common.func(pc.name, ' ') FROM ns.table pc ORDER BY pc.name ASC NULLS LAST SELECT * FROM manufacturers ORDER BY EXTRACT('year' FROM deliver_date) ASC, EXTRACT('month' FROM deliver_date) ASC, EXTRACT('day' FROM deliver_date) ASC SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS (DATE '2001-10-30', DATE '2002-10-30') select ((c.one + 1) * (c.two - 1)) / (c.three + 1) from sometable c select true from sometable c where ((c.one + 1) * (c.two - 1)) / (c.three + 1) > 1 SELECT pc.id as "foo bar" FROM ns.table pc ORDER BY pc.name DESC NULLS FIRST SELECT x.id, (select count(*) FROM sometable as y where y.id = x.id) count from firsttable as x select id, count(*) FROM sometable GROUP BY id order by id desc nulls last select id, count(*) FROM sometable GROUP BY GROUPING SETS ((c1, c2), (c1, c3)) select id, count(*) FROM sometable GROUP BY GROUPING SETS (id, c2) select id, count(*) FROM sometable GROUP BY CUBE (id, c2) select id, count(*) FROM sometable GROUP BY ROLLUP (id, c2) select id, count(*) FROM sometable GROUP BY GROUPING SETS ((id, c1), CUBE(c2, c3)) SELECT id, count(*) FROM sometable GROUP BY id having count(*) > 2 order by count(*) using @> nulls first SELECT DISTINCT value FROM sometable WHERE NOT disabled SELECT DISTINCT ON (pc.id) pc.id as x, pc.foo, pc.bar, other.some FROM ns.table AS pc, ns.other as other WHERE pc.id < 10 and pc.foo = 'a' and (pc.foo = 'b' or pc.foo = 'c' and (x = 1 or x = 2)) select a,b from sometable union select c,d from othertable select a,b from sometable union all select c,d from othertable select a,b from sometable except select c,d from othertable select a,b from sometable intersect all select c,d from othertable SELECT count(distinct a) from sometable SELECT 1 OPERATOR(pg_catalog.>) 0 SELECT (a + b)::int SELECT (a, b, c) = (d, e, f) SELECT * FROM generate_series(1, 10) as t(i int) SELECT array_agg(a ORDER BY b DESC) FROM sometable SELECT count(*) AS a, count(*) FILTER (WHERE i < 5 or i > 10) AS b FROM sometable SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY income) FROM households SELECT depname, empno, salary, avg(salary) OVER (PARTITION BY depname) FROM empsalary SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary DESC) FROM empsalary SELECT salary, sum(salary) OVER () FROM empsalary SELECT salary, sum(salary) OVER (ORDER BY salary) FROM empsalary SELECT "Depname", "Empno", "Salary", enroll_date, rank() OVER (PARTITION BY "Depname" ORDER BY "Salary" DESC, "Empno") AS pos FROM empsalary SELECT sum(salary) OVER "X", avg(salary) OVER y FROM empsalary WINDOW "X" AS (PARTITION BY depname ORDER BY salary DESC), y as (order by salary) SELECT sum(salary) OVER (x), avg(salary) OVER y FROM empsalary WINDOW x AS (PARTITION BY depname ORDER BY salary DESC), y as (order by salary) SELECT CustomerID, SUM(TotalDue) OVER(PARTITION BY CustomerID ORDER BY OrderDate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM SalesOrderHeader SELECT CustomerID, SUM(TotalDue) OVER(PARTITION BY CustomerID ORDER BY OrderDate RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM SalesOrderHeader SELECT CustomerID, SUM(TotalDue) OVER(PARTITION BY CustomerID ORDER BY OrderDate RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM SalesOrderHeader SELECT CustomerID, SUM(TotalDue) OVER(PARTITION BY CustomerID ORDER BY OrderDate ROWS BETWEEN 0 PRECEDING AND 2 FOLLOWING) FROM SalesOrderHeader SELECT CustomerID, SUM(TotalDue) OVER(PARTITION BY CustomerID ORDER BY OrderDate ROWS BETWEEN 1 PRECEDING AND 2 PRECEDING) FROM SalesOrderHeader SELECT CustomerID, SUM(TotalDue) OVER(PARTITION BY CustomerID ORDER BY OrderDate ROWS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING) FROM SalesOrderHeader SELECT "CustomerID", SUM(TotalDue) OVER(PARTITION BY "CustomerID" ORDER BY "OrderDate" RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM SalesOrderHeader select a.id, b.value from sometable a join othertable b on b.id = a.id select a.id, b.value from sometable a natural join othertable b select a."Id", b.value from sometable a join othertable b using ("Id") select a.* from a left join (select distinct id from b) as b on a."Id" = b."Id" select name from sometable limit 2 offset 3 select name from sometable offset 3 fetch next 2 rows only SELECT m.* FROM mytable m FOR UPDATE SELECT m.* FROM mytable m FOR UPDATE NOWAIT SELECT m.* FROM mytable m FOR UPDATE SKIP LOCKED SELECT m.* FROM mytable m FOR KEY SHARE SELECT m.* FROM mytable m FOR NO KEY UPDATE SELECT m.* FROM mytable m FOR SHARE of m nowait select case a.value when 0 then '1' else '2' end from sometable a select case when a.value = 0 then '1' else '2' end from sometable a SELECT schedule[1:2][1:1] FROM sal_emp WHERE name = 'Bill' SELECT schedule[:2][2:] FROM sal_emp WHERE name = 'Bill' SELECT schedule[:][1:1] FROM sal_emp WHERE name = 'Bill' SELECT concat_lower_or_upper(a => 'Hello', b => 'World') SELECT concat_lower_or_upper('Hello', 'World', "UpperCase" => true) SELECT (arrayfunction($1,$2))[42] SELECT (arrayfunction(1)).field1[42][7]."Field2" SELECT (myfunc(x)).* FROM some_table SELECT (myfunc(x)).a, (myfunc(x)).b, (myfunc(x)).c FROM some_table SELECT (compositecol).a FROM sometable SELECT ("Sometable"."CompositeCol")."A" FROM sometable SELECT * FROM unnest(ARRAY['a','b','c','d','e','f']) WITH ORDINALITY SELECT * FROM pg_ls_dir('.') WITH ORDINALITY AS t(ls,n) SELECT * FROM ROWS FROM(generate_series(10,11), get_users()) WITH ORDINALITY SELECT * FROM (VALUES (1),(2),(3)) v(r) LEFT JOIN ROWS FROM( foo_sql(11,13), foo_mat(11,13) ) WITH ORDINALITY AS f(i1,s1,i2,s2,o) ON (r+i1+i2)<100 SELECT * FROM t1 CROSS JOIN t2 SELECT i.q1, i.q2, ss.column1 FROM int8_tbl i, LATERAL (VALUES (i.*::int8_tbl)) ss SELECT * FROM (VALUES (1, 'one'), (2, 'two')) AS t (num, "English") SELECT ARRAY(SELECT age FROM employees) SELECT ARRAY[] SELECT m.name AS mname, pname FROM manufacturers m, LATERAL get_product_names(m.id) pname SELECT m.name AS mname, pname FROM manufacturers m LEFT JOIN LATERAL get_product_names(m.id) pname ON true SELECT "A".id, "B".id FROM table_a AS "A" RIGHT JOIN table_b AS "B" ON "A".id = "B".id SELECT a.id, b.id FROM table_a FULL JOIN table_b ON a.id = b.id SELECT a.* FROM (my_table AS a JOIN your_table AS b ON a.value = b.value) AS c SELECT a.* FROM (my_table AS a JOIN your_table AS b ON a.value = b.value) AS "C" SELECT m.name FROM manufacturers m WHERE (m.deliver_date = CURRENT_DATE OR m.deliver_time = CURRENT_TIME OR m.deliver_ts IN (LOCALTIME, CURRENT_TIMESTAMP, LOCALTIMESTAMP)) AND m.who = CURRENT_USER AND m.role = CURRENT_ROLE SELECT m.id FROM manufacturers m WHERE m.deliver_date IS NULL SELECT m.id FROM manufacturers m WHERE m.deliver_date IS NOT NULL SELECT t1.c1 FROM t1 WHERE (a IS NULL) != (b IS NULL) SELECT true IS true SELECT true IS NOT true SELECT true IS false SELECT true IS NOT false SELECT true IS unknown SELECT true IS NOT unknown SELECT m.id FROM manufacturers m WHERE ROW(m.hours, m.minutes) < ROW(10, 20) WITH t AS ( SELECT random() as x FROM generate_series(1, 3) ) SELECT * FROM t UNION ALL SELECT * FROM t WITH "T" AS ( SELECT random() as x FROM generate_series(1, 3) ) SELECT * FROM "T" UNION ALL SELECT * FROM "T" SELECT * FROM "T" UNION ALL SELECT * FROM "T" ORDER BY 1, 2, 3 SELECT * FROM "T" UNION ALL SELECT * FROM "T" ORDER BY 1, 2, 3 LIMIT 2 OFFSET 1 WITH RECURSIVE employee_recursive("Distance", employee_name, manager_name) AS ( SELECT 1, employee_name, manager_name FROM employee WHERE manager_name = 'Mary' UNION ALL SELECT er."Distance" + 1, e.employee_name, e.manager_name FROM employee_recursive er, employee e WHERE er.employee_name = e.manager_name ) SELECT distance, employee_name FROM employee_recursive SELECT true FROM sometable as "ST" WHERE "ST"."Value" = ANY(ARRAY[1,2]) SELECT true FROM sometable WHERE id1 is distinct from id2 SELECT true FROM sometable WHERE id1 is not distinct from id2 SELECT NULLIF(value, othervalue) FROM sometable SELECT true FROM sometable WHERE value IN (1,2,3) SELECT true FROM sometable WHERE value NOT IN (1,2,3) SELECT true FROM sometable WHERE email LIKE 'lele@%' SELECT true FROM sometable WHERE email NOT LIKE 'lele@%' SELECT true FROM sometable WHERE email ILIKE 'lele@%' SELECT true FROM sometable WHERE email NOT ILIKE 'lele@%' SELECT true FROM sometable WHERE email SIMILAR TO 'lele@_*' SELECT true FROM sometable WHERE email NOT SIMILAR TO 'lele@_+' SELECT true FROM sometable WHERE email SIMILAR TO 'lele@_*' ESCAPE 'X' SELECT true FROM sometable WHERE value between 1 and 5 SELECT true FROM sometable WHERE value not between 1 and 5 SELECT true FROM sometable WHERE value BETWEEN SYMMETRIC 5 and 1 SELECT true FROM sometable WHERE value NOT BETWEEN SYMMETRIC 5 and 1 SELECT user, session_user, current_catalog, current_schema SELECT value FROM sometable WHERE id = $1 SELECT value FROM sometable WHERE value like $1 SELECT concat_ws($1::VARCHAR, p.last_name, p.first_name) AS "Redactor" FROM procs AS sp WHERE sp.cid = $2::UUID AND sp.name ILIKE $3::VARCHAR(192) ORDER BY sp.name SELECT CAST(1.234 AS NUMERIC(5,2)) SELECT now()::time(0) with time zone SELECT now()::timestamp(0) with time zone SELECT pc.id, pc.person_id, pc.company_id, concat_ws(' ', p.last_name, p.first_name) AS "Person", p.last_name, p.first_name, p.gender, p.birthdate, p.code, pc.person_contract_kind_id, ck.name AS "ContractKind", pc.validity, pc.validity @> CURRENT_DATE AS "Valid", (SELECT format('[%s] %s', count(*), string_agg(CASE WHEN (cp.role_id IS NOT NULL AND cp.company_site_id IS NOT NULL) THEN format('%s %s (%s)', pcr.code, pcr.name, cs.name) WHEN (cp.role_id IS NOT NULL) THEN format('%s %s', pcr.code, pcr.name) ELSE cs.name END, ', ')) AS format_1 FROM risk.company_persons AS cp LEFT OUTER JOIN risk.company_sites AS cs ON cs.id = cp.company_site_id LEFT OUTER JOIN risk.project_company_roles AS pcr ON pcr.id = cp.role_id WHERE cp.person_id = pc.person_id) AS "Roles" FROM risk.person_contracts AS pc JOIN risk.persons AS p ON p.id = pc.person_id JOIN risk.person_contract_kinds AS ck ON ck.id = pc.person_contract_kind_id WHERE pc.company_id = 'accbf276-705b-11e7-b8e4-0242ac120002' AND pc.validity @> CURRENT_DATE = true ORDER BY "Person" SELECT coalesce(deliver_date, today) from manufacturers SELECT nullif(deliver_date, today) from manufacturers SELECT greatest(deliver_date, today) from manufacturers SELECT least(deliver_date, today) from manufacturers SELECT a < ('foo' COLLATE "fr_FR") FROM test1 SELECT a < b COLLATE "de_DE" FROM test1 SELECT * FROM test1 ORDER BY a || b COLLATE "fr_FR" SELECT variadic_function(VARIADIC ARRAY['param1']); SELECT variadic_function('value1', VARIADIC ARRAY['param2']); SELECT -(1+1); SELECT +(1+1); SELECT ~(1+1); SELECT FROM test1; SELECT * from test1 WHERE foo = "between" SELECT * from test1 WHERE foo = "all" SELECT * from test1 WHERE foo = "authorization" SELECT * from test1 WHERE foo = "abort" select n from d1 intersect select n from d2 limit 3 (select n from d1 limit 3) intersect select n from d2 limit 3 (select n from d1 fetch first 3 rows only) intersect select n from d2 limit 3 (select x from d1 order by y) intersect select n from d2 (select x from d1 order by y) intersect select n from d2 limit 3 (select x from d1 order by y) intersect select n from d2 group by y (select x from d1 order by y) intersect select n from d2 group by y limit 3 (select x from d1 order by y) intersect (select n from d2 group by y limit 3) (select x from d1 order by y) intersect (select n from d2 group by y limit 3) limit 2 select n from d1 intersect select n from d2 limit 3 for update (select n from d1 for update) intersect select n from d2 limit 3 (select n from d1 for update) intersect (select n from d2 limit 3 for update) SELECT * FROM "table" INTERSECT ((SELECT * FROM "table") UNION (SELECT * FROM "table")) (SELECT * FROM "table" LIMIT 1) INTERSECT ((SELECT * FROM "table") UNION (SELECT * FROM "table")) ((SELECT * FROM "table") UNION (SELECT * FROM "table")) INTERSECT SELECT * FROM "table" ((SELECT * FROM "table") UNION (SELECT * FROM "table")) INTERSECT (SELECT * FROM "table" FOR UPDATE) WITH k AS MATERIALIZED (select * from m) select * from k; WITH k AS NOT MATERIALIZED (select * from m) select * from k; select 1 from c.b.a SELECT * INTO films_recent FROM films WHERE date_prod >= '2002-01-01' SELECT * INTO TEMP films_recent FROM films WHERE date_prod >= '2002-01-01' SELECT 1 INTO UNLOGGED foo select a from x; select b from y select 1/2. select 1e1/2.e1 select (array[1])[1] select (false and true) is false select false and true is false select (not false) is true select not false is true select a = (true is false) pglast-7.7/tests/test_printers_roundtrip/dml/set.sql000066400000000000000000000012021477366773500231520ustar00rootroot00000000000000SET CONSTRAINTS ALL IMMEDIATE SET CONSTRAINTS foo, bar IMMEDIATE SET CONSTRAINTS ALL DEFERRED SET CONSTRAINTS foo, bar DEFERRED SET TIME ZONE LOCAL SET LOCAL TIME ZONE DEFAULT SET SESSION TIME ZONE 'Europe/Rome' SET TIME ZONE INTERVAL '-08:00' hour TO minute SET TIME ZONE 'Europe/Rome'; SET TIME ZONE -7; SET datestyle TO postgres, dmy SET search_path TO my_schema, public SET TRANSACTION ISOLATION LEVEL READ COMMITTED SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SET TRANSACTION ISOLATION LEVEL REPEATABLE READ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE SET TRANSACTION NOT DEFERRABLE SET TRANSACTION SNAPSHOT 'foo' pglast-7.7/tests/test_printers_roundtrip/dml/transaction.sql000066400000000000000000000006241477366773500247130ustar00rootroot00000000000000ABORT BEGIN COMMIT COMMIT PREPARED 'foobar' PREPARE TRANSACTION 'foobar' RELEASE SAVEPOINT my_savepoint ROLLBACK ROLLBACK PREPARED 'foobar' ROLLBACK TO SAVEPOINT my_savepoint SAVEPOINT my_savepoint START TRANSACTION ISOLATION LEVEL SERIALIZABLE START TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ ONLY, DEFERRABLE START TRANSACTION ISOLATION LEVEL READ COMMITTED, READ WRITE, NOT DEFERRABLE pglast-7.7/tests/test_printers_roundtrip/dml/update.sql000066400000000000000000000020661477366773500236520ustar00rootroot00000000000000update sometable set value = 'foo' where id = 'bar' UPDATE weather SET temp_lo = temp_lo+1, temp_hi = temp_lo+15, prcp = DEFAULT WHERE city = 'San Francisco' AND date = '2003-07-03' RETURNING temp_lo, temp_hi, prcp UPDATE employees SET sales_count = sales_count + 1 FROM accounts WHERE accounts.name = 'Acme Corporation' AND employees.id = accounts.sales_person UPDATE employees SET sales_count = sales_count + 1 WHERE id = (SELECT sales_person FROM accounts WHERE name = 'Acme Corporation') WITH acme_persons(id) as (SELECT id FROM accounts WHERE name = 'Acme Corporation') UPDATE employees SET sales_count = sales_count + 1 WHERE id=(select id from acme_persons) UPDATE accounts SET (contact_first_name, contact_last_name) = (SELECT first_name, last_name FROM salesmen WHERE salesmen.id = accounts.sales_id) UPDATE tictactoe SET board[1:3][1:3] = '{{" "," "," "},{" "," "," "},{" "," "," "}}' WHERE game = 1 UPDATE extensions SET values[0] = '.gif' WHERE mime_type = 'image/gif' UPDATE extensions SET values[0] = $1 WHERE mime_type = $2 Returning "Changed" pglast-7.7/tests/test_stream.py000066400000000000000000000076651477366773500167760ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Tests on the stream.py module # :Created: sab 05 ago 2017 10:31:23 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2024 Lele Gaifax # import pytest from pglast import ast, parse_sql from pglast.printers import NODE_PRINTERS, PrinterAlreadyPresentError, SPECIAL_FUNCTIONS from pglast.printers import node_printer, special_function from pglast.stream import IndentedStream, OutputStream, RawStream def test_output_stream(): output = OutputStream() output.writes('SELECT *') output.writes(' FROM') output.writes('table ') output.writes('WHERE') output.write('id = 1') assert output.getvalue() == 'SELECT * FROM table WHERE id = 1' def test_raw_stream_with_sql(): raw_stmt_printer = NODE_PRINTERS.pop(ast.RawStmt, None) try: @node_printer(ast.RawStmt) def raw_stmt(node, output): output.write('Yeah') output = RawStream() result = output('SELECT 1; SELECT 2') assert result == 'Yeah; Yeah' finally: if raw_stmt_printer is not None: NODE_PRINTERS[ast.RawStmt] = raw_stmt_printer else: NODE_PRINTERS.pop(ast.RawStmt, None) def test_raw_stream(): raw_stmt_printer = NODE_PRINTERS.pop(ast.RawStmt, None) try: @node_printer(ast.RawStmt) def raw_stmt(node, output): output.write('Yeah') root = parse_sql('SELECT 1') output = RawStream() result = output(root) assert result == 'Yeah' finally: if raw_stmt_printer is not None: NODE_PRINTERS[ast.RawStmt] = raw_stmt_printer else: NODE_PRINTERS.pop(ast.RawStmt, None) def test_raw_stream_invalid_call(): with pytest.raises(ValueError): RawStream()(1) def test_indented_stream_with_sql(): raw_stmt_printer = NODE_PRINTERS.pop(ast.RawStmt, None) try: @node_printer(ast.RawStmt) def raw_stmt(node, output): output.write('Yeah') output = IndentedStream() result = output('SELECT 1; SELECT 2') assert result == 'Yeah;\n\nYeah' output = IndentedStream(separate_statements=False) result = output('SELECT 1; SELECT 2') assert result == 'Yeah;\nYeah' finally: if raw_stmt_printer is not None: NODE_PRINTERS[ast.RawStmt] = raw_stmt_printer else: NODE_PRINTERS.pop(ast.RawStmt, None) def test_separate_statements(): """Separate statements by ``separate_statements`` (int) newlines.""" raw_stmt_printer = NODE_PRINTERS.pop(ast.RawStmt, None) try: @node_printer(ast.RawStmt) def raw_stmt(node, output): output.write('Yeah') output = IndentedStream(separate_statements=2) result = output('SELECT 1; SELECT 2') assert result == 'Yeah;\n\n\nYeah' finally: if raw_stmt_printer is not None: NODE_PRINTERS[ast.RawStmt] = raw_stmt_printer else: NODE_PRINTERS.pop(ast.RawStmt, None) def test_special_function(): output = RawStream(special_functions=True) assert output.get_printer_for_function('foo.test_function') is None try: @special_function('foo.test_function') def test(node, output): pass assert output.get_printer_for_function('foo.test_function') is test with pytest.raises(PrinterAlreadyPresentError): @special_function('foo.test_function') def test1(node, output): pass @special_function('foo.test_function', override=True) def test_function(node, output): output.print_list(node.args, '-') result = output('SELECT foo.test_function(x, "Y") FROM sometable') assert result == 'SELECT x - "Y" FROM sometable' finally: SPECIAL_FUNCTIONS.pop('foo.test_function') pglast-7.7/tests/test_visitors.py000066400000000000000000000240351477366773500173530ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Tests on the visitors module # :Created: mar 11 mag 2021, 08:36:23 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021, 2022, 2024 Lele Gaifax # import pytest from pglast import ast, enums, parse_sql, visitors from pglast.stream import RawStream @pytest.mark.parametrize('stmt,rnames', ( # DDL ('alter table foo add foreign key (x) references bar (id)', {'foo', 'bar'}), ('create table foo (int a, int b references f(id))', {'foo', 'f'}), ('create view foo.bar as select 1 from there', {'foo.bar', 'there'}), ('drop table foo.bar, bar.foo', {'foo.bar', 'bar.foo'}), ('drop view foo.bar, bar.foo', {'foo.bar', 'bar.foo'}), ('drop view "my.schema".bar, bar."my.table", "foo.bar"', {'"my.schema".bar', 'bar."my.table"', '"foo.bar"'}), # DML ('insert into foo values (1)', {'foo'}), ('insert into foo select * from bar', {'foo', 'bar'}), ('select 1', set()), ('select 1 from schemata.relation', {'schemata.relation'}), ('select a from b.c.d', {'b.c.d'}), ('select * from "my.schema"."my.table"', {'"my.schema"."my.table"'}), ('update foo set a=1', {'foo'}), # CTE ('with q1(x,y) as (select 1,2) select * from q1, q2', {'q2'}), ('with my_ref as (select * from my_ref where a=1) select * from my_ref', {'my_ref'}), ('with cte1 as (select 1), cte2 as (select * from cte1) select * from cte2', set()), (''' with recursive t(n) as (values (1) union all select n+1 from t where n < 100) select sum(n) from t ''', set()), (''' with cte1 as (select 1) select * from (with cte2 as (select * from cte1) select * from cte2) as a ''', set()), (''' with to_archive as (delete from products where date < '2010-11-01' returning *) insert into products_log select * from to_archive ''', {'products', 'products_log'}), ('with "foo.bar" as (select * from tab) select * from "foo.bar"', {'tab'}), ('select (with my_ref as (select 1) select 1) from my_ref', {'my_ref'}), (''' with cte1 as (select 1) , cte2 as (with cte1 as (select * from cte1) select * from cte1) select * from cte2 ''', set()), (''' with recursive t1 as ( insert into yy select * from t2 returning * ), t2 as ( insert into y select * from y returning * ) select 1; ''', {'y', 'yy'}), (''' with recursive t(a) as ( select 11 union all select a+1 from t where a < 50 ) delete from y using t where t.a = y.a returning y.a ''', {'y'}), (''' with t as ( delete from y where a <= 10 returning * ) select * from t ''', {'y'}), (''' select count(*) from ( with q1(x) as (select random() from generate_series(1, 5)) select * from q1 union select * from q1 ) ss ''', set()) )) def test_referenced_tables(stmt, rnames): assert visitors.referenced_relations(stmt) == rnames def test_visiting_path(): from types import SimpleNamespace as SN root = SN(list=[SN(a='a'), SN(b='b')]) proot = visitors.Ancestor() assert proot @ root is root assert repr(proot) == 'ROOT' plist = proot / (root.list, 'list') assert plist @ root is root.list assert plist[0] is root.list assert plist[1] is None assert repr(plist) == 'ROOT → list' pa = plist / (root.list[0], 0) assert pa @ root is root.list[0] assert pa[0] is root.list[0] assert pa[1] is root.list assert pa[2] is None assert repr(pa) == 'ROOT → list → 0' pb = plist / (root.list[1], 1) assert pb @ root is root.list[1] assert pb[0] is root.list[1] assert pb[1] is root.list assert pb[2] is None assert repr(pb) == 'ROOT → list → 1' def test_invalid_argument(): with pytest.raises(ValueError): visitors.Visitor()('foo') def test_empty_visitor(): v = visitors.Visitor() assert v(()) is None def test_ancestors(): class Checker(visitors.Visitor): def visit_RawStmt(self, ancestors, node): pass def visit(self, ancestors, node): assert ancestors@self.root is node assert ast.RawStmt in ancestors assert ast.InsertStmt not in ancestors checker = Checker() raw = parse_sql('select 1') checker(raw) raw = parse_sql('SELECT * FROM ROWS FROM(generate_series(10,11), get_users())') checker(raw) def test_closest_node(): class Checker(visitors.Visitor): def visit(self, ancestors, node): if isinstance(node, ast.FuncCall): assert isinstance(ancestors[0], tuple) assert isinstance(abs(ancestors).node, ast.RangeFunction) raw = parse_sql('SELECT * FROM ROWS FROM(generate_series(10,11), get_users())') Checker()(raw) class CountAllNodes(visitors.Visitor): def __call__(self, node): self.count = 0 super().__call__(node) return self.count def visit(self, ancestors, node): self.count += 1 def test_count_all_nodes(): counter = CountAllNodes() raw = parse_sql('select 1') assert counter(raw) == 5 assert counter(raw[0].stmt) == 4 raw = parse_sql('SELECT * FROM ROWS FROM(generate_series(10,11), get_users())') assert counter(raw) == 14 def test_skip_action(): sql = 'select 1 where a = 1' all_nodes_count = CountAllNodes()(parse_sql(sql)) assert all_nodes_count == 11 class CountNodesSkippingExprs(visitors.Visitor): def __call__(self, node): self.count = 0 self.exprs = 0 super().__call__(node) return self.count, self.exprs def visit(self, ancestors, node): if node.__class__.__name__ == 'A_Expr': self.exprs += CountAllNodes()(node) return visitors.Skip self.count += 1 counter = CountNodesSkippingExprs() raw = parse_sql(sql) nodes, exprs = counter(raw) assert nodes == all_nodes_count - exprs class CountNodesSkippingTargets(visitors.Visitor): def __call__(self, node): self.count = 0 self.targets = 0 super().__call__(node) return self.count, self.targets def visit(self, ancestors, node): if node.__class__.__name__ == 'ResTarget': self.targets += CountAllNodes()(node) return visitors.Skip self.count += 1 counter = CountNodesSkippingTargets() raw = parse_sql('select 1 where a = 1') nodes, targets = counter(raw) assert nodes == all_nodes_count - targets def test_delete_action(): class DropNullConstraint(visitors.Visitor): def visit_Constraint(self, ancestors, node): if node.contype == enums.ConstrType.CONSTR_NULL: return visitors.Delete raw = parse_sql('create table foo (a integer null, b integer not null)') DropNullConstraint()(raw) assert RawStream()(raw) == 'CREATE TABLE foo (a integer, b integer NOT NULL)' raw = parse_sql('create table foo (a integer null check (a <> 0))') DropNullConstraint()(raw) assert RawStream()(raw) == 'CREATE TABLE foo (a integer CHECK (a <> 0))' class DeleteOddsInList(visitors.Visitor): def visit_A_Const(self, ancestors, node): if isinstance(node.val, ast.Integer): if node.val.ival % 2: return visitors.Delete raw = parse_sql('INSERT INTO foo VALUES (1, 2, 3, 42, 43)') DeleteOddsInList()(raw) assert RawStream()(raw) == 'INSERT INTO foo VALUES (2, 42)' raw = parse_sql('INSERT INTO foo VALUES ((1, 2, 3, 42, 43),' ' (2, 1, 4, 3, 5))') DeleteOddsInList()(raw) assert RawStream()(raw) == 'INSERT INTO foo VALUES ((2, 42), (2, 4))' raw = parse_sql('select true from foo where a in (1, 2, 3)') DeleteOddsInList()(raw) assert RawStream()(raw) == 'SELECT TRUE FROM foo WHERE a IN (2)' def test_alter_node(): class AddNullConstraint(visitors.Visitor): def visit_ColumnDef(self, ancestors, node): if node.colname == 'a': node.constraints = ( {'@': 'Constraint', 'contype': {'#': 'ConstrType', 'name': 'CONSTR_NOTNULL'}},) def visit_Constraint(self, ancestors, node): if ancestors[1].colname == 'b': return ast.Constraint( contype=enums.ConstrType.CONSTR_CHECK, raw_expr=ast.A_Expr(kind=enums.A_Expr_Kind.AEXPR_OP, lexpr=ast.ColumnRef(fields=(ast.String('b'),)), name=(ast.String('>'),), rexpr=ast.A_Const(val=ast.Integer(0)))) raw = parse_sql('create table foo (a integer null, b integer check (b <> 0))') AddNullConstraint()(raw) assert RawStream()(raw) == 'CREATE TABLE foo (a integer NOT NULL, b integer CHECK (b > 0))' class DoubleAllIntegers(visitors.Visitor): def visit_Integer(self, ancestors, node): return ast.Integer(node.ival * 2) raw = parse_sql('select 21') DoubleAllIntegers()(raw) assert RawStream()(raw) == 'SELECT 42' class ReplaceConstantInList(visitors.Visitor): def visit_A_Const(self, ancestors, node): return ast.A_Const(val=ast.Integer(0)) raw = parse_sql('INSERT INTO foo VALUES (42)') ReplaceConstantInList()(raw) assert RawStream()(raw) == 'INSERT INTO foo VALUES (0)' def test_replace_root_node(): class AndNowForSomethingCompletelyDifferent(visitors.Visitor): def visit_RawStmt(self, ancestors, node): return ast.RawStmt(stmt=ast.VariableShowStmt(name='all')) raw = parse_sql('select 1') new_root = AndNowForSomethingCompletelyDifferent()(raw) assert RawStream()(new_root) == 'SHOW ALL' raw = parse_sql('select 1') new_root = AndNowForSomethingCompletelyDifferent()(raw[0]) assert RawStream()(new_root) == 'SHOW ALL' pglast-7.7/tools/000077500000000000000000000000001477366773500140525ustar00rootroot00000000000000pglast-7.7/tools/extract_ast.py000066400000000000000000001011631477366773500167470ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Wrap PG nodes into a Python AST # :Created: sab 27 feb 2021, 19:47:11 # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2021, 2022, 2023, 2024 Lele Gaifax # from datetime import date import json from keyword import iskeyword from pathlib import Path import subprocess from re import match, sub CYEARS = f'2021-{date.today().year}' AST_PY_HEADER = f"""\ # -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from struct_defs.json @ %s # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © {CYEARS} Lele Gaifax # from collections import namedtuple from decimal import Decimal from enum import Enum SlotTypeInfo = namedtuple('SlotTypeInfo', ['c_type', 'py_type', 'adaptor']) def _deserialize_value(value): if isinstance(value, dict) and '@' in value: G = globals() if len(value) > 1: result = G[value['@']](value) else: result = G[value['@']]() elif isinstance(value, (tuple, list)): result = tuple(_deserialize_value(item) for item in value) else: result = value return result def _serialize_node(n, depth, ellipsis, skip_none): d = {{'@': n.__class__.__name__}} for a in n: v = _serialize_value(getattr(n, a), depth, ellipsis, skip_none) if not skip_none or v is not None: d[a] = v return d def _serialize_value(v, depth, ellipsis, skip_none): if isinstance(v, Node): if depth is None or depth > 0: v = _serialize_node(v, None if depth is None else depth - 1, ellipsis, skip_none) else: v = ellipsis elif isinstance(v, tuple): if depth is None or depth > 0: v = tuple(_serialize_value(i, None if depth is None else depth - 1, ellipsis, skip_none) for i in v) else: v = ellipsis elif isinstance(v, Enum): v = {{'#': v.__class__.__name__, 'name': v.name, 'value': v.value}} return v class Omissis: def __eq__(self, other): if other is ... or other is self: return True return False def __repr__(self): return '…' Omissis = Omissis() "Marker value used as default for the ellipsis argument" class Node: "Base class for all AST nodes." __slots__ = ('ancestors',) def __init__(self, data): if not isinstance(data, dict): # pragma: no cover raise ValueError(f'Bad argument, expected a dictionary, got {{type(data)!r}}') if '@' not in data: # pragma: no cover raise ValueError('Bad argument, expected a dictionary with a "@" key') if data['@'] != self.__class__.__name__: raise ValueError(f'Bad argument, wrong "@" value, expected' f' {{self.__class__.__name__!r}}, got {{data["@"]!r}}') for a in self: v = data.get(a) if v is not None: v = _deserialize_value(v) setattr(self, a, v) def __iter__(self): "Iterate over all attribute names of this node." return iter(self.__slots__) def __repr__(self): "Build a representation of the whole node and its subtree, for debug." attrs = [] for a in self: if a != 'location': v = getattr(self, a) if v is not None: attrs.append(f'{{a}}={{v!r}}') if attrs: attrs = ' ' + ' '.join(attrs) else: attrs = '' return '<' + self.__class__.__name__ + attrs + '>' # Set of attributes that are semantically meaningless, mostly statement offset and length _ATTRS_TO_IGNORE_IN_COMPARISON = {{'stmt_len'}} def __eq__(self, other): ''' Compare two nodes, returning ``True`` if they are considered equivalent. This is mainly an helper method used by tests: for this reason, two nodes are considered equal when all their attributes match, ignoring *positional* ones such as ``location``, ``stmt_len`` and ``stmt_location``. ''' if not isinstance(other, type(self)): return False for a in self: if a not in self._ATTRS_TO_IGNORE_IN_COMPARISON and getattr(self, a) != getattr(other, a): return False return True def __call__(self, depth=None, ellipsis=Omissis, skip_none=False): '''Serialize the node as a structure made of simple Python data-types. :type depth: ``None`` or ``int`` :param depth: if not ``None``, the maximum depth to reach :param ellipsis: the marker value that will be used to replace cut-off branch :param bool skip_none: whether ``None``-valued attributes should be elided :param bool enum_name: whether Enums will be rendered as their name only :return: a :class:`dict` instance This performs a top-down recursive visit to the whole AST tree: each :class:`Node` instance becomes a dictionary with a special ``@`` key carrying the node type, lists becomes tuples and ``Enum`` instances become dictionaries with a special ``#`` key carrying the enum name.''' return _serialize_node(self, depth, ellipsis, skip_none) def __setattr__(self, name, value): '''Validate the given `value` and if acceptable assign it to the `name` attribute. This tries to coerce the given `value` accordingly with the *ctype* of the attribute, raising opportune exception when that is not possible. ''' if value is not None and name in self.__slots__: ctype, ptype, adaptor = self.__slots__[name] if not isinstance(ptype, tuple): ptype = (ptype,) if not isinstance(value, ptype): raise ValueError(f'Bad value for attribute {{self.__class__.__name__}}' f'.{{name}}, expected {{ptype}}, got {{type(value)}}:' f' {{value!r}}') if adaptor is not None: value = adaptor(value) elif ctype != 'char*': from pglast import enums if hasattr(enums, ctype): enum = getattr(enums, ctype) if not isinstance(value, enum): if isinstance(value, dict) and '#' in value: if value['#'] != ctype: raise ValueError(f'Bad value for attribute' f' {{self.__class__.__name__}}.{{name}},' f' expected a {{ptype}}, got' f' {{value!r}}') from None if 'name' in value: value = value['name'] elif 'value' in value: value = value['value'] else: raise ValueError(f'Bad value for attribute' f' {{self.__class__.__name__}}.{{name}},' f' expected a {{ptype}}, got' f' {{value!r}}') from None try: if isinstance(value, str) and len(value) > 1: value = enum[value] else: value = enum(value) except (KeyError, ValueError): raise ValueError(f'Bad value for attribute' f' {{self.__class__.__name__}}.{{name}},' f' expected a {{ptype}}, got' f' {{value!r}}') from None else: if ctype.endswith('*'): cls = globals().get(ctype[:-1]) if cls is None: raise NotImplementedError(f'Unhandled {{ctype!r}} for attribute' f' {{self.__class__.__name__}}.{{name}}') if isinstance(value, dict) and '@' in value: value = cls(value) super().__setattr__(name, value) class Expr(Node): '''Abstract super class of several *expression* classes.''' __slots__ = () """ AST_PYX_HEADER = f"""\ # -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from struct_defs.json @ %s # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © {CYEARS} Lele Gaifax # #cython: language_level=3 from cpython.ref cimport Py_INCREF from cpython.tuple cimport PyTuple_New, PyTuple_SET_ITEM from pglast import ast, enums from pglast cimport structs cdef _pg_bitmapset_to_set(const structs.Bitmapset* bms): cdef set result cdef int m if bms is not NULL: result = set() m = structs.bms_next_member(bms, -1) while m >= 0: result.add(m) m = structs.bms_next_member(bms, m) else: result = None return result cdef _pg_list_to_tuple(const structs.List* lst, offset_to_index): cdef tuple result cdef int i if lst is not NULL: result = PyTuple_New(lst.length) for i in range(lst.length): item = create(structs.list_nth(lst, i), offset_to_index) Py_INCREF(item) PyTuple_SET_ITEM(result, i, item) else: result = None return result """ STRUCTS_PXD_HEADER = f"""\ # -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from struct_defs.json @ %s # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © {CYEARS} Lele Gaifax # #cython: language_level=3 cdef extern from "postgres.h": ctypedef unsigned char bool ctypedef struct Node: int type ctypedef struct Bitmapset: int nwords unsigned long *words cdef extern from "nodes/bitmapset.h": ctypedef struct Bitmapset: pass int bms_next_member(const Bitmapset *a, int prevbit) cdef extern from "nodes/nodes.h": ctypedef int ParseLoc cdef extern from "nodes/pg_list.h": ctypedef struct List: int length void* list_nth(List* list, int n) cdef extern from "nodes/value.h": ctypedef struct Integer: NodeTag type int ival ctypedef struct Float: NodeTag type char *fval ctypedef struct Boolean: NodeTag type bool boolval ctypedef struct String: NodeTag type char *sval ctypedef struct BitString: NodeTag type char *bsval int intVal(Integer v) double floatVal(Float v) bool boolVal(Boolean) char* strVal(String v) # ValUnion is a private type of the A_Const node, we need to redefine it here ctypedef union ValUnion: Node node Integer ival Float fval Boolean boolval String sval BitString bsval from libc.stdint cimport int16_t, int32_t, uint32_t, uint64_t """ AST_RST_HEADER = f"""\ .. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © {CYEARS} Lele Gaifax .. .. _pglast.ast: =================================================================== :mod:`pglast.ast` --- Python classes representing PG parser nodes =================================================================== The module implements a set of *data* classes, one for each ``C`` structure defined in several PostgreSQL headers, primarily those in the `include/nodes/`__ directory. __ %ssrc/postgres/include/nodes The :class:`pglast.ast.Node` is an abstract class that implements the common behaviour of all the concrete classes. In particular any node can be :meth:`compared ` with another instance, is able to :meth:`serialize ` itself and can be :meth:`altered `. .. module:: pglast.ast .. autoclass:: Node :special-members: __repr__, __eq__, __call__, __setattr__ """ def get_libpg_query_info(): "Return a tuple with (version, baseurl) of the libpg_query library." version = subprocess.check_output(['git', 'describe', '--all', '--long'], cwd='libpg_query') version = version.decode('utf-8').strip().split('/')[-1] remote = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], cwd='libpg_query') remote = remote.decode('utf-8') baseurl = '%s/blob/%s/' % (remote[:-5], version[-7:]) return version, baseurl def extract_toc(header): "Extract the enums and defines with their position in the header." toc = {} content = header.read_text(encoding='utf-8') for lineno, line in enumerate(content.splitlines(), 1): if line.startswith(('struct ', 'typedef struct ')): m = match(r'(typedef )?struct\s+([\w_]+)', line) if m is not None: toc[m.group(2)] = lineno return toc def emit_struct_def(name, fields, output): output.write(f' ctypedef struct {name}:\n') empty = True for field in fields: if 'name' not in field or 'c_type' not in field: continue ctype = field['c_type'] if ctype in ('Expr', 'Oid'): continue if name == 'A_Const' and ctype == 'Node': ctype = 'ValUnion' elif ctype == 'int16': ctype = 'int16_t' elif ctype in ('bits32', 'int32'): ctype = 'int32_t' elif ctype == 'uint32': ctype = 'uint32_t' elif ctype in ('AclMode', 'uint64'): ctype = 'uint64_t' if ctype == 'AttrNumber': ctype = 'int' elif ctype in ('Index', 'RelFileNumber', 'SubTransactionId'): ctype = 'unsigned int' elif ctype in ('Cardinality', 'Cost'): ctype = 'double' elif ctype.endswith('*'): ctype = f'const {ctype}' fname = field['name'] if iskeyword(fname): fname = f'{fname}_ "{fname}"' output.write(f' {ctype} {fname}\n') empty = False if empty: output.write(' pass\n') def emit_generic_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = data.{name} ''') def emit_bool_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = bool(data.{name}) ''') def emit_valunion_attr(name, ctype, output): # Must inline this code, because ValUnion is a private type of the A_Const node, # so it's difficult to cleanly pass the value to a subfunction output.write(f'''\ cdef object v_{name} if data.isnull: v_{name} = None elif data.{name}.boolval.type == structs.T_Boolean: v_{name} = ast.Boolean(data.{name}.boolval.boolval) elif data.{name}.ival.type == structs.T_Integer: v_{name} = ast.Integer(data.{name}.ival.ival) elif data.{name}.fval.type == structs.T_Float: v_{name} = ast.Float(data.{name}.fval.fval.decode("utf-8")) elif data.{name}.bsval.type == structs.T_BitString: v_{name} = ast.BitString(data.{name}.bsval.bsval.decode("utf-8")) elif data.{name}.sval.type == structs.T_String: v_{name} = ast.String(data.{name}.sval.sval.decode("utf-8")) else: v_{name} = data.{name}.node ''') def emit_str_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = data.{name}.decode("utf-8") if data.{name} is not NULL else None ''') def emit_char_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = chr(data.{name}) ''') def emit_list_attr(name, ctype, output): output.write(f'''\ cdef tuple v_{name} = _pg_list_to_tuple(data.{name}, offset_to_index) ''') def emit_node_attr(name, ctype, output): output.write(f'''\ cdef v_{name} = create(&data.{name}, offset_to_index) ''') def emit_create_stmt_attr(name, ctype, output): output.write(f''' cdef object v_{name} = create_CreateStmt( data, offset_to_index) ''') def emit_nodeptr_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = create(data.{name}, offset_to_index) if data.{name} is not NULL else None ''') def emit_no_attr(name, ctype, output): # output.write(f'# cdef object v_{name} = data.{name}\n') pass def emit_int_enum_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = getattr(enums, {ctype!r})(data.{name}) ''') def emit_str_enum_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = getattr(enums, {ctype!r})(chr(data.{name})) ''') def emit_bitmapset_attr(name, ctype, output): output.write(f'''\ cdef set v_{name} = _pg_bitmapset_to_set(data.{name}) ''') def emit_location_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = offset_to_index(data.{name}) ''') def emit_stmt_len_attr(name, ctype, output): output.write(f'''\ cdef object v_{name} = offset_to_index(data.stmt_location + data.{name}) - offset_to_index(data.stmt_location) ''') def emitter_for(fname, ctype, enums): from pglast import enums as eimpl if ctype == 'ParseLoc': emitter = emit_location_attr elif fname == 'stmt_len': emitter = emit_stmt_len_attr elif ctype == 'List*': emitter = emit_list_attr elif ctype == 'CreateStmt': emitter = emit_create_stmt_attr elif ctype == 'Expr': emitter = emit_no_attr elif ctype == 'NodeTag': emitter = emit_no_attr elif ctype == 'ValUnion': emitter = emit_valunion_attr elif ctype == 'char*': emitter = emit_str_attr elif ctype == 'char': emitter = emit_char_attr elif ctype == 'bool': emitter = emit_bool_attr elif ctype == 'Bitmapset*': emitter = emit_bitmapset_attr elif ctype.endswith('*'): emitter = emit_nodeptr_attr elif ctype in enums: if issubclass(getattr(eimpl, ctype), eimpl.IntEnum): emitter = emit_int_enum_attr else: emitter = emit_str_enum_attr else: emitter = emit_generic_attr return emitter def emit_node_def(name, fields, enums, url, output, doc): attrs = [] attrs_to_ignore_in_comparison = set() superclass = 'Node' for field in fields: if 'name' not in field or 'c_type' not in field: continue ctype = field['c_type'] if ctype == 'Oid': continue fname = field['name'] if iskeyword(fname): fname = f'{fname}_' if ctype in ('CoercionForm', 'ParseLoc'): attrs_to_ignore_in_comparison.add(fname) emitter = emitter_for(fname, ctype, enums) if ctype == 'Expr': superclass = 'Expr' comment = field.get('comment') if comment: comment = comment.strip() if comment.startswith('/*'): comment = comment[2:-2].strip() comment = sub(r'\t+( \* (?![A-Z] = ))?', ' ', comment) comment = sub(r'\*-+\s*', '', comment) comment = sub(r'-+\n', '', comment) comment = sub(r'\n +', '\n ', comment) comment = sub(r'\*\)', '\\*)', comment) comment = comment.strip() comment = comment[0].upper() + comment[1:] if comment.lower() == 'see above': comment = '' attrs.append((fname, ctype, comment, emitter)) real_attrs = [] if attrs: for attr, ctype, comment, emitter in attrs: if emitter is emit_no_attr: continue real_attrs.append((attr, ctype)) output.write(f'''\ class {name}({superclass}): __slots__ = {{{', '.join(repr(a) + ': ' + repr(t) for a, t in real_attrs)}}} # noqa: E501 ''') if attrs_to_ignore_in_comparison: atinc = f'{{{", ".join(repr(a) for a in sorted(attrs_to_ignore_in_comparison))}}}' output.write(f'''\ _ATTRS_TO_IGNORE_IN_COMPARISON = {superclass}._ATTRS_TO_IGNORE_IN_COMPARISON | {atinc} ''') if real_attrs: output.write(f'''\ def __init__(self, {', '.join(f'{attr}=None' for attr, __ in real_attrs)}): # pragma: no cover # noqa: E501 ''') if len(real_attrs) > 1: output.write(f'''\ if (({real_attrs[0][0]} is not None and {' is '.join(attr for attr, __ in real_attrs[1:])} is None # noqa: E501 and isinstance({real_attrs[0][0]}, dict) and '@' in {real_attrs[0][0]})): super().__init__({real_attrs[0][0]}) else: ''') else: output.write(f'''\ if (({real_attrs[0][0]} is not None and isinstance({real_attrs[0][0]}, dict) and '@' in {real_attrs[0][0]})): super().__init__({real_attrs[0][0]}) else: ''') for a, v in real_attrs: output.write(f' self.{a} = {a}\n') else: output.write('''\ def __init__(self): # pragma: no cover pass ''') doc.write(f''' .. class:: {name}({', '.join(f'{attr}=None' for attr, __ in real_attrs)}) Wrapper for the `homonymous <{url}>`__ parser node. ''') for attr, ctype, comment, emitter in attrs: if emitter is emit_no_attr: continue if ctype == 'List*': type = 'tuple' elif ctype in ('char', 'char*'): type = 'str' elif ctype == 'Node*': type = 'Node' elif ctype in enums: type = f'{ctype}' else: type = ctype doc.write(f' .. attribute:: {attr}\n') doc.write(f' :type: {type}\n\n') if comment: doc.write(f' {comment}\n\n') def emit_node_create_function(nodes, enums, output): from pglast import enums as eimpl nnames = set(n[0] for n in nodes) for name, fields in nodes: attrs = [] real_attrs = [] for field in fields: if 'name' not in field or 'c_type' not in field: continue ctype = field['c_type'] if ctype in ('Expr', 'Oid'): continue fname = field['name'] if iskeyword(fname): fname = f'{fname}_' emitter = emitter_for(fname, ctype, enums) attrs.append((fname, ctype, emitter)) if emitter is not emit_no_attr: real_attrs.append((fname, ctype)) output.write(f'''\ cdef create_{name}(structs.{name}* data, offset_to_index): ''') for attr, ctype, emitter in attrs: emitter(attr, ctype, output) output.write(f'''\ return ast.{name}({', '.join(f'v_{attr}' for attr, __ in real_attrs)}) ''') output.write('''\ cdef create(void* data, offset_to_index): if data is NULL: return None cdef tuple t cdef int i cdef str s cdef int tag = structs.nodeTag(data) ''') first = True for tag in eimpl.NodeTag: name = tag.name[2:] if name in nnames: output.write(' ') output.write('if' if first else 'elif') output.write(f' tag == structs.{tag.name}:\n') output.write(f' return create_{name}( data, offset_to_index)\n') first = False elif name == 'List': output.write(' ') output.write('if' if first else 'elif') output.write(' tag == structs.T_List:\n') output.write(' return _pg_list_to_tuple( data, offset_to_index)\n') first = False output.write('''\ raise ValueError("Unhandled tag: %s" % tag) ''') def emit_valunion_def(output): output.write(""" class ValUnion(Node): '''Represent `ValUnion`__ value. __ https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob; f=src/include/nodes/parsenodes.h;hb=c5dc80c1bc216f0e21a2f79f5e0415c2d4cfb35d#l309 ''' __slots__ = {'val': SlotTypeInfo('ValUnion', Node, None)} def __init__(self, value=None): # pragma: no cover # noqa: E501 if ((value is not None and isinstance(value, dict) and '@' in value)): super().__init__(value) else: self.val = value """) def workhorse(args): libpg_query_version, libpg_query_baseurl = get_libpg_query_info() pgq_dir = Path('libpg_query') pg_inc_dir = pgq_dir / 'src' / 'postgres' / 'include' with (pgq_dir / 'srcdata' / 'struct_defs.json').open(encoding='utf-8') as f: structs = json.load(f) ctypes = set() for header in ('nodes/parsenodes', 'nodes/primnodes'): for name in structs[header]: fields = structs[header][name]['fields'] for field in fields: if 'c_type' in field: ctypes.add(field['c_type']) with (pgq_dir / 'srcdata' / 'all_known_enums.json').open(encoding='utf-8') as f: enums = sorted(json.load(f)) with (pgq_dir / 'srcdata' / 'enum_defs.json').open(encoding='utf-8') as f: node_tags = [e['name'] for e in json.load(f)['nodes/nodes']['NodeTag']['values'] if 'name' in e] linenos = {} structs_pxd = args.output_dir / 'structs.pxd' with structs_pxd.open('w', encoding='utf-8') as output: output.write(STRUCTS_PXD_HEADER % libpg_query_version) output.write('\n\ncdef extern from *:') for name in enums: output.write(f'\n ctypedef enum {name}:\n') if name == 'NodeTag': for tag in node_tags: output.write(f' {tag}\n') else: output.write(' pass\n') output.write('\n int nodeTag(void* data)\n') nodes = [] for header in ('nodes/parsenodes', 'nodes/primnodes', 'nodes/value'): output.write(f'\n\ncdef extern from "{header}.h":\n') toc = extract_toc(pg_inc_dir / (header + '.h')) for name in toc: linenos[name] = (header, toc[name]) defs = structs[header] first = True for name in defs: fields = defs[name]['fields'] # These seem to be internal nodes, used in the *evaluation* of concrete ones if name not in {'Const', 'JsonTablePath', 'JsonTablePathScan', 'JsonTablePlan', 'JsonTableSiblingJoin', 'NextValueExpr'}: if name != 'Expr': # Omit the Expr node, because it is hand written in the # ast.py header above: also, it is an abstract class, # never instantiated directly nodes.append((name, fields)) if first: first = False else: output.write('\n') emit_struct_def(name, fields, output) ast_py = args.output_dir / 'ast.py' with ast_py.open('w', encoding='utf-8') as output, \ args.rstdoc.open('w', encoding='utf-8') as doc: output.write(AST_PY_HEADER % libpg_query_version) doc.write(AST_RST_HEADER % libpg_query_baseurl) for name, fields in sorted(nodes): header, lineno = linenos[name] url = f'{libpg_query_baseurl}src/postgres/include/{header}.h#L{lineno}' if name == 'A_Const': emit_valunion_def(output) for f in fields: if f['name'] == 'val': f['c_type'] = 'ValUnion' break emit_node_def(name, fields, enums, url, output, doc) output.write(''' def _fixup_attribute_types_in_slots(): G = globals() def traverse_sub_classes(cls): for subc in cls.__subclasses__(): yield subc yield from traverse_sub_classes(subc) for cls in traverse_sub_classes(Node): slots = cls.__slots__ if not (slots and isinstance(slots, dict) and isinstance(next(iter(slots.values())), str)): continue for attr in slots: adaptor = None ctype = slots[attr] if ctype == 'List*': ptype = (list, tuple) def adaptor(value): return tuple(G[i['@']](i) if isinstance(i, dict) and '@' in i else i for i in value) elif ctype == 'bool': ptype = (bool, int) adaptor = bool elif ctype == 'char': ptype = (str, int) def adaptor(value): if isinstance(value, int): value = chr(value) elif len(value) != 1: raise ValueError(f'Bad value for attribute {cls.__name__}.{attr},' f' expected a single char, got {value!r}') return value elif cls is Float and ctype == 'char*': ptype = (str, int, float, Decimal) adaptor = str elif ctype == 'char*': ptype = str elif ctype in {'Expr*', 'Node*'}: ptype = (dict, list, tuple, Node) def adaptor(value): if isinstance(value, dict): if '@' in value: value = G[value['@']](value) elif isinstance(value, (list, tuple)): value = tuple(G[i['@']](i) if isinstance(i, dict) and '@' in i else i for i in value) return value elif ctype in {'AclMode', 'AttrNumber', 'Index', 'ParseLoc', 'RelFileNumber', 'SubTransactionId', 'bits32', 'int', 'int16', 'int32', 'long', 'uint32', 'uint64'}: ptype = int elif ctype in {'Cardinality', 'Cost'}: ptype = float elif ctype == 'CreateStmt': ptype = (dict, CreateStmt) def adaptor(value): if isinstance(value, dict): if '@' in value: value = G[value['@']](value) return value elif ctype == 'Bitmapset*': ptype = (list, set, tuple) def adaptor(value): if isinstance(value, (list, tuple)): return set(value) else: return value elif ctype in ('JsonTablePlan', 'ValUnion'): ptype = Node else: from pglast import enums if hasattr(enums, ctype): ptype = (int, str, dict, getattr(enums, ctype)) else: if ctype.endswith('*'): ptype = G.get(ctype[:-1]) if ptype is None: aname = f'{cls.__name__}.{attr}' raise NotImplementedError(f'Unhandled C type of {aname}: {ctype}') else: ptype = (dict, ptype) else: aname = f'{cls.__name__}.{attr}' raise NotImplementedError(f'Unhandled C type of {aname}: {ctype}') slots[attr] = SlotTypeInfo(ctype, ptype, adaptor) _fixup_attribute_types_in_slots() del _fixup_attribute_types_in_slots ''') ast_pyx = args.output_dir / 'ast.pyx' with ast_pyx.open('w', encoding='utf-8') as output: output.write(AST_PYX_HEADER % libpg_query_version) emit_node_create_function(nodes, enums, output) def main(): from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter parser = ArgumentParser(description="PG structs extractor", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('output_dir', type=Path, help="where Cython sources will be created") parser.add_argument('rstdoc', type=Path, help="reST documentation to be created") args = parser.parse_args() workhorse(args) if __name__ == '__main__': main() pglast-7.7/tools/extract_enums.py000066400000000000000000000221331477366773500173060ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Extract enums from PostgreSQL headers # :Created: gio 03 ago 2017 14:54:39 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Lele Gaifax # from datetime import date from os.path import basename, splitext from re import match import subprocess from pycparser import c_ast, c_parser CYEARS = f'2017-{date.today().year}' PY_HEADER = f"""\ # -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from %s @ %s # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © {CYEARS} Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: # pragma: no cover # Python < 3.10 class StrEnum(str, Enum): pass """ RST_HEADER = f"""\ .. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © {CYEARS} Lele Gaifax .. ========================================================%(extra_decoration)s :mod:`pglast.enums.%(mod_name)s` --- Constants extracted from `%(header_fname)s`__ ========================================================%(extra_decoration)s __ %(header_url)s .. module:: pglast.enums.%(mod_name)s :synopsis: Constants extracted from %(header_fname)s """ def get_libpg_query_info(): "Return a tuple with (version, baseurl) of the libpg_query library." version = subprocess.check_output(['git', 'describe', '--all', '--long'], cwd='libpg_query') version = version.decode('utf-8').strip().split('/')[-1] remote = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], cwd='libpg_query') remote = remote.decode('utf-8') baseurl = '%s/blob/%s/' % (remote[:-5], version[-7:]) return version, baseurl def preprocess(fname, cpp_args=[]): "Preprocess the given header and return the result." result = subprocess.check_output(['cpp', '-E', '-include', 'c.h', *cpp_args, fname]) return result.decode('utf-8') def extract_toc(header): "Extract the enums and defines with their position in the header." toc = {} with open(header, encoding='utf-8') as f: content = f.read() in_typedef_enum = 0 for lineno, line in enumerate(content.splitlines(), 1): if line.startswith('typedef enum '): m = match(r'typedef enum\s+([\w_]+)', line) if m is not None: toc[m.group(1)] = lineno elif line.startswith('typedef enum'): in_typedef_enum = lineno elif in_typedef_enum and line.startswith('}'): m = match(r'}\s+([\w_]+)\s*;', line) if m is not None: toc[m.group(1)] = in_typedef_enum in_typedef_enum = 0 elif line.startswith('#define'): m = match(r'#define\s+([a-zA-Z_]+)', line) if m is not None: toc[m.group(1)] = lineno return toc def extract_enums(toc, source): "Yield all enum definitions belonging to the given header." typedefs = [] in_typedef = False typedef = [] for line in source.splitlines(): if line and not line.startswith('#'): if in_typedef: typedef.append(line) if line.startswith('}'): in_typedef = False typedefs.append(typedef) typedef = [] elif line.startswith('typedef enum'): in_typedef = True typedef.append(line) parser = c_parser.CParser() for typedef in typedefs: td = parser.parse(''.join(typedef)) if td.ext[0].name in toc: yield td def extract_defines(source): "Yield all #defined constants in the given header." for line in source.splitlines(): if line and line.startswith('#define'): m = match(r"#define\s+([a-zA-Z_]+)\s+\(?(\d+\s*<<\s*\d+|(0x)?\d+|'[a-zA-Z]')\)?", line) if m is not None: yield m.group(1), m.group(2) def emit_constant(value): return value.value def emit_binary_op(value): assert isinstance(value.left, c_ast.Constant) assert isinstance(value.right, c_ast.Constant) return '%s %s %s' % (emit_constant(value.left), value.op, emit_constant(value.right)) def emit_unary_op(value): return '%s%s' % (value.op, emit_constant(value.expr)) def int_enum_value_factory(index, enumerator): if enumerator.value is None: return '0' if index == 0 else 'auto()' if isinstance(enumerator.value, c_ast.BinaryOp): return emit_binary_op(enumerator.value) elif isinstance(enumerator.value, c_ast.Constant): return emit_constant(enumerator.value) elif isinstance(enumerator.value, c_ast.UnaryOp): return emit_unary_op(enumerator.value) elif enumerator.value.name == 'PG_INT32_MAX': return '0x7FFFFFFF' assert enumerator.value.type == 'int' return enumerator.value.value def char_enum_value_factory(index, enumerator): assert enumerator.value.type == 'char' return enumerator.value.value def determine_enum_type_and_value(enum): type = 'IntEnum' value = int_enum_value_factory for item in enum.values.enumerators: if item.value: if isinstance(item.value, c_ast.Constant) and item.value.type == 'char': type = 'StrEnum' value = char_enum_value_factory break elif isinstance(item.value, c_ast.BinaryOp) and item.value.op == '<<': type = 'IntFlag' break return type, value def write_enum(name, enum, output): enum_type, value_factory = determine_enum_type_and_value(enum) output.write('\n\n') output.write('class %s(%s):\n' % (name, enum_type)) for index, item in enumerate(enum.values.enumerators): output.write(' %s = %s\n' % (item.name, value_factory(index, item))) def write_enum_doc(name, enum, output, toc, url, mod_name): output.write('\n\n.. class:: pglast.enums.%s.%s\n' % (mod_name, name)) if name in toc: output.write('\n Corresponds to the `%s enum <%s#L%d>`__.\n' % (name, url, toc[name])) for item in enum.values.enumerators: output.write('\n .. data:: %s\n' % item.name) def workhorse(args): libpg_query_version, libpg_query_baseurl = get_libpg_query_info() header_url = libpg_query_baseurl + args.header[12:] toc = extract_toc(args.header) preprocessed = preprocess(args.header, ['-I%s' % idir for idir in args.include_directory]) with open(args.output, 'w', encoding='utf-8') as output, \ open(args.rstdoc, 'w', encoding='utf-8') as rstdoc: header_fname = basename(args.header) mod_name = splitext(header_fname)[0] output.write(PY_HEADER % (header_fname, libpg_query_version)) rstdoc.write(RST_HEADER % dict( mod_name=mod_name, header_fname=header_fname, extra_decoration='='*(len(mod_name) + len(header_fname)), header_url=header_url)) for node in sorted(extract_enums(toc, preprocessed), key=lambda x: x.ext[0].name): enum = node.ext[0].type.type write_enum(enum.name or node.ext[0].name, enum, output) write_enum_doc(enum.name or node.ext[0].name, enum, rstdoc, toc, header_url, mod_name) separator_emitted = False with open(args.header, encoding='utf-8') as header: for constant, value in extract_defines(header.read()): if not separator_emitted: output.write('\n\n') output.write('# #define-ed constants\n') rstdoc.write('\n') separator_emitted = True output.write('\n%s = %s\n' % (constant, value)) rstdoc.write('\n.. data:: %s\n' % constant) if constant in toc: rstdoc.write('\n See `here for details <%s#L%d>`__.\n' % (header_url, toc[constant])) def main(): from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter parser = ArgumentParser(description="PG enum extractor", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('-I', '--include-directory', action='append', metavar='DIR', help="add DIR to the list of include directories") parser.add_argument('header', help="source header to be processed") parser.add_argument('output', help="Python source to be created") parser.add_argument('rstdoc', help="reST documentation to be created") args = parser.parse_args() workhorse(args) if __name__ == '__main__': main() pglast-7.7/tools/extract_keywords.py000066400000000000000000000051321477366773500200260ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Extract keywords from PostgreSQL header # :Created: dom 06 ago 2017 23:34:53 CEST # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2021, 2022, 2023, 2024 Lele Gaifax # from datetime import date from collections import defaultdict from os.path import basename from pprint import pformat from re import match CYEARS = f'2017-{date.today().year}' HEADER = f"""\ # -*- coding: utf-8 -*- # :Project: pglast — DO NOT EDIT: automatically extracted from %s @ %s # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © {CYEARS} Lele Gaifax # """ def get_target_pg_version(): "Return the target PG version" with open('libpg_query/Makefile') as mf: for line in mf: if line.startswith('PG_VERSION ='): pg_version = line.split('=')[1].strip() break else: raise RuntimeError('Could not determine target PG version, "PG_VERSION" not found' ' in libpg_query/Makefile!') return pg_version def extract_keywords(source): for line in source.splitlines(): if line.startswith('PG_KEYWORD'): m = match(r'PG_KEYWORD\("([^"]+)",[^,]+,\s*([\w_]+),[^)]+\)', line.strip()) if m: yield m.group(1), m.group(2) def workhorse(args): with open(args.header, encoding='utf-8') as f: source = f.read() bytype = defaultdict(set) for keyword, type in extract_keywords(source): bytype[type].add(keyword) with open(args.output, 'w', encoding='utf-8') as output: output.write(HEADER % (basename(args.header), get_target_pg_version())) for type in sorted(bytype): output.write('\n') output.write(type + 'S') output.write(' = {') keywords = pformat(bytype[type], compact=True, indent=len(type)+5, width=95) output.write(keywords[1:].lstrip()) output.write('\n') def main(): from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter parser = ArgumentParser(description="PG keyword extractor", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('header', help="source header to be processed") parser.add_argument('output', help="Python source to be created") args = parser.parse_args() workhorse(args) if __name__ == '__main__': main() pglast-7.7/tools/extract_printers_doc.py000066400000000000000000000133631477366773500206570ustar00rootroot00000000000000# -*- coding: utf-8 -*- # :Project: pglast — Extract printer functions doc # :Created: gio 09 nov 2017 12:56:35 CET # :Author: Lele Gaifax # :License: GNU General Public License version 3 or later # :Copyright: © 2017, 2018, 2019, 2020, 2022, 2023, 2024 Lele Gaifax # from datetime import date from os.path import basename, splitext from re import match import subprocess CYEARS = f'2017-{date.today().year}' RST_HEADER = f"""\ .. -*- coding: utf-8 -*- .. :Project: pglast — DO NOT EDIT: generated automatically .. :Author: Lele Gaifax .. :License: GNU General Public License version 3 or later .. :Copyright: © {CYEARS} Lele Gaifax .. ================================================%(extra_decoration)s :mod:`pglast.printers.%(mod_name)s` --- %(mod_nick_name)s printer functions ================================================%(extra_decoration)s .. module:: pglast.printers.%(mod_name)s :synopsis: %(mod_nick_name)s printer functions """ def get_libpg_query_info(): "Return a tuple with (version, baseurl) of the libpg_query library." version = subprocess.check_output(['git', 'describe', '--all', '--long'], cwd='libpg_query') version = version.decode('utf-8').strip().split('/')[-1] remote = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], cwd='libpg_query') remote = remote.decode('utf-8') baseurl = '%s/blob/%s/' % (remote[:-5], version[-7:]) return version, baseurl def extract_toc(headers): "Extract the nodes position in the headers." toc = {} for header in headers: with open(header, encoding='utf-8') as f: content = f.read() for lineno, line in enumerate(content.splitlines(), 1): if line.startswith('typedef struct '): m = match(r'typedef struct\s+([\w_]+)', line) if m is not None: toc[m.group(1)] = (header, lineno) elif line.startswith('struct PartitionBoundSpec'): # For some reason, this is an exception: unlike all other nodes # in nodes/parsenodes.h, this is not typedef'd right away, but # rather in partitioning/partdefs.h toc['PartitionBoundSpec'] = (header, lineno) return toc def extract_printers(source): "Extract printer functions implemented in `source`." printers = [] with open(source, encoding='utf-8') as f: content = f.read() nps = [] lines = iter(content.splitlines()) for line in lines: if line.startswith('@node_printer('): while not line.endswith(')'): line += next(lines) m = match(r'@node_printer\((.*,\s)?([\w._]+)\)', line) assert m is not None, f"Could not parse @node_printer(): {line}" scope = m.group(1) if scope: scope = scope.lstrip('(').rstrip('), ').split(',') scope = tuple(s.strip() for s in scope) node = m.group(2) nps.append((scope, node)) elif line.startswith('def '): if nps: funcname = line[4:].split('(', 1)[0] for scope, node in nps: printers.append((scope, node, funcname)) nps = [] return printers def workhorse(args): libpg_query_version, libpg_query_baseurl = get_libpg_query_info() toc = extract_toc(args.headers) printers = extract_printers(args.source) with open(args.rstdoc, 'w', encoding='utf-8') as rstdoc: source_fname = basename(args.source) mod_name = splitext(source_fname)[0] rstdoc.write(RST_HEADER % dict( mod_name=mod_name, mod_nick_name=mod_name.upper(), extra_decoration='='*(len(mod_name) * 2))) for scope, node, funcname in printers: if scope: scoped = ", when it is inside " snode = scope[0][4:] header, lineno = toc[snode] header_url = libpg_query_baseurl + header[12:] scoped += "a `%s <%s#L%d>`__" % (snode, header_url, lineno) for snode in scope[1:]: snode = snode[4:] header, lineno = toc[snode] header_url = libpg_query_baseurl + header[12:] scoped += " or a `%s <%s#L%d>`__" % (snode, header_url, lineno) scoped += ',' else: scoped = '' node = node[4:] header, lineno = toc[node] header_url = libpg_query_baseurl + header[12:] if scope: for snode in scope: snode = snode[4:] rstdoc.write('\n.. index::\n pair: %s;%s\n' % (snode, node)) else: rstdoc.write('\n.. index:: %s\n' % node) rstdoc.write('\n.. function:: %s(node, output)\n' % funcname) rstdoc.write('\n Pretty print a `node` of type `%s <%s#L%d>`__%s to the `output`' ' stream.\n' % (node, header_url, lineno, scoped)) def main(): from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter parser = ArgumentParser(description="Printer functions doc extractor", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('source', help="Python source module to be documented") parser.add_argument('rstdoc', help="reST documentation to be created") parser.add_argument('headers', nargs='+', help="The PG headers containing nodes definitions") args = parser.parse_args() workhorse(args) if __name__ == '__main__': main()