<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Fri, Jan 11, 2019 at 1:38 PM warleyalex via Pas2js <<a href="mailto:pas2js@lists.freepascal.org">pas2js@lists.freepascal.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">OK.  Another thing is<br>
<br>
The pas2js compiler does neither parse, nor check the syntax of the JS, but<br>
I thing pascal methods should be recognized within ASM block. <br></blockquote><div><br></div><div>Already mentioned by Mattias in last messages.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  p := @Myfunction; // we have to add this dummy variable ...</blockquote></div><div><br></div><div>Sorry, but as I said -- and have been trying to explain by subject and by last messages --: just any compiler option/keyword/directive to disable its optimization in specific parts of the user (programmer) code, leaving them untouchable, but not by cheating the compiler using ugly/dummy codes. A good option would be ("<font face="monospace, monospace" size="1"><b>please_leave_my_asm_function_in_peace</b></font>" just to make it comical):<br></div><div><br></div><div><span style="font-family:monospace,monospace;font-size:x-small"><b>{$please_leave_my_asm_function_in_peace ON}</b></span><font face="monospace, monospace" size="1"><br></font></div><div><font face="monospace, monospace" size="1">procedure foo;</font></div><div><font face="monospace, monospace" size="1">asm</font></div><div><span style="font-family:monospace,monospace;font-size:x-small">  alert('leave me in peace, compiler!');</span><br></div><div><span style="font-family:monospace,monospace;font-size:x-small">end;</span><br></div><div><span style="font-family:monospace,monospace;font-size:x-small"><b>{$endif}</b></span><span style="font-family:monospace,monospace;font-size:x-small"><br></span></div><div><br></div><div>that's all, the <font face="monospace, monospace" size="1">foo()</font> would be available in the final application script even enabling the full optimization of the compiler, cause the user code would be kept as it is. This is possible in other languages by using keywords (e.g: volatile), compiler annotations and/or pragmas/directives (some tools allows special comments too).</div><div><br></div><div>best,</div><div><br></div>--<br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div></div></div></div></div></div></div>