MCPcopy Create free account
hub / github.com/KDE/kdevelop / addDoubleQuote

Method addDoubleQuote

kdevplatform/util/formattinghelpers.cpp:95–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93};
94
95bool DoubleQuoteValidator::addDoubleQuote(bool isInserted)
96{
97 if (!m_unmatchedDoubleQuote) {
98 m_unmatchedDoubleQuote = true;
99 m_unmatchedDoubleQuoteWasInserted = isInserted;
100 return true;
101 }
102
103 if (m_matchDoubleQuotes || m_unmatchedDoubleQuoteWasInserted != isInserted) {
104 // Either the two double quotes are matched and cleared, or one was inserted and another removed,
105 // which unconditionally cancels them out (could be some code reordering by the formatter).
106 m_unmatchedDoubleQuote = false;
107 return true;
108 }
109
110 // Fail because of two consecutive inserted or removed double quotes, matching which has been disabled.
111 printFailureWarning();
112 return false;
113}
114
115/**
116 * Tracks and validates inserted and removed, opening and closing brackets of a single type, e.g. '{' and '}'.

Callers 2

addMethod · 0.45
addMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected