Move #if evaluation flag out of PersistentParserState

Move this flag onto the parser instead. Now the
only client of PersistentParserState is code
completion.
This commit is contained in:
Hamish Knight
2020-02-04 14:51:19 -08:00
parent d494cc8dcb
commit 0d5a5e12d5
10 changed files with 29 additions and 25 deletions

View File

@@ -290,7 +290,7 @@ swiftparse_client_node_t SynParser::parse(const char *source) {
"syntax_parse_module", std::move(parseActions),
/*SyntaxCache=*/nullptr);
// Evaluating pound conditions may lead to unknown syntax.
PU.getParser().State->PerformConditionEvaluation = false;
PU.getParser().EvaluateConditionals = false;
std::unique_ptr<SynParserDiagConsumer> pConsumer;
if (DiagHandler) {
pConsumer = std::make_unique<SynParserDiagConsumer>(*this, bufID);