Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
330 stars 228 forks source link

feature request: #ifdef preprocessing in scc1 #1197

Open mahrud opened 4 years ago

mahrud commented 4 years ago

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

DanGrayson commented 4 years ago

Here's the thread: https://github.com/Macaulay2/M2/pull/1190#pullrequestreview-417286834