Sign in to follow this  
Followers 0
linzp

where is src of tidy in autoit?

13 posts in this topic

#1 ·  Posted (edited)

The tidy tool in autoit is smart!

I want to beautify my fortran code with it.

But I wanna know where the src is.

As I search with the keyword "tidy", I only get sth about Html.

AND, tidy neither in the src of autoit.

Is there anyone help me?

Edited by linzp

Share this post


Link to post
Share on other sites



The source isn't available as far as I know.

You could do something similar to it in AutoIt, it probably wouldn't be easy, but it's doable. I wrote a quick script that fixes the indenting in VBScript that was a fun exercise, but the other functions of Tidy I haven't tried to duplicatte as of yet. :graduated:


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

BrewManNH is correct that the source is not available and furthermore the source is not written in AutoIt.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks a lot to both BrewManNH and GEOSoft!

Is there a hompage of tidy progject? I wannt to know more about it.

By the way, I am freshhand to autoit, and have just being here from scite.

But autoit is indeed powerful, so I will study and use it in my work.

Edited by linzp

Share this post


Link to post
Share on other sites

Tidy for AutoIt is written and maintained by Jos, one of the AutoIt developers and has no separate project pages or forums. I should have mentioned that it was in fact written in AutoIt during it's initial releases. Jos chose to change that (for speed as I recall) and has kept the source to himself since then, bless his tiny wooden shoes.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Tidy for AutoIt is written and maintained by Jos, one of the AutoIt developers and has no separate project pages or forums. I should have mentioned that it was in fact written in AutoIt during it's initial releases. Jos chose to change that (for speed as I recall) and has kept the source to himself since then, bless his tiny wooden shoes.

Correct, Tidy started for me as a project to learn scripting in AutoIt3 and explore its possibilities. That version is still around somewhere.

I did change it to BCX, which is a basic like tools that converts the source to C and then compiles it with PellesC, which made Tidy much faster being a compiled program.

I have not release the BCX source and am the only one having access to it. Obfuscator is a spin off were I used Tidy's lexing logic to build it.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

I have a very highly modified version of the original. In fact it's so modified that I can't figure out what I was doing.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

This is a link to the download of the latest Autoit3 version (1.31.8.23) of Tidy

I am not sure if it will still properly work as it was not modified for the newer AutoIt3 releases.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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

I think it does Jos. I still use that basic code in mine but I dumped the ini read/writes in favor of registry entries then added a GUI and a bunch of new functions for spacing, syntax updating &etc. The only changes I had to make to mine were a few for the GUI portion which as I recall the original didn't have. I'm also using it compiled so there may actually be more changes required in mine now since there have been so many more changes to AutoIt since then. I did try to rewrite the indenting portion using RegExps but that was a miserable flop when it came to nested items.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

When I was playing around with my VBScript version of Tidy, the indenting part was the easy part, the rest of it was what was beyond me at the time as I was/am just learning the language. Trying to get what are variables in VBScript isn't as easy as it is in AutoIt because there's no $ at the beginning of every variable, as an example.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

With RegEx, getting the indenting wasn't difficult until you got to the nested statement. This is difficult to manage using a regexp

While 1
    While 2
    
    WEnd
WEnd

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

I just used a variable that keeps track of the indenting, every time you find a word that indicates the next lines should be indented by one tab (or spaces) you increment the variable by one. Then you do the indenting on the following lines by however many indents you need. Decrement the variable by one whenever you hit a line that contains the end of whatever should be indented. Nesting is easy that way. In Autoit as in vbscript, there aren't that many things that trigger indenting. For..Next, While...Wend, If...Else/Elseif...Endif, Func...endfunc, etc. Fortunately, indenting functions are at the beginning of the lines, so I read the file in one line at a time, checked to see if it needed to be indented, deindented, or caused the next lines to be indented/deindented and set the variable accordingly. No regex needed the way I did it, because I have/had no experience in using it, so I did it the brute force method of identifying indenting.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Thats the way I did it and it's the way Jos did it. I was just trying to speed it up by using a RegEx instead of going line by line.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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
Sign in to follow this  
Followers 0