[C++] Handle sinclude
diff --git a/ast.h b/ast.h
index 99c8ae5..2b2b472 100644
--- a/ast.h
+++ b/ast.h
@@ -103,7 +103,7 @@
struct IncludeAST : public AST {
Value* expr;
- char op; // '-' or 0.
+ bool should_exist;
virtual ~IncludeAST();
diff --git a/parser.cc b/parser.cc
index 9ddd8cc..58ea3ba 100644
--- a/parser.cc
+++ b/parser.cc
@@ -49,6 +49,7 @@
make_directives_ = new unordered_map<StringPiece, DirectiveHandler>;
(*make_directives_)["include"] = &Parser::ParseIncludeAST;
(*make_directives_)["-include"] = &Parser::ParseIncludeAST;
+ (*make_directives_)["sinclude"] = &Parser::ParseIncludeAST;
shortest_directive_len_ = 9999;
longest_directive_len_ = 0;
@@ -171,7 +172,7 @@
void ParseIncludeAST(StringPiece line, StringPiece directive) {
IncludeAST* ast = new IncludeAST();
ast->expr = ParseExpr(line, false);
- ast->op = directive[0] == '-' ? '-' : 0;
+ ast->should_exist = directive[0] == 'i';
out_asts_->push_back(ast);
}