diff options
Diffstat (limited to 'include/cps/Preprocessor.h')
| -rw-r--r-- | include/cps/Preprocessor.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/cps/Preprocessor.h b/include/cps/Preprocessor.h new file mode 100644 index 0000000..ebc2806 --- /dev/null +++ b/include/cps/Preprocessor.h @@ -0,0 +1,19 @@ +#pragma once +#include <istream> +#include <string> +#include <vector> + +namespace cps { + +struct PreprocessedSource { + std::string Text; + // One entry per original source line, before processing that line's directive. + std::vector<bool> LibraryLines; + bool HadError = false; +}; + +// Switches and conditional nesting belong to this input only. Masked lines retain +// their byte lengths and line endings so the lexer sees original source locations. +PreprocessedSource preprocess(std::istream &Input); + +} |
