mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 05:50:30 +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
|
||||
break;
|
||||
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 }
|
||||
if (Current = pcDelimiter) then
|
||||
|
@ -161,7 +161,16 @@ begin
|
||||
fcTokeniser.SourceCode := InputCode;
|
||||
fcTokeniser.FileName := FileName;
|
||||
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 { show exceptions }
|
||||
fiTokenCount := lcTokenList.Count;
|
||||
|
Loading…
Reference in New Issue
Block a user