Skip to content

fix elif preprocessing, I believe - #1197

Merged
perazz merged 3 commits into
fortran-lang:mainfrom
JorgeG94:fix/elif_preproc
Nov 5, 2025
Merged

fix elif preprocessing, I believe#1197
perazz merged 3 commits into
fortran-lang:mainfrom
JorgeG94:fix/elif_preproc

Conversation

@JorgeG94

Copy link
Copy Markdown
Contributor

This fixes issue #1195

@perazz perazz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR @JorgeG94. I believe it would be worthwhile to add a test routine for #elif cases in https://github.com/fortran-lang/fpm/blob/main/test/fpm_test/test_source_parsing.f90

@JorgeG94

Copy link
Copy Markdown
Contributor Author

Thank you for this PR @JorgeG94. I believe it would be worthwhile to add a test routine for #elif cases in https://github.com/fortran-lang/fpm/blob/main/test/fpm_test/test_source_parsing.f90

of course, I was enthralled that I fixed it that I just opened the PR. Let me tend to this

@perazz

perazz commented Oct 30, 2025

Copy link
Copy Markdown
Member

Unfortunately, fpm does not contain a full C preprocessor or even a source parser. A good approach for now is to add capability at user need

@JorgeG94

Copy link
Copy Markdown
Contributor Author

Unfortunately, fpm does not contain a full C preprocessor or even a source parser. A good approach for now is to add capability at user need

Excellent, I am writing the test now I shall push it in a second :)

@JorgeG94

Copy link
Copy Markdown
Contributor Author

@perazz I've extended the current test. Is this preferred or should I create two new unit tests, one for ifdef + elif and one for ifdef + elif + else ?

@JorgeG94

Copy link
Copy Markdown
Contributor Author

I thought about and one test per case is a better practice

@JorgeG94

JorgeG94 commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

The CI seems to have died because of an internal failure - can we trigger a rerun of the tests?

@perazz
perazz merged commit 04a13b6 into fortran-lang:main Nov 5, 2025
40 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants