Identification of CPP directives in UMDP3_checker
@r-sharp is already working on this.
Since Jul 31, 2026.
Assessment
This issue has not been assessed yet.
Description
The current C pre-processor pattern assumes that there are no spaces between the start of a line and the # symbol:
comment_line = re.compile(r"!.*$")
cpp_command_line = re.compile(r"^#.*$")
word_splitter = re.compile(r"\b\w+\b")
However, the GNU C pre-processor manual explicitly says that spaces before the hash symbol are allowed:
Preprocessing directives are lines in your program that start with ‘#’. Whitespace is allowed before and after the ‘#’. The ‘#’ is followed by an identifier, the directive name. It specifies the operation to perform.
The pattern should probably allow leading whitespace. This doesn't seem to cause problems for the UM, but it may result in unexpected failures in other code bases.
- Dominant language
- Python
- Stars
- 9
- Forks
- 19
- Avg merge
- 5d 48m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetOffice/SimSys_Scripts
-
MetOffice/SimSys_Scripts#235 · 9 comments · 1 assignee ·
-
MetOffice/SimSys_Scripts#221 · 1 assignee ·
-
bug
MetOffice/SimSys_Scripts#220 · 1 assignee ·
-
enhancement
MetOffice/SimSys_Scripts#217 · 4 comments · 1 assignee ·
-
bug
MetOffice/SimSys_Scripts#208 · 1 comment · 1 assignee ·
All issues in MetOffice/SimSys_Scripts
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100