@@ -2523,7 +2523,6 @@ def __init__(self, headerFileName, argType="file", encoding=None, **kwargs):
2523
2523
self .curAccessSpecifier = "private" # private is default
2524
2524
self .curTemplate = None
2525
2525
self .accessSpecifierStack = []
2526
- self .accessSpecifierScratch = []
2527
2526
debug_print (
2528
2527
"curAccessSpecifier changed/defaulted to %s" , self .curAccessSpecifier
2529
2528
)
@@ -2747,7 +2746,7 @@ def __init__(self, headerFileName, argType="file", encoding=None, **kwargs):
2747
2746
self .curClass = ""
2748
2747
self .stack = []
2749
2748
2750
- if tok .type in _namestack_append_tokens :
2749
+ elif tok .type in _namestack_append_tokens :
2751
2750
self .nameStack .append (tok .value )
2752
2751
elif tok .type in _namestack_pass_tokens :
2753
2752
pass
@@ -2756,47 +2755,24 @@ def __init__(self, headerFileName, argType="file", encoding=None, **kwargs):
2756
2755
debug_print ("Ignore symbol %s" , tok .value )
2757
2756
elif tok .value == "class" :
2758
2757
self .nameStack .append (tok .value )
2759
- elif tok .value in supportedAccessSpecifier :
2760
- if len (self .nameStack ) and self .nameStack [0 ] in (
2761
- "class" ,
2762
- "struct" ,
2763
- "union" ,
2764
- ):
2765
- self .nameStack .append (tok .value )
2766
- elif self .braceDepth == len (
2767
- self .nameSpaces
2768
- ) + 1 or self .braceDepth == (
2769
- len (self .nameSpaces ) + len (self .curClass .split ("::" ))
2770
- ):
2771
- self .curAccessSpecifier = tok .value
2772
- self .accessSpecifierScratch .append (tok .value )
2773
- debug_print (
2774
- "curAccessSpecifier updated to %s" ,
2775
- self .curAccessSpecifier ,
2776
- )
2777
- self .stack = []
2778
2758
else :
2779
2759
self .nameStack .append (tok .value )
2780
2760
if self .anon_union_counter [0 ] == self .braceDepth :
2781
2761
self .anon_union_counter = [- 1 , 0 ]
2782
2762
elif tok .type == ":" :
2783
- # Dont want colon to be first in stack
2784
- if len (self .nameStack ) == 0 :
2785
- self .accessSpecifierScratch = []
2786
- continue
2787
-
2788
- # Handle situation where access specifiers can be multi words such as "public slots"
2789
- jns = " " .join (self .accessSpecifierScratch + self .nameStack )
2790
- if jns in supportedAccessSpecifier :
2791
- self .curAccessSpecifier = jns
2763
+ if self .nameStack and self .nameStack [0 ] in supportedAccessSpecifier :
2764
+ specifier = " " .join (self .nameStack )
2765
+ if specifier in supportedAccessSpecifier :
2766
+ self .curAccessSpecifier = specifier
2767
+ else :
2768
+ self .curAccessSpecifier = self .nameStack [0 ]
2792
2769
debug_print (
2793
- "curAccessSpecifier updated to %s" % self .curAccessSpecifier
2770
+ "curAccessSpecifier updated to %s" , self .curAccessSpecifier
2794
2771
)
2795
- self .stack = []
2796
2772
self .nameStack = []
2773
+ self .stack = []
2797
2774
else :
2798
2775
self .nameStack .append (tok .value )
2799
- self .accessSpecifierScratch = []
2800
2776
2801
2777
elif tok .type == ";" :
2802
2778
if (
@@ -2858,7 +2834,6 @@ def __init__(self, headerFileName, argType="file", encoding=None, **kwargs):
2858
2834
"nameSpaces" ,
2859
2835
"curAccessSpecifier" ,
2860
2836
"accessSpecifierStack" ,
2861
- "accessSpecifierScratch" ,
2862
2837
"nameStackHistory" ,
2863
2838
"anon_struct_counter" ,
2864
2839
"anon_union_counter" ,
0 commit comments