File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ Modifications by (in alphabetical order):
2222* P. Vitt, University of Siegen, Germany
2323* A. Voysey, UK Met Office
2424
25+
26+ 27/04/2026 PR #504 for #503 . Improve preprocessor directives parsing.
27+
28+ ## Release 0.2.2 (19/03/2026) ##
29+
253019/03/2026 PR #496 . Add support for F2008 unlimited-format-item.
2631
273213/03/2026 PR #495 for #494 . Fix CI issues with the black formatting check.
Original file line number Diff line number Diff line change @@ -712,15 +712,14 @@ def match(
712712 if reader .process_directives :
713713 comments .insert (0 , di .Directive )
714714 classes = subclasses + comments
715- # Preprocessor directives are always valid sub-classes
716- cpp_classes = [
717- getattr (di .C99Preprocessor , cls_name )
718- for cls_name in di .C99Preprocessor .CPP_CLASS_NAMES
719- ]
720- classes += cpp_classes
721715 if endcls is not None :
722716 classes += [endcls ]
723717 endcls_all = tuple ([endcls ] + endcls .subclasses [endcls .__name__ ])
718+ # Preprocessor directives are always valid sub-classes. While
719+ # `match_cpp_directive` is a function, it behaves correctly here
720+ # returning either None or an instance, so we can just add it to
721+ # the classes that will be tested.
722+ classes .append (di .C99Preprocessor .match_cpp_directive )
724723
725724 try :
726725 # Start trying to match the various subclasses, starting from
You can’t perform that action at this time.
0 commit comments