[Cuis-dev] Bugfix - ExtractToTemporary

Juan Vuletich juan at cuis.st
Mon Mar 31 07:18:16 PDT 2025


Hi Joel,

Thanks for the fix! It is now at GitHub.

Cheers,

On 3/25/2025 7:33 PM, Joel Camera via Cuis-dev wrote:
> Hi folks!
> Here I bring a bugfix of ExtractToTemporary with its test.
> 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.
> Example: Suppose we want to create a temporary variable with the 
> highlighted code, and the new variable name will be /newVar/.
> m1
>   |var|
>   var := 1.
>   ^ var + 2
>
> After extracting the variable it will end like this
> m1
>   |va newVarr|
> var := 1.
> _newVar_ := var + 2.
>   ^ _newVar_
>
> 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.
>
> Have a nice day!
>
> <https://10pines.com/>
>
>
>   Joel Cámera
>
>
>     Agile Software Development
>
>
>   Alem 896, Floor 6, Buenos Aires, Argentina
>
>   +54 9 011 6091 3125
>


-- 
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250331/87f7eedf/attachment.htm>


More information about the Cuis-dev mailing list