Page 1 of 1

Syntax Check Utility

Posted: 03 Mar 2016, 22:17
by paulobuchsbaum
I've made a small executable utility in Lazarus, a free Delphi clone, to check some syntax issues:

It is a small GUI application that lets you interactively select the name of a .ahk file, which can be stored wholly or partly in an .ini file. It generates all messages at once, allowing them to save in the Clipboard.

1) It shows lines using "=" for assignment instead of ": =". AHK accept both, but I use just ":=" for assignment.
2) It shows lines using "IF" command without parentheses limiting the whole expression, even though in some cases the AHK allows.
3) It shows lines using where the programmer uses a command on the same line than "IF". AHK does not accept it, but it does not show the error.
4) It shows lines with "LOOP" command that is not followed by digit, "%" or '{'. It not accepts ","

If anyone is interested, Let me know.

Re: Syntax Check Utility

Posted: 06 Mar 2016, 09:57
by paulobuchsbaum
I've made a new version of this small utility, scanning commands such as IF, WHILE, LOOP and FOR; searching for block evidence (2 first lines after flow control command with the same indentation), but without using braces ({}).

This is not detected, but from the second line forward, it will run, but not linked with that flow control command.

TAB size can be set in the INI file.

Re: Syntax Check Utility

Posted: 24 Apr 2016, 00:44
by naeSignedIn
This utility sounds great -- is it available for download anywhere?

Re: Syntax Check Utility

Posted: 05 May 2016, 08:36
by paulobuchsbaum

Re: Syntax Check Utility

Posted: 21 May 2016, 22:57
by obchhris
paulobuchsbaum, Thanks very much for making your script checking tool available. I've come back to AHK after not having the need for it for a few years and your utility will be helpful without a doubt. Great job..

Re: Syntax Check Utility

Posted: 08 Dec 2023, 09:21
by jamieh
I presume this is for V1. I’m on a Mac and would love to be able to check AHK scripts before testing on a PC at another site. Is the source available so I could build a MacOS version?

Re: Syntax Check Utility

Posted: 19 Dec 2023, 07:26
by geek
jamieh wrote:
08 Dec 2023, 09:21
I presume this is for V1. I’m on a Mac and would love to be able to check AHK scripts before testing on a PC at another site. Is the source available so I could build a MacOS version?
AutoHotkey should run on MacOS via Wine, at least well enough to validate the syntax of a script. Other than that, I run a hosted version of AHK+Wine that you can access on the Wiki https://autohotkey.wiki/cloudahk which should be able to tell you if your script has syntax errors.