DllCall converter/cleaner (e.g. x32 to x64/x32 two-way compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31365
- Clean DllCall lines.
- Clean NumGet/NumPut lines
- Separate parameters in command/function lines:
- Identify continuation section lines.
indent code (automated code indentation) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=37270
[This may be complete in a few weeks.]
AHK v1 to AHK v2 converter - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 37&t=36754
- Check for lines that don't meet certain criteria.
- Clean AHK v1 scripts.
- Make AHK v1 scripts more AHK v2 ready, e.g. StringReplace -> StrReplace, var = value -> var := value.
- Convert AHK v1 scripts to AHK v2 scripts.
I'm starting this thread, for sharing ideas/problems regarding parsing AutoHotkey scripts. I would be interested to hear from anyone who regularly parses AHK scripts, e.g. people who have worked on AHK editors / the AHK source code.
The first point I thought I'd bring up is, I had a script to add/remove initial commas from commands. But it incorrectly converted a variable with the same name as a command. I've since added a look-ahead to the RegEx line, to check for ' := ', but I thought this was a classic example of a conversion gotcha.
hotkey := NumGet(hotkey)
to
Hotkey, := NumGet(hotkey)
I would be interested in:
- any links to good converter/parser scripts
- any other classic conversion/parsing issues
- any comments on parsing objects, this is something I need to add to my converter scripts
- any general comments on converting from AHK v1 to AHK v2, i.e. tidbits of information v. just giving me a massive script to look through
- complete parsing of a script and listing/(wrapping in text) all the functions/variables
Thanks for reading.
==================================================
[EDIT:] I'm collecting links re. parsing issues.
Winmove error with "[" in window title - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 64#p187564
scrap commands? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 61#p187561
scrap commands? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 31#p187731
v2-thoughts
https://autohotkey.com/v2/v2-thoughts.htm
•Output variables of built-in functions are currently not allowed to be an expression when parentheses are omitted. For example, MouseGetPos whichvar ? x : y is not valid, but MouseGetPos(whichvar ? x : y) is.