cxxheaderparser 1.7.2__tar.gz → 1.7.4__tar.gz
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.
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/PKG-INFO +1 -1
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/lexer.py +1 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/parser.py +44 -23
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/version.py +2 -2
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/.gitignore +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/LICENSE.txt +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/README.md +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/__init__.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/__main__.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/_ply/__init__.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/_ply/lex.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/dump.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/errors.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/gentest.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/options.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/parserstate.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/preprocessor.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/py.typed +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/simple.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/tokfmt.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/types.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/cxxheaderparser/visitor.py +0 -0
- {cxxheaderparser-1.7.2 → cxxheaderparser-1.7.4}/pyproject.toml +0 -0
|
@@ -1606,7 +1606,7 @@ class CxxParser:
|
|
|
1606
1606
|
|
|
1607
1607
|
else:
|
|
1608
1608
|
# default value initializer
|
|
1609
|
-
tok = self.lex.token_if("{")
|
|
1609
|
+
tok = self.lex.token_if("{", "(")
|
|
1610
1610
|
if tok:
|
|
1611
1611
|
if is_typedef:
|
|
1612
1612
|
raise self._parse_error(tok)
|
|
@@ -2432,7 +2432,7 @@ class CxxParser:
|
|
|
2432
2432
|
|
|
2433
2433
|
while True:
|
|
2434
2434
|
tok = self.lex.token_if(
|
|
2435
|
-
"*", "const", "volatile", "__restrict__", "restrict", "("
|
|
2435
|
+
"*", "const", "volatile", "__restrict__", "__restrict", "restrict", "("
|
|
2436
2436
|
)
|
|
2437
2437
|
if not tok:
|
|
2438
2438
|
break
|
|
@@ -2449,7 +2449,7 @@ class CxxParser:
|
|
|
2449
2449
|
if not isinstance(dtype, (Pointer, Type)):
|
|
2450
2450
|
raise self._parse_error(tok)
|
|
2451
2451
|
dtype.volatile = True
|
|
2452
|
-
elif tok.type in ("__restrict__", "restrict"):
|
|
2452
|
+
elif tok.type in ("__restrict__", "__restrict", "restrict"):
|
|
2453
2453
|
if not isinstance(dtype, (Pointer, Reference)):
|
|
2454
2454
|
raise self._parse_error(tok)
|
|
2455
2455
|
dtype.restrict = True
|
|
@@ -2524,7 +2524,7 @@ class CxxParser:
|
|
|
2524
2524
|
|
|
2525
2525
|
# peek at the next token and see if it's a paren. If so, it might
|
|
2526
2526
|
# be a nasty function pointer
|
|
2527
|
-
if self.lex.token_peek_if("(", "__restrict__", "restrict"):
|
|
2527
|
+
if self.lex.token_peek_if("(", "__restrict__", "__restrict", "restrict"):
|
|
2528
2528
|
dtype = self._parse_cv_ptr_or_fn(dtype, nonptr_fn)
|
|
2529
2529
|
|
|
2530
2530
|
return dtype
|
|
@@ -2537,6 +2537,22 @@ class CxxParser:
|
|
|
2537
2537
|
|
|
2538
2538
|
_parse_type_ptr_ref_paren = {"*", "&", "DBL_AMP", "("}
|
|
2539
2539
|
|
|
2540
|
+
_parameter_start_tokens = (
|
|
2541
|
+
_pqname_start_tokens
|
|
2542
|
+
| _attribute_start_tokens
|
|
2543
|
+
| _type_kwd_both
|
|
2544
|
+
| _type_kwd_meth
|
|
2545
|
+
| {
|
|
2546
|
+
"volatile",
|
|
2547
|
+
"mutable",
|
|
2548
|
+
"__inline",
|
|
2549
|
+
"__forceinline",
|
|
2550
|
+
"this",
|
|
2551
|
+
"ELLIPSIS",
|
|
2552
|
+
")",
|
|
2553
|
+
}
|
|
2554
|
+
)
|
|
2555
|
+
|
|
2540
2556
|
def _parse_type(
|
|
2541
2557
|
self,
|
|
2542
2558
|
tok: typing.Optional[LexToken],
|
|
@@ -2735,29 +2751,34 @@ class CxxParser:
|
|
|
2735
2751
|
|
|
2736
2752
|
# TODO: "type fn(x);" is ambiguous here. Because this is a header
|
|
2737
2753
|
# parser, we assume it's a function, not a variable declaration
|
|
2738
|
-
# calling a constructor
|
|
2754
|
+
# calling a constructor, unless the token after ( cannot start a
|
|
2755
|
+
# parameter declaration.
|
|
2739
2756
|
|
|
2740
|
-
# if ( then it's a function/method
|
|
2741
|
-
|
|
2757
|
+
# if ( then it's usually a function/method
|
|
2758
|
+
tok = self.lex.token_if("(")
|
|
2759
|
+
if tok:
|
|
2742
2760
|
if not pqname:
|
|
2743
2761
|
raise self._parse_error(None)
|
|
2744
2762
|
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2763
|
+
if not self.lex.token_peek_if(*self._parameter_start_tokens):
|
|
2764
|
+
self.lex.return_token(tok)
|
|
2765
|
+
else:
|
|
2766
|
+
return self._parse_function(
|
|
2767
|
+
mods,
|
|
2768
|
+
dtype,
|
|
2769
|
+
pqname,
|
|
2770
|
+
op,
|
|
2771
|
+
template,
|
|
2772
|
+
doxygen,
|
|
2773
|
+
location,
|
|
2774
|
+
constructor,
|
|
2775
|
+
destructor,
|
|
2776
|
+
is_friend,
|
|
2777
|
+
is_typedef,
|
|
2778
|
+
msvc_convention,
|
|
2779
|
+
is_guide,
|
|
2780
|
+
attributes,
|
|
2781
|
+
)
|
|
2761
2782
|
elif msvc_convention:
|
|
2762
2783
|
raise self._parse_error(msvc_convention)
|
|
2763
2784
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.7.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 7,
|
|
21
|
+
__version__ = version = '1.7.4'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 7, 4)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|