dissect.cstruct 4.6.dev5__py3-none-any.whl → 4.6.dev6__py3-none-any.whl

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.
dissect/cstruct/parser.py CHANGED
@@ -314,11 +314,11 @@ class TokenParser(Parser):
314
314
  tokens.eol()
315
315
  break
316
316
 
317
- if tokens.next not in (self.TOK.NAME, self.TOK.DEFS):
317
+ if tokens.next not in (self.TOK.NAME, self.TOK.DEFS, self.TOK.IDENTIFIER):
318
318
  break
319
319
 
320
320
  ntoken = tokens.consume()
321
- if ntoken == self.TOK.NAME:
321
+ if ntoken in (self.TOK.NAME, self.TOK.IDENTIFIER):
322
322
  names.append(ntoken.value.strip())
323
323
  elif ntoken == self.TOK.DEFS:
324
324
  names.extend([name.strip() for name in ntoken.value.strip().split(",")])
@@ -92,6 +92,9 @@ def generate_cstruct_stub(cs: cstruct, module_prefix: str = "", cls_name: str =
92
92
  stub = f"{name}: TypeAlias = {typedef.__name__}"
93
93
  elif issubclass(typedef, (types.Enum, types.Flag)):
94
94
  stub = generate_enum_stub(typedef, cs_prefix=cs_prefix, module_prefix=module_prefix)
95
+ elif issubclass(typedef, types.Pointer):
96
+ typehint = generate_typehint(typedef, prefix=cs_prefix, module_prefix=module_prefix)
97
+ stub = f"{name}: TypeAlias = {typehint}"
95
98
  elif issubclass(typedef, types.Structure):
96
99
  stub = generate_structure_stub(typedef, cs_prefix=cs_prefix, module_prefix=module_prefix)
97
100
  elif issubclass(typedef, types.BaseType):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.cstruct
3
- Version: 4.6.dev5
3
+ Version: 4.6.dev6
4
4
  Summary: A Dissect module implementing a parser for C-like structures: structure parsing in Python made easy
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Apache License 2.0
@@ -4,10 +4,10 @@ dissect/cstruct/compiler.py,sha256=WqkO23EE_iOpVuV7FqCFPX0Q0Mcfk0oyPacV-aCGKpk,1
4
4
  dissect/cstruct/cstruct.py,sha256=p765dkRS-i1idodHalZYEPuyrPV0JZjkP22_SvMzJjs,19440
5
5
  dissect/cstruct/exceptions.py,sha256=WqsUW4OiIpRLQLvixfLrfKl0rtvU1qx7pvfBrz9Sz-I,293
6
6
  dissect/cstruct/expression.py,sha256=KUoKxEG-KrlovIGbt_Uskjpcgafow8_sfPaBZXJo4y8,10810
7
- dissect/cstruct/parser.py,sha256=QcNrgZU5QhmLu936kZSAYwP2w1SfQYTIRy3NAc2cXf8,21315
7
+ dissect/cstruct/parser.py,sha256=-CXazhbbx6GM_FSKM7CI7XFioqUo0kD1lofvm2IZokY,21359
8
8
  dissect/cstruct/utils.py,sha256=6cU1QHTZnHXQaPoxMH93ELkwIIUgYw-TtxieEcVvYvw,10537
9
9
  dissect/cstruct/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- dissect/cstruct/tools/stubgen.py,sha256=x-jlIet9mzONfl4sbaz6fTgEJ-FXg50HqdLhFKCEJAo,7661
10
+ dissect/cstruct/tools/stubgen.py,sha256=iJhwv9a5sMAiASXWVzSbK_SIieJlpF_if5ZRbBVOHG0,7860
11
11
  dissect/cstruct/types/__init__.py,sha256=B-qMAi6v8PZHdPnpODVQAoldJqUIbh9O_UBwh7mL8qY,875
12
12
  dissect/cstruct/types/base.py,sha256=VP2Nb7v0dfiMxwcghIXJSl9F_gutNz-oinv-wsIgWxI,9780
13
13
  dissect/cstruct/types/char.py,sha256=9XYCjCF0D_5o3EYnmIcjev-5GI2NzxOhd1ct1xF6SAM,2457
@@ -20,10 +20,10 @@ dissect/cstruct/types/pointer.py,sha256=PqeJOoNBUfMd5uO2kpF6OHeW7Q6R1N1W1V4q1Mak
20
20
  dissect/cstruct/types/structure.py,sha256=uhLWzvNNmScdalQvktpvzWpiiMtGDnHhNYd75PkjXxI,33015
21
21
  dissect/cstruct/types/void.py,sha256=Gvh0HqI6jQSj2uesdo3J8-G41brWCz8pmP16l8xTBxE,1074
22
22
  dissect/cstruct/types/wchar.py,sha256=N9Y_XX2_hZEe2DwepJjxsB6xuRJ6zINRalcUofR59kY,2608
23
- dissect_cstruct-4.6.dev5.dist-info/licenses/COPYRIGHT,sha256=H-18RXfshdH9AdHwW2eO1Xa-5s6tY5eipHh5c0whDu4,316
24
- dissect_cstruct-4.6.dev5.dist-info/licenses/LICENSE,sha256=PhUqiw6jAh2KbBdVRPBq_hfAvfcTBin7nZ3CK7NQbTM,11341
25
- dissect_cstruct-4.6.dev5.dist-info/METADATA,sha256=DPYwYg0sjR8qULq651VNkiuAX2_Q_8NQGbZ2zI9yOS0,8738
26
- dissect_cstruct-4.6.dev5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- dissect_cstruct-4.6.dev5.dist-info/entry_points.txt,sha256=z53zqZqwD2OLrAkRwrP4wTeiU9CQe7xrMly0T2c0_wQ,71
28
- dissect_cstruct-4.6.dev5.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
29
- dissect_cstruct-4.6.dev5.dist-info/RECORD,,
23
+ dissect_cstruct-4.6.dev6.dist-info/licenses/COPYRIGHT,sha256=H-18RXfshdH9AdHwW2eO1Xa-5s6tY5eipHh5c0whDu4,316
24
+ dissect_cstruct-4.6.dev6.dist-info/licenses/LICENSE,sha256=PhUqiw6jAh2KbBdVRPBq_hfAvfcTBin7nZ3CK7NQbTM,11341
25
+ dissect_cstruct-4.6.dev6.dist-info/METADATA,sha256=B64oBFYD2DPG79b6UHg_SJT8JMNGB0AcQx-Zi0_NAi4,8738
26
+ dissect_cstruct-4.6.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ dissect_cstruct-4.6.dev6.dist-info/entry_points.txt,sha256=z53zqZqwD2OLrAkRwrP4wTeiU9CQe7xrMly0T2c0_wQ,71
28
+ dissect_cstruct-4.6.dev6.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
29
+ dissect_cstruct-4.6.dev6.dist-info/RECORD,,