return nextLine_ + 6;
}
}
- if (delimiterNesting_ > 0) {
- if (!IsFixedFormCommentChar(col1)) {
- return nextLine_;
- }
+ if (IsImplicitContinuation()) {
+ return nextLine_;
}
}
return nullptr; // not a continuation line
return p + 1;
} else if (*p == '!' || *p == '\n' || *p == '#') {
return nullptr;
- } else if (ampersand || delimiterNesting_ > 0) {
+ } else if (ampersand || IsImplicitContinuation()) {
if (p > nextLine_) {
--p;
} else {
return false;
}
+// Implicit line continuation allows a preprocessor macro call with
+// arguments to span multiple lines.
+bool Prescanner::IsImplicitContinuation() const {
+ return !inPreprocessorDirective_ && !inCharLiteral_ &&
+ delimiterNesting_ > 0 && nextLine_ < limit_ &&
+ ClassifyLine(nextLine_).kind == LineClassification::Kind::Source;
+}
+
bool Prescanner::Continuation(bool mightNeedFixedFormSpace) {
if (*at_ == '\n' || *at_ == '&') {
if (inFixedForm_) {
const char *IsPreprocessorDirectiveLine(const char *) const;
const char *FixedFormContinuationLine(bool mightNeedSpace);
const char *FreeFormContinuationLine(bool ampersand);
+ bool IsImplicitContinuation() const;
bool FixedFormContinuation(bool mightNeedSpace);
bool FreeFormContinuation();
bool Continuation(bool mightNeedFixedFormSpace);