feature request: #ifdef preprocessing in scc1
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
The way the d directory is currently built, some .d sources depends on flags (e.g. XML, Python, or MySQL). However, if scc1 supported #ifdefs in D syntax, then we could put the list in a file and build everything in it, knowing that the compiler would skip the content if a flag is not set.
> The way to do that is this: make a shell script called `c/scc`. It would run `cpp` on the file first and then run `c/scc1`. The code of `scc1` would be modified to pay attention to the lines left behind `cpp` : a line such as `# 11 "foo.d" 2` would tell it that the next line (check that) is line 11 from the file "foo.d". We need that information for giving proper line numbers in error messages, and we don't want to be off even by 1.
_Originally posted by @DanGrayson in https://github.com/Macaulay2/M2/pull/1190_
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with the existing c/scc1 entry point and the proposed c/scc shell wrapper, then inspect how cpp emits lines such as # 11 "foo.d" 2. Done means preprocessing can skip conditionally disabled D content while scc1 preserves the original file names and line numbers in error messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, shell
- Domain
- build-system, compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100