From 6b11e10edcca93e22d9961d8cec0d2e0e4822ce7 Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Fri, 7 Jul 2017 17:31:27 +0000 Subject: [PATCH] pastojs: asm: set source pos to first non empty line git-svn-id: trunk@36669 - --- packages/pastojs/src/fppas2js.pp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/pastojs/src/fppas2js.pp b/packages/pastojs/src/fppas2js.pp index 7e6c11a9c2..5e03dc3e53 100644 --- a/packages/pastojs/src/fppas2js.pp +++ b/packages/pastojs/src/fppas2js.pp @@ -8814,15 +8814,24 @@ function TPasToJSConverter.ConvertAsmStatement(El: TPasImplAsmStatement; var s: String; L: TJSLiteral; + AsmLines: TStrings; + Line, Col, StartLine: integer; begin if AContext=nil then ; - s:=Trim(El.Tokens.Text); + AsmLines:=El.Tokens; + s:=Trim(AsmLines.Text); if (s<>'') and (s[length(s)]=';') then Delete(s,length(s),1); if s='' then Result:=TJSEmptyStatement(CreateElement(TJSEmptyStatement,El)) else begin - L:=TJSLiteral(CreateElement(TJSLiteral,El)); + StartLine:=0; + while (StartLine0 then + Col:=1; + L:=TJSLiteral.Create(Line+StartLine,Col,El.SourceFilename); L.Value.CustomValue:=TJSString(s); Result:=L; end;