mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
Jedi code format: Fix issue #40980, exception on unterminated string.
This commit is contained in:
parent
92306de965
commit
7fe3cecf9a
@ -513,7 +513,7 @@ begin
|
||||
{ read until the close ''' }
|
||||
repeat
|
||||
if Current = #0 then
|
||||
Raise Exception.Create(Format(lisMsgUnterminatedString,[pcToken.SourceCode]));
|
||||
raise TEParseError.Create(Format(lisMsgUnterminatedString,[pcToken.SourceCode]),pcToken);
|
||||
|
||||
if (Current = NativeSingleQuote) then
|
||||
begin
|
||||
@ -556,7 +556,7 @@ begin
|
||||
if Current = #0 then
|
||||
break;
|
||||
if CharIsReturn(Current) then
|
||||
Raise Exception.Create(Format(lisMsgUnterminatedString,[pcToken.SourceCode]));
|
||||
raise TEParseError.Create(Format(lisMsgUnterminatedString,[pcToken.SourceCode]),pcToken);
|
||||
|
||||
{ two quotes in a row are still part of the string }
|
||||
if (Current = pcDelimiter) then
|
||||
|
@ -164,7 +164,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(lisMsgExpectionClassMsg, ['', 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