Jump to content
tylo

Au3Check.exe

Recommended Posts

Updated to v1.14: Uses old AutoIt3 registry path if new does not exist.

Cheers.

<{POST_SNAPBACK}>

Thats quick! will take this one and put it into the installer..

Thanks


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Fixed. :idiot:

+ Updated .def file with DllOpen()/DllClose().

<{POST_SNAPBACK}>

Thanks.

Edit: Hmm, I keep getting 1.13 every time I download. I've tried forcing a new download as well as a different brower. Anybody else getting an older version, too?

Edited by Valik

Share this post


Link to post
Share on other sites

I just downloaded the zip file.

And I see that the date of last modifications of the files:

- executable: november 29th

- definition file: october 10th

- text file: november 29th

I think Tylo uploaded an older version.

Share this post


Link to post
Share on other sites

I have some requests, tylo.

  • Support for the new Const keyword.
  • If assigning to a variable defined as Const, report an error.
  • A new mode (Either default, or activated via a command line switch) which basically does what Opt("MustDeclareVars") does. Example:

    Opt("MustDeclareVars", 1)
    MyFunc()
    Func MyFunc()
        $a = "a"
        If $a = "a" Then MsgBox(4096, "", "Good")
    EndFunc

    Au3Check happily reports this as being valid code, however, because the variable must be declared, AutoIt doesn't run it. This leads to subtle errors when the Local/Global keyword is accidentally forgotten.

Share this post


Link to post
Share on other sites

I must say, I do not like yacc/flex. I tried to hack together something just to get Const ignored so scripts containing it wouldn't return errors on it, but I can't even manage to get that simple task done. I just looked at the code for AutoIt's parser and was able to figure out what was going on, I can't seem to make heads or tails of this yacc stuff. I think I prefer parsers written in pure C++ to this.

Anybody else able to take a crack at this thing until tylo gets us an official version supporting Const?

Share this post


Link to post
Share on other sites

I must say, I do not like yacc/flex.  I tried to hack together something just to get Const ignored so scripts containing it wouldn't return errors on it, but I can't even manage to get that simple task done.  I just looked at the code for AutoIt's parser and was able to figure out what was going on, I can't seem to make heads or tails of this yacc stuff.  I think I prefer parsers written in pure C++ to this.

Anybody else able to take a crack at this thing until tylo gets us an official version supporting Const?

I think that's because yacc does it properly and AutoIt uses something I pulled out of my ass after reading a couple of internet articles on parsing (about which I have no clue)...

Share this post


Link to post
Share on other sites

I think that's because yacc does it properly and AutoIt uses something I pulled out of my ass after reading a couple of internet articles on parsing (about which I have no clue)...

<{POST_SNAPBACK}>

Doesn't matter to me if its done "properly". I just want to be able to modify it to suit my needs should I have reason to. I can do that with AutoIt's parser, but not with yacc. :idiot:

Share this post


Link to post
Share on other sites

I have some requests, tylo.

  • Support for the new Const keyword.

  • If assigning to a variable defined as Const, report an error.

  • A new mode (Either default, or activated via a command line switch) which basically does what Opt("MustDeclareVars") does.  Example:

    Opt("MustDeclareVars", 1)
    MyFunc()
    Func MyFunc()
        $a = "a"
        If $a = "a" Then MsgBox(4096, "", "Good")
    EndFunc

    Au3Check happily reports this as being valid code, however, because the variable must be declared, AutoIt doesn't run it.  This leads to subtle errors when the Local/Global keyword is accidentally forgotten.

<{POST_SNAPBACK}>

Updated with au3check v1.17.

The two first points are done. The third, I may do later.

Didn't update the .def file (Note: now renamed to .dat) - must leave some work for you all :idiot:

Cheers.

Share this post


Link to post
Share on other sites

Updated with au3check v1.17.

The two first points are done. The third, I may do later.

Didn't update the .def file (Note: now renamed to .dat) - must leave some work for you all :lol:

Cheers.

<{POST_SNAPBACK}>

ahhh its "Lets rename something day" :idiot:

thanks for the update... :D


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Updated with au3check v1.17.

The two first points are done. The third, I may do later.

Didn't update the .def file (Note: now renamed to .dat) - must leave some work for you all :idiot:

Cheers.

<{POST_SNAPBACK}>

Meh, I have a script that generates the .def file, my work will consist of changing a file extension in an INI file.

Thanks for the update, though!

Share this post


Link to post
Share on other sites

New au3check 1.18 // updated

- Added check for already defined non-const var when declaring consts.

- Changed a misleading error message for consts.

I must say, I do not like yacc/flex.  I tried to hack together something just to get Const ignored so scripts containing it wouldn't return errors on it, but I can't even manage to get that simple task done.  I just looked at the code for AutoIt's parser and was able to figure out what was going on, I can't seem to make heads or tails of this yacc stuff.  I think I prefer parsers written in pure C++ to this.

<{POST_SNAPBACK}>

Well, if you know the tool (yacc), it's not so bad. Here's the essence oo what I added to the yacc file:

declaration_statement
    : specifier declarator_list '\n'          /* normal vars */
    | const_specifier const_declarator_list '\n'  /* const vars */
;
const_specifier
    : K_Const        { ... }
    | K_Dim K_Const    { ... }
    | K_Local K_Const    { ... }
    | K_Global K_Const    { ... }
;
const_declarator
    : VARIABLE '=' exp[b][/b]ression   { /* add new const var */ }
;
const_declarator_list
    : const_declarator
    | const_declarator_list ',' const_declarator
;

I also check that any assignments or new var declarations are not using the same name as a previously declared Const var (in the correct scope), so I needed to add some "normal" C++ code as well.

Beware though, that the following code will be accepted by au3check, while not AutoIt:

func f()
   $MAXX = 0  ; OK - not yet seen by au3check: assume local var
endfunc

Const $MAXX = 10
f()

Make sure to declare globals above usage (in file scope):

Const $MAXX = 10

func f()
   $MAXX = 0  ; au3check reports error: previously declared as Const
endfunc

f()

/ADD:

New in v1.18: if $MAXX is declared as Global in f(), it will be reported illegal by au3check: (AutoIt will report error in non-Const declaration, whereas au3check in Const delcaration). Puh, this is getting complicated...

func f()
   Global $MAXX = 0; OK - not yet seen by au3check
endfunc

Const $MAXX = 10; ERROR by au3check - previously global non-const.
f()
Edited by tylo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...