darthwhatever

Tidy erases whitespace on If-ElseIf lines with paranthesis inside brackets

3 posts in this topic

I believe I have found a bug in the latest version of Tidy, which I have downloaded from the Scite4Autoit website. Tidying the following code 

If $a[1 - function('')] Then
ElseIf $a[fucntion()] Then
ElseIf $a[(0)] Then
ElseIf $a[function() - 0] Then
ElseIf $a[function(0)] = 1 Then
EndIf

will erase the whitespace between the closing brackets and the then keyword whenever the last expression is a function. This also occurs on ElseIf lines, and results in this code: 

If $a[1 - function('')]Then
ElseIf $a[function()]Then
ElseIf $a[(0)]Then
ElseIf $a[function() - 0] Then
ElseIf $a[function(0)] = 1 Then
EndIf

Which does not run. Should I submit a bug report on the autoit bugtracker? For now I can either use the #Tidy_on and #Tidy_off directives to skip these lines so that the source actually runs. 


[font=arial, sans-serif]How is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive?[/font][font=arial, sans-serif]<div>This is how you annoy a web developer.</span>[/font]

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

  • Similar Content

    • Jos
      By Jos
      Merged the SciTE 3.7.3 source into our version and several other changes and fixes to the supporting utilities.
      Enjoy,
      Jos
      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 24-2-2017 *** Merged the SciTE v 3.7.3 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated AutoIt3Wrapper v17.224.935.0 (Jos)     - 16.612.1119.1 Fixed #AutoIt3Wrapper_Run_Stop_OnError=N, avoiding to stop even when No or not  specified.     - 16.612.1119.2 Fixed #AutoIt3Wrapper_Run_Stop_OnError=N, avoiding to stop even when No or not  specified.     - 16.612.1119.3 Added warning for #AutoIt3Wrapper_UseX64 in case #pragma(out,..)  is used. *** Updated Au3Stripper v17.224.935.0 (Jos)     - 16.612.1119.1 Fixed issue which sometimes was stripping a global const incorrectly     - 16.612.1119.2 Fixed /maxiterations parameter not recognised     - 16.612.1119.3 Fixed increased the max #Au3Stripper_Ignore_Variables to 500 and for #Au3Stripper_Ignore_Funcs to 200     - 16.612.1119.4 Fixed regression introduced in 16.612.1119.1 *** Updated SciTEConfig v17.224.935.0 (Jos)     - 16.306.1119.1 ... *** Updated Tidy v17.224.935.0 (Jos)     - 16.612.1119.1: Fixed Sort_Func function bug when the source contains a BOM. *** Updated CodewiZard v1.5.4.0 (Cyberyeye)     - Fix Icon Ressource Number for Messagebox Tab & ToolTip Tab     - Check/Fix missing includes using AutoIt3Wrapper_Add_Constants=y     - Added Opt("MustDeclareVars", 1) to fix undeclared variables     - Replaced msgbox() magic number by constant name     - Added GUISetIcon var (au3.ico)     - Removed unusefull old AutoIt3Wrapper directive *** Updated Abbreviations (mLipok)     - Updated au3abbrev.properties and helpfile page. --------------------------------------------------------------------------------------------------
      ==> ScitillaHistory page containing all SciTE-Scintilla updates.
      ==> Visit the SciTE4AutoIt3 Download page for the latest versions
      ==> Check  the online documentation for an overview of all extra's you get with this installer.
       
    • odaylton
      By odaylton
      Text translated from Portuguese by google - please apologize for any errors
      After using the first 15 lines are replaced
      I'm using autoitdebug and made the new update installation of v3.3.14.2 autoit
      And Tidy AutoIt3 v2.3.0.8 Copyright (c) Jos van der Zande March 24, 2013
      After using it incere 15 lines containing:
      e|_WinNet_GetUser|_WinNet_OpenEnum|_WinNet_RestoreConnection|_WinNet_UseConnection|_Word_Create|_Word_DocAdd|_Word_DocAttach|_Word_DocClose|_Word_DocExport|_Word_DocFind|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      num|_WinNet_RestoreConnection|_WinNet_UseConnection|_Word_Create|_Word_DocAdd|_Word_DocAttach|_Word_DocClose|_Word_DocExport|_Word_DocFind|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      DocAttach|_Word_DocClose|_Word_DocExport|_Word_DocFind|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      d|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      Get|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      t|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      _Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      ureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
      angeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
       
      Replacing my script
      What went wrong
       
    • Jos
      By Jos
      11-3-2016: Uploaded a new SciTE4AutoIt3.exe.
      Merged the SciTE 3.6.2 source into our version and several other changes and fixes to the supporting utilities.
      Enjoy,
      Jos
      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 6-3-2016 *** Merged the SciTE v 3.6.2 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated AutoIt3Wrapper v16.306.1237.0 (Jos) - 15.920.938.2 removed the check for utf8 for au3check as that is supported - 15.920.938.3 Reverted __ConsoleWrite() to ConsoleWrite for ShowStdOutErr() - 15.920.938.4 added info for codepage and utf8 check to header. - 15.920.938.5 Only warn about #RequireAdmin for Run option. - 15.920.938.6 fixed issue when these were used together: #AutoIt3Wrapper_Run_Au3Stripper=y #AutoIt3Wrapper_Res_SaveSource=Y - 15.920.938.8 Modifications from DickG for the GUI Control locations and sizes to fit other screen sizes. *** Updated Au3Stripper v16.306.1237.0 (Jos) - 15.920.938.2 Fixed error line number for statements using unresolved func name Added logic to remove the () behind the Func in case of this type of lines: Call(Example3(), 'fff') NewFoundWord$ is then="Example3()" - 15.920.938.3 Added minus sign support to preexpand variables. - 15.920.938.4 Fixed crash in the get firstword logic to limit the returned length to 500. - 15.920.938.5 Fixed /PE replacing the variable in a For $x= statement. *** Updated SciTEConfig v16.306.1237.0 (Jos) - 15.920.938.1 hide/unhide when opening Tidy.ini to avoid a hidden msgbox hanging SciTEConfig.au3 - 15.920.938.2 Added the creation of includes.txt for AutoComplete Standard UDFs when "#include" is typed. - 15.920.938.3 Fixed for CallTip not always updating correctly. *** Updated Tidy v16.306.1237.0 (Jos) - 15.920.938.1 Fixed issue with space removal between [ and Then - 15.920.938.2 #forceref and #forcedef now also tidied. - 15.920.938.3 Enfoces a single space between end-of-line and inline comment - 15.920.938.4 Fixed regression extra space between EndFunc and #EndRegion and the added comments. --------------------------------------------------------------------------------------------------   ==> ScitillaHistory page containing all SciTE-Scintilla updates.
      ==> Visit the SciTE4AutoIt3 Download page for the latest versions
      ==> Check the newly formatted the online documentation for an overview of all extra's you get with this installer.