mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 00:20:08 +02:00
Jedi code format: Fix issue #40980, exception on unterminated string.
This commit is contained in:
parent
2216170cde
commit
41db711cbc
@ -503,7 +503,7 @@ begin
|
|||||||
if Current = #0 then
|
if Current = #0 then
|
||||||
break;
|
break;
|
||||||
if CharIsReturn(Current) then
|
if CharIsReturn(Current) then
|
||||||
Raise Exception.Create('Unterminated string: ' + pcToken.SourceCode);
|
Raise TEParseError.Create('Unterminated string: ' + pcToken.SourceCode, pcToken);
|
||||||
|
|
||||||
{ two quotes in a row are still part of the string }
|
{ two quotes in a row are still part of the string }
|
||||||
if (Current = pcDelimiter) then
|
if (Current = pcDelimiter) then
|
||||||
|
@ -161,7 +161,16 @@ begin
|
|||||||
fcTokeniser.SourceCode := InputCode;
|
fcTokeniser.SourceCode := InputCode;
|
||||||
fcTokeniser.FileName := FileName;
|
fcTokeniser.FileName := FileName;
|
||||||
lcTokenList := TSourceTokenList.Create;
|
lcTokenList := TSourceTokenList.Create;
|
||||||
fcTokeniser.BuildTokenList(lcTokenList);
|
try
|
||||||
|
fcTokeniser.BuildTokenList(lcTokenList);
|
||||||
|
except
|
||||||
|
on E: Exception do
|
||||||
|
begin
|
||||||
|
fbConvertError := True;
|
||||||
|
SendStatusMessage('', Format('Exception %s %s', ['', E.Message]), mtException, -1, -1);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
try { finally free the list }
|
try { finally free the list }
|
||||||
try { show exceptions }
|
try { show exceptions }
|
||||||
fiTokenCount := lcTokenList.Count;
|
fiTokenCount := lcTokenList.Count;
|
||||||
|
Loading…
Reference in New Issue
Block a user