aboutsummaryrefslogtreecommitdiff
path: root/include/cps/Preprocessor.h
blob: ebc280605323c9610e1de6658864ce54d1c962ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);

}