@pairling/runtime-darwin-x64 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/pairling-connectd +0 -0
- package/manifest.json +4 -4
- package/package.json +3 -3
- package/python/bin/python3 +0 -0
- package/python/bin/python3.12 +0 -0
- package/python/lib/libpython3.12.dylib +0 -0
- package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
- package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
- package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
- package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
- package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
- package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
- package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
- package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
- package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
- package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
- package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
- package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
- package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
- package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
- package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
- package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
- package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
- package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
- package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
- package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +216 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1084 -0
- package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
- package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/RECORD +30 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/WHEEL +5 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
- package/python/lib/python3.12/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
- package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
- package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
- package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
- package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
- package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
- package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
- package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
- package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
- package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
- package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
- package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
- package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
- package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
- package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
- package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
- package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
- package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
- package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# pycparser: ast_transforms.py
|
|
3
|
+
#
|
|
4
|
+
# Some utilities used by the parser to create a friendlier AST.
|
|
5
|
+
#
|
|
6
|
+
# Eli Bendersky [https://eli.thegreenplace.net/]
|
|
7
|
+
# License: BSD
|
|
8
|
+
# ------------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
from typing import Any, List, Tuple, cast
|
|
11
|
+
|
|
12
|
+
from . import c_ast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def fix_switch_cases(switch_node: c_ast.Switch) -> c_ast.Switch:
|
|
16
|
+
"""The 'case' statements in a 'switch' come out of parsing with one
|
|
17
|
+
child node, so subsequent statements are just tucked to the parent
|
|
18
|
+
Compound. Additionally, consecutive (fall-through) case statements
|
|
19
|
+
come out messy. This is a peculiarity of the C grammar. The following:
|
|
20
|
+
|
|
21
|
+
switch (myvar) {
|
|
22
|
+
case 10:
|
|
23
|
+
k = 10;
|
|
24
|
+
p = k + 1;
|
|
25
|
+
return 10;
|
|
26
|
+
case 20:
|
|
27
|
+
case 30:
|
|
28
|
+
return 20;
|
|
29
|
+
default:
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Creates this tree (pseudo-dump):
|
|
34
|
+
|
|
35
|
+
Switch
|
|
36
|
+
ID: myvar
|
|
37
|
+
Compound:
|
|
38
|
+
Case 10:
|
|
39
|
+
k = 10
|
|
40
|
+
p = k + 1
|
|
41
|
+
return 10
|
|
42
|
+
Case 20:
|
|
43
|
+
Case 30:
|
|
44
|
+
return 20
|
|
45
|
+
Default:
|
|
46
|
+
break
|
|
47
|
+
|
|
48
|
+
The goal of this transform is to fix this mess, turning it into the
|
|
49
|
+
following:
|
|
50
|
+
|
|
51
|
+
Switch
|
|
52
|
+
ID: myvar
|
|
53
|
+
Compound:
|
|
54
|
+
Case 10:
|
|
55
|
+
k = 10
|
|
56
|
+
p = k + 1
|
|
57
|
+
return 10
|
|
58
|
+
Case 20:
|
|
59
|
+
Case 30:
|
|
60
|
+
return 20
|
|
61
|
+
Default:
|
|
62
|
+
break
|
|
63
|
+
|
|
64
|
+
A fixed AST node is returned. The argument may be modified.
|
|
65
|
+
"""
|
|
66
|
+
assert isinstance(switch_node, c_ast.Switch)
|
|
67
|
+
if not isinstance(switch_node.stmt, c_ast.Compound):
|
|
68
|
+
return switch_node
|
|
69
|
+
|
|
70
|
+
# The new Compound child for the Switch, which will collect children in the
|
|
71
|
+
# correct order
|
|
72
|
+
new_compound = c_ast.Compound([], switch_node.stmt.coord)
|
|
73
|
+
|
|
74
|
+
# The last Case/Default node
|
|
75
|
+
last_case: c_ast.Case | c_ast.Default | None = None
|
|
76
|
+
|
|
77
|
+
# Goes over the children of the Compound below the Switch, adding them
|
|
78
|
+
# either directly below new_compound or below the last Case as appropriate
|
|
79
|
+
# (for `switch(cond) {}`, block_items would have been None)
|
|
80
|
+
for child in switch_node.stmt.block_items or []:
|
|
81
|
+
if isinstance(child, (c_ast.Case, c_ast.Default)):
|
|
82
|
+
# If it's a Case/Default:
|
|
83
|
+
# 1. Add it to the Compound and mark as "last case"
|
|
84
|
+
# 2. If its immediate child is also a Case or Default, promote it
|
|
85
|
+
# to a sibling.
|
|
86
|
+
new_compound.block_items.append(child)
|
|
87
|
+
_extract_nested_case(child, new_compound.block_items)
|
|
88
|
+
last_case = new_compound.block_items[-1]
|
|
89
|
+
else:
|
|
90
|
+
# Other statements are added as children to the last case, if it
|
|
91
|
+
# exists.
|
|
92
|
+
if last_case is None:
|
|
93
|
+
new_compound.block_items.append(child)
|
|
94
|
+
else:
|
|
95
|
+
last_case.stmts.append(child)
|
|
96
|
+
|
|
97
|
+
switch_node.stmt = new_compound
|
|
98
|
+
return switch_node
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _extract_nested_case(
|
|
102
|
+
case_node: c_ast.Case | c_ast.Default, stmts_list: List[c_ast.Node]
|
|
103
|
+
) -> None:
|
|
104
|
+
"""Recursively extract consecutive Case statements that are made nested
|
|
105
|
+
by the parser and add them to the stmts_list.
|
|
106
|
+
"""
|
|
107
|
+
if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)):
|
|
108
|
+
nested = case_node.stmts.pop()
|
|
109
|
+
stmts_list.append(nested)
|
|
110
|
+
_extract_nested_case(cast(Any, nested), stmts_list)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def fix_atomic_specifiers(
|
|
114
|
+
decl: c_ast.Decl | c_ast.Typedef,
|
|
115
|
+
) -> c_ast.Decl | c_ast.Typedef:
|
|
116
|
+
"""Atomic specifiers like _Atomic(type) are unusually structured,
|
|
117
|
+
conferring a qualifier upon the contained type.
|
|
118
|
+
|
|
119
|
+
This function fixes a decl with atomic specifiers to have a sane AST
|
|
120
|
+
structure, by removing spurious Typename->TypeDecl pairs and attaching
|
|
121
|
+
the _Atomic qualifier in the right place.
|
|
122
|
+
"""
|
|
123
|
+
# There can be multiple levels of _Atomic in a decl; fix them until a
|
|
124
|
+
# fixed point is reached.
|
|
125
|
+
while True:
|
|
126
|
+
decl, found = _fix_atomic_specifiers_once(decl)
|
|
127
|
+
if not found:
|
|
128
|
+
break
|
|
129
|
+
|
|
130
|
+
# Make sure to add an _Atomic qual on the topmost decl if needed. Also
|
|
131
|
+
# restore the declname on the innermost TypeDecl (it gets placed in the
|
|
132
|
+
# wrong place during construction).
|
|
133
|
+
typ: Any = decl
|
|
134
|
+
while not isinstance(typ, c_ast.TypeDecl):
|
|
135
|
+
try:
|
|
136
|
+
typ = typ.type
|
|
137
|
+
except AttributeError:
|
|
138
|
+
return decl
|
|
139
|
+
if "_Atomic" in typ.quals and "_Atomic" not in decl.quals:
|
|
140
|
+
decl.quals.append("_Atomic")
|
|
141
|
+
if typ.declname is None:
|
|
142
|
+
typ.declname = decl.name
|
|
143
|
+
|
|
144
|
+
return decl
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def _fix_atomic_specifiers_once(
|
|
148
|
+
decl: c_ast.Decl | c_ast.Typedef,
|
|
149
|
+
) -> Tuple[c_ast.Decl | c_ast.Typedef, bool]:
|
|
150
|
+
"""Performs one 'fix' round of atomic specifiers.
|
|
151
|
+
Returns (modified_decl, found) where found is True iff a fix was made.
|
|
152
|
+
"""
|
|
153
|
+
parent: Any = decl
|
|
154
|
+
grandparent: Any = None
|
|
155
|
+
node: Any = decl.type
|
|
156
|
+
while node is not None:
|
|
157
|
+
if isinstance(node, c_ast.Typename) and "_Atomic" in node.quals:
|
|
158
|
+
break
|
|
159
|
+
try:
|
|
160
|
+
grandparent = parent
|
|
161
|
+
parent = node
|
|
162
|
+
node = node.type
|
|
163
|
+
except AttributeError:
|
|
164
|
+
# If we've reached a node without a `type` field, it means we won't
|
|
165
|
+
# find what we're looking for at this point; give up the search
|
|
166
|
+
# and return the original decl unmodified.
|
|
167
|
+
return decl, False
|
|
168
|
+
|
|
169
|
+
assert isinstance(parent, c_ast.TypeDecl)
|
|
170
|
+
assert grandparent is not None
|
|
171
|
+
cast(Any, grandparent).type = node.type
|
|
172
|
+
if "_Atomic" not in node.type.quals:
|
|
173
|
+
node.type.quals.append("_Atomic")
|
|
174
|
+
return decl, True
|