AHK-v2-script-converter icon indicating copy to clipboard operation
AHK-v2-script-converter copied to clipboard

Some words in strings are erroneously replaced

Open Lexikos opened this issue 1 year ago • 1 comments

Input:

MsgBox % "Steve picked up his clipboard."
MsgBox Steve opened his clipboard.

Incorrect output:

MsgBox("Steve picked up his A_Clipboard.")
MsgBox("Steve opened his A_Clipboard.")

This is just a string, with no relation to the Clipboard variable. Regardless of case or the surrounding string, the insertion of A_ is unwarranted.

This also applies to A_LoopFileFullPath and A_LoopFileLongPath (and maybe others?), although I suppose those are less likely to be an issue.

It appears that only the first occurrence of each name on a given line is replaced, which would be another bug if the replacement is warranted.

Lexikos avatar Jul 22 '23 03:07 Lexikos

Other examples from my auto-spell script:

Input:

::controll::control
::crtical::critical
::proccess::process
::ptogress::progress
::tranform::transform

Output:

::controll::Control()
::crtical::Critical()
::proccess::ErrorLevel := Process()
::ptogress::gocProgress.Value :=
::tranform::; Removed : Transform(, , , )

Expected output: No change (same as input) because these are just words.

user1823 avatar Jan 24 '24 13:01 user1823

This is just a string, with no relation to the Clipboard variable. Regardless of case or the surrounding string, the insertion of A_ is unwarranted.

This also applies to A_LoopFileFullPath and A_LoopFileLongPath (and maybe others?), although I suppose those are less likely to be an issue.

Have submitted a fix for keyword conversions affecting strings. If the pull-request is accepted, many keywords will no longer be replaced within strings. The following should be corrected... (A_BatchLines, A_isUnicode, A_LoopFileFullPath, A_LoopFileLongPath, A_NumBatchLines, Clipboard, ClipboardAll, ComObjParameter, ComSpec, New) More may be corrected in future updates.

andymbody avatar Apr 10 '24 17:04 andymbody

#156 will fix Lexikos' example, but user1823's example is still broken

Hopefully fully fixing shouldn't be too hard, as the base is here for these kinds of issues

Banaanae avatar Apr 11 '24 01:04 Banaanae