mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 21:43:30 +02:00
pastojs: asm: set source pos to first non empty line
git-svn-id: trunk@36669 -
This commit is contained in:
parent
1f5fc91144
commit
6b11e10edc
@ -8814,15 +8814,24 @@ function TPasToJSConverter.ConvertAsmStatement(El: TPasImplAsmStatement;
|
|||||||
var
|
var
|
||||||
s: String;
|
s: String;
|
||||||
L: TJSLiteral;
|
L: TJSLiteral;
|
||||||
|
AsmLines: TStrings;
|
||||||
|
Line, Col, StartLine: integer;
|
||||||
begin
|
begin
|
||||||
if AContext=nil then ;
|
if AContext=nil then ;
|
||||||
s:=Trim(El.Tokens.Text);
|
AsmLines:=El.Tokens;
|
||||||
|
s:=Trim(AsmLines.Text);
|
||||||
if (s<>'') and (s[length(s)]=';') then
|
if (s<>'') and (s[length(s)]=';') then
|
||||||
Delete(s,length(s),1);
|
Delete(s,length(s),1);
|
||||||
if s='' then
|
if s='' then
|
||||||
Result:=TJSEmptyStatement(CreateElement(TJSEmptyStatement,El))
|
Result:=TJSEmptyStatement(CreateElement(TJSEmptyStatement,El))
|
||||||
else begin
|
else begin
|
||||||
L:=TJSLiteral(CreateElement(TJSLiteral,El));
|
StartLine:=0;
|
||||||
|
while (StartLine<AsmLines.Count) and (Trim(AsmLines[StartLine])='') do
|
||||||
|
inc(StartLine);
|
||||||
|
TPasResolver.UnmangleSourceLineNumber(El.SourceLinenumber,Line,Col);
|
||||||
|
if StartLine>0 then
|
||||||
|
Col:=1;
|
||||||
|
L:=TJSLiteral.Create(Line+StartLine,Col,El.SourceFilename);
|
||||||
L.Value.CustomValue:=TJSString(s);
|
L.Value.CustomValue:=TJSString(s);
|
||||||
Result:=L;
|
Result:=L;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user