Skip to content

Commit 56ecce2

Browse files
committed
Revert "Syntax/Pascal: Support multiline strings (#2720)"
This reverts commit 5dcea0f.
1 parent 5dcea0f commit 56ecce2

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

Externals/crystaledit/editlib/parsers/pascal.cpp

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ unsigned
151151
CrystalLineParser::ParseLinePascal (unsigned dwCookie, const tchar_t *pszChars, int nLength, TEXTBLOCK * pBuf, int &nActualItems)
152152
{
153153
if (nLength == 0)
154-
return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2 | COOKIE_BLOCK_STYLE);
154+
return dwCookie & (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2);
155155

156156
bool bRedefineBlock = true;
157157
bool bDecIndex = false;
@@ -176,7 +176,7 @@ CrystalLineParser::ParseLinePascal (unsigned dwCookie, const tchar_t *pszChars,
176176
{
177177
DEFINE_BLOCK (nPos, COLORINDEX_COMMENT);
178178
}
179-
else if (dwCookie & (COOKIE_CHAR | COOKIE_STRING | COOKIE_BLOCK_STYLE))
179+
else if (dwCookie & (COOKIE_CHAR | COOKIE_STRING))
180180
{
181181
DEFINE_BLOCK (nPos, COLORINDEX_STRING);
182182
}
@@ -223,32 +223,12 @@ CrystalLineParser::ParseLinePascal (unsigned dwCookie, const tchar_t *pszChars,
223223
}
224224

225225
// Char constant '..'
226-
if (dwCookie & COOKIE_CHAR || dwCookie & COOKIE_BLOCK_STYLE)
226+
if (dwCookie & COOKIE_CHAR)
227227
{
228228
if (pszChars[I] == '\'' && (I == 0 || I == 1 && pszChars[nPrevI] != '\\' || I >= 2 && (pszChars[nPrevI] != '\\' || *tc::tcharprev(pszChars, pszChars + nPrevI) == '\\')))
229229
{
230-
// Multiline string ('''...''')?
231-
if (((nLength >= I + 1) && (pszChars[I+1] == '\'')) || (dwCookie & COOKIE_BLOCK_STYLE))
232-
{
233-
if (dwCookie & COOKIE_BLOCK_STYLE)
234-
{
235-
// End of multiline string
236-
dwCookie &= ~COOKIE_BLOCK_STYLE;
237-
}
238-
else
239-
{
240-
// Start of multiline string
241-
dwCookie |= COOKIE_BLOCK_STYLE;
242-
// Skip one
243-
I++;
244-
}
245-
}
246-
else
247-
{
248-
dwCookie &= ~COOKIE_CHAR;
249-
250-
bRedefineBlock = true;
251-
}
230+
dwCookie &= ~COOKIE_CHAR;
231+
bRedefineBlock = true;
252232
}
253233
continue;
254234
}
@@ -300,7 +280,7 @@ CrystalLineParser::ParseLinePascal (unsigned dwCookie, const tchar_t *pszChars,
300280
continue;
301281
}
302282
}
303-
if (I > 0 && pszChars[I] == '*' && pszChars[nPrevI] == '(') // (*
283+
if (I > 0 && pszChars[I] == '*' && pszChars[nPrevI] == '(')
304284
{
305285
DEFINE_BLOCK (nPrevI, COLORINDEX_COMMENT);
306286
dwCookie |= COOKIE_EXT_COMMENT;
@@ -341,6 +321,6 @@ CrystalLineParser::ParseLinePascal (unsigned dwCookie, const tchar_t *pszChars,
341321
}
342322

343323
if (pszChars[nLength - 1] != '\\' || IsMBSTrail(pszChars, nLength - 1))
344-
dwCookie &= (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2 | COOKIE_BLOCK_STYLE);
324+
dwCookie &= (COOKIE_EXT_COMMENT | COOKIE_EXT_COMMENT2);
345325
return dwCookie;
346326
}

0 commit comments

Comments
 (0)