mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 01:29:08 +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 ''' }
|
{ read until the close ''' }
|
||||||
repeat
|
repeat
|
||||||
if Current = #0 then
|
if Current = #0 then
|
||||||
Raise Exception.Create(Format(lisMsgUnterminatedString,[pcToken.SourceCode]));
|
raise TEParseError.Create(Format(lisMsgUnterminatedString,[pcToken.SourceCode]),pcToken);
|
||||||
|
|
||||||
if (Current = NativeSingleQuote) then
|
if (Current = NativeSingleQuote) then
|
||||||
begin
|
begin
|
||||||
@ -556,7 +556,7 @@ begin
|
|||||||
if Current = #0 then
|
if Current = #0 then
|
||||||
break;
|
break;
|
||||||
if CharIsReturn(Current) then
|
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 }
|
{ two quotes in a row are still part of the string }
|
||||||
if (Current = pcDelimiter) then
|
if (Current = pcDelimiter) then
|
||||||
|
@ -164,7 +164,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(lisMsgExpectionClassMsg, ['', 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