Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ Modifications by (in alphabetical order):
* P. Vitt, University of Siegen, Germany
* A. Voysey, UK Met Office


27/04/2026 PR #504 for #503. Improve preprocessor directives parsing.

## Release 0.2.2 (19/03/2026) ##

19/03/2026 PR #496. Add support for F2008 unlimited-format-item.

13/03/2026 PR #495 for #494. Fix CI issues with the black formatting check.
Expand Down
11 changes: 5 additions & 6 deletions src/fparser/two/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,15 +712,14 @@ def match(
if reader.process_directives:
comments.insert(0, di.Directive)
classes = subclasses + comments
# Preprocessor directives are always valid sub-classes
cpp_classes = [
getattr(di.C99Preprocessor, cls_name)
for cls_name in di.C99Preprocessor.CPP_CLASS_NAMES
]
classes += cpp_classes
if endcls is not None:
classes += [endcls]
endcls_all = tuple([endcls] + endcls.subclasses[endcls.__name__])
# Preprocessor directives are always valid sub-classes. While
# `match_cpp_directive` is a function, it behaves correctly here
# returning either None or an instance, so we can just add it to
# the classes that will be tested.
classes.append(di.C99Preprocessor.match_cpp_directive)

try:
# Start trying to match the various subclasses, starting from
Expand Down
Loading