<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Joel,<br>
    <br>
    Thanks for the fix! It is now at GitHub.<br>
    <br>
    Cheers,<br>
    <br>
    On 3/25/2025 7:33 PM, Joel Camera via Cuis-dev wrote:
    <blockquote
cite="mid:CAKc5+ie-e6Ks7QGrow9zFk320at-YU8xQ-eyqudi7tMyv0JU9A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi folks!</div>
        <div>Here I bring a bugfix of ExtractToTemporary with its test.</div>
        <div>The problem was that if a variable declaration does not
          have a space at the end, and someone wants to extract a new
          temporary, it will add the new temporary variable in the
          middle of the last one.</div>
        <div>Example: Suppose we want to create a temporary variable
          with the highlighted code, and the new variable name will be <i>newVar</i>. </div>
        <div>m1</div>
        <div>  |var|</div>
        <div>  var := 1.</div>
        <div>  ^ <span style="background-color: rgb(255, 255, 0);">var +
            2</span></div>
        <div><br>
        </div>
        <div>After extracting the variable it will end like this</div>
        <div>m1</div>
        <div>  |va newVarr|</div>
        <div>  <font color="#ff0000">var</font> := 1.<br>
            <u>newVar</u> := <font color="#ff0000">var</font> + 2.<br>
            ^ <u>newVar</u></div>
        <div><br>
        </div>
        <div>Checking the code, ExtractToTemporary assumes the last
          space of variable declaration exists. So the fix is checking
          if the space exists or not and return the right index to add
          the new variable.</div>
        <div><br>
        </div>
        <div>Have a nice day!</div>
        <div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div><br>
              </div>
              <a moz-do-not-send="true" href="https://10pines.com/"
                style="font-family: Roboto,Helvetica,Arial,sans-serif;
                font-size: medium;" target="_blank"><img
                  moz-do-not-send="true"
                  src="https://10pines.github.io/email-signature/10pines-firma@2x.png"
                  style="margin-bottom: 0.5em;" width="108"></a>
              <h1 style="margin: 0px; font-size: 14px;"><font
                  color="#999999">Joel Cámera</font></h1>
              <h2 style="color: rgb(100, 100, 100); margin: 0px 0px 1em;
                font-size: 14px;">Agile Software Development</h2>
              <h1 style="margin: 0px; font-size: 14px;"><font
                  style="font-weight: normal;" color="#666666">
                  <p style="margin: 0px; font-size: 12px;">Alem 896,
                    Floor 6, Buenos Aires, Argentina</p>
                  <p style="margin: 0px; font-size: 12px;">+54 9 011
                    6091 3125</p>
                </font></h1>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
  </body>
</html>