]> git.donarmstrong.com Git - perltidy.git/commitdiff
update comments, remove some line-ending spaces
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 30 Jan 2024 15:08:03 +0000 (07:08 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 30 Jan 2024 15:08:03 +0000 (07:08 -0800)
18 files changed:
CHANGES.md
lib/Perl/Tidy.pm
lib/Perl/Tidy/Diagnostics.pm
lib/Perl/Tidy/FileWriter.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/IOScalar.pm
lib/Perl/Tidy/IOScalarArray.pm
lib/Perl/Tidy/IndentationItem.pm
lib/Perl/Tidy/Logger.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm
lib/Perl/Tidy/VerticalAligner/Alignment.pm
lib/Perl/Tidy/VerticalAligner/Line.pm
local-docs/Release-Checklist.md
local-docs/stylekey.pod
t/snippets/expect/html1.html
t/snippets4.t

index 191a38cf3a4b53f694790102b41fe0596b374d3a..ab049c3addde822d8c50ef243e04ca269f65c373 100644 (file)
@@ -34,6 +34,7 @@
 
     - Added --dump-mixed-call-parens (-dmcp ) which will dump a list of
       operators which are sometimes followed by parens and sometimes not.
+      This can be useful for developing a uniform style for selected operators.
       Issue git #128. For example
 
          perltidy -dmcp somefile.pl >out.txt
@@ -54,7 +55,7 @@
       will format as normal but warn if any user subs are called without parens.
 
     - Added --dump-unusual-variables (-duv) option to dump a list of
-      variables with certain properties of interest. For example
+      variables with certain properties of interest.  For example
 
          perltidy -duv somefile.pl >vars.txt
 
         p: lexical variable with scope in multiple packages
         u: unused variable
 
+      This is very useful for locating problem areas and even bugs in code.
+      As an example, after it was developed it was applied to the perltidy
+      source code and it revealed two bugs; fortunately both were benign.
+
     - Added a related flag --warn-variable-types=string (-wvt=string) option
       to warn if certain types of variables are found in a script. The types
       are a space-separated string which may include 'r', 's', and 'p' but
 
     - When braces are detected to be unbalanced, an attempt is made to
       localize the error by comparing the indentation at closing braces
-      with their actual nesting levels. Line numbers at any differences
-      are reported in the error file.  This can be useful for files which
-      have previously been formatted by perltidy.
+      with their actual nesting levels. This can be useful for files which
+      have previously been formatted by perltidy. To illustrate, a test was
+      made in which the closing brace at line 30644 was commented out in
+      a file with a total of over 62000 lines.  The new error message is
+
+        Final nesting depth of '{'s is 1
+        The most recent un-matched '{' is on line 6858
+        ...
+        Table of nesting level differences at closing braces.
+        This might help localize brace errors if the file was previously formatted.
+        line:  (brace level) - (level expected from old indentation)
+        30643: 0
+        30645: 1
+
+      Previously, the error file only indicated that the error in this case
+      was somewhere after line 6858, so the new table is very helpful. Closing
+      brace indentation is checked because it is unambiguous and can be done
+      very efficiently.
 
     - The -DEBUG option no longer automatically also writes a .LOG file.
       Use --show-options if the .LOG file is needed.
 
+    - The run time of this version with all new options in use is no
+      greater than the previous version thanks to optimization work.
+
 ## 2023 09 12
 
     - Fix for git #124: remove a syntax error check which could cause
 
     - Added support for Switch::Plain syntax, issue git #31.
 
-    - Fixed minor problem where trailing 'unless' clauses were not 
+    - Fixed minor problem where trailing 'unless' clauses were not
       getting vertically aligned.
 
     - Added a parameter --logical-padding or -lop to allow logical padding
       'teefile' call parameters.  These output streams are rarely used but
       they are now treated the same as any 'logfile' stream.
 
-    - add option --break-at-old-semicolon-breakpoints', -bos, requested 
+    - add option --break-at-old-semicolon-breakpoints', -bos, requested
       in RT#131644.  This flag will keep lines beginning with a semicolon.
 
     - Added --use-unicode-gcstring to control use of Unicode::GCString for
-      evaluating character widths of encoded data.  The default is 
+      evaluating character widths of encoded data.  The default is
       not to use this (--nouse-unicode-gcstring). If this flag is set,
-      perltidy will look for Unicode::GCString and, if found, will use it 
+      perltidy will look for Unicode::GCString and, if found, will use it
       to evaluate character display widths.  This can improve displayed
       vertical alignment for files with wide characters.  It is a nice
       feature but it is off by default to avoid conflicting formatting
-      when there are multiple developers.  Perltidy installation does not 
-      require Unicode::GCString, so users wanting to use this feature need 
+      when there are multiple developers.  Perltidy installation does not
+      require Unicode::GCString, so users wanting to use this feature need
       set this flag and also to install Unicode::GCString separately.
 
     - Added --character-encoding=guess or -guess to have perltidy guess
-      if a file (or other input stream) is encoded as -utf8 or some 
-      other single-byte encoding. This is useful when processing a mixture 
+      if a file (or other input stream) is encoded as -utf8 or some
+      other single-byte encoding. This is useful when processing a mixture
       of file types, such as utf8 and latin-1.
 
       Please Note: The default encoding has been set to be 'guess'
-      instead of 'none'. This seems like the best default, since 
+      instead of 'none'. This seems like the best default, since
       it allows perltidy work properly with both
       utf8 files and older latin-1 files.  The guess mode uses Encode::Guess,
-      which is included in standard perl distributions, and only tries to 
-      guess if a file is utf8 or not, never any other encoding.  If the guess is 
-      utf8, and if the file successfully decodes as utf8, then it the encoding 
-      is assumed to be utf8.  Otherwise, no encoding is assumed. 
-      If you do not want to use this new default guess mode, or have a 
-      problem with it, you can set --character-encoding=none (the previous 
+      which is included in standard perl distributions, and only tries to
+      guess if a file is utf8 or not, never any other encoding.  If the guess is
+      utf8, and if the file successfully decodes as utf8, then it the encoding
+      is assumed to be utf8.  Otherwise, no encoding is assumed.
+      If you do not want to use this new default guess mode, or have a
+      problem with it, you can set --character-encoding=none (the previous
       default) or --character-encoding=utf8 (if you deal with utf8 files).
 
     - Specific encodings of input files other than utf8 may now be given, for
 ## 2020 01 10
 
     - This release adds a flag to control the feature RT#130394 (allow short nested blocks)
-      introduced in the previous release.  Unfortunately that feature breaks 
+      introduced in the previous release.  Unfortunately that feature breaks
       RPerl installations, so a control flag has been introduced and that feature is now
       off by default.  The flag is:
 
-      --one-line-block-nesting=n, or -olbn=n, where n is an integer as follows: 
+      --one-line-block-nesting=n, or -olbn=n, where n is an integer as follows:
 
       -olbn=0 break nested one-line blocks into multiple lines [new DEFAULT]
       -olbn=1 stable; keep existing nested-one line blocks intact [previous DEFAULT]
     - Fixed issue RT#131288: parse error for un-prototyped constant function without parenthesized
       call parameters followed by ternary.
 
-    - Fixed issue RT#131360, installation documentation.  Added a note that the binary 
-      'perltidy' comes with the Perl::Tidy module. They can both normally be installed with 
+    - Fixed issue RT#131360, installation documentation.  Added a note that the binary
+      'perltidy' comes with the Perl::Tidy module. They can both normally be installed with
       'cpanm Perl::Tidy'
 
 
     - Fixed issue RT#130394: Allow short nested blocks.  Given the following
 
         $factorial = sub { reduce { $a * $b } 1 .. 11 };
-   
+
       Previous versions would always break the sub block because it
       contains another block (the reduce block).  The fix keeps
       short one-line blocks such as this intact.
       one or more aliases for 'sub', separated by spaces or commas.
       For example,
 
-        perltidy -sal='method fun' 
+        perltidy -sal='method fun'
 
       will cause the perltidy to treat the words 'method' and 'fun' to be
       treated the same as if they were 'sub'.
 
-    - Added flag --space-prototype-paren=i, or -spp=i, to control spacing 
+    - Added flag --space-prototype-paren=i, or -spp=i, to control spacing
       before the opening paren of a prototype, where i=0, 1, or 2:
       i=0 no space
       i=1 follow input [current and default]
       i=2 always space
 
       Previously, perltidy always followed the input.
-      For example, given the following input 
+      For example, given the following input
 
          sub usage();
 
 
 ## 2019 09 15
 
-    - fixed issue RT#130344: false warning "operator in print statement" 
-      for "use lib". 
+    - fixed issue RT#130344: false warning "operator in print statement"
+      for "use lib".
 
     - fixed issue RT#130304: standard error output should include filename.
-      When perltidy error messages are directed to the standard error output 
-      with -se or --standard-error-output, the message lines now have a prefix 
-      'filename:' for clarification in case multiple files 
-      are processed, where 'filename' is the name of the input file.  If 
-      input is from the standard input the displayed filename is '<stdin>', 
-      and if it is from a data structure then displayed filename 
+      When perltidy error messages are directed to the standard error output
+      with -se or --standard-error-output, the message lines now have a prefix
+      'filename:' for clarification in case multiple files
+      are processed, where 'filename' is the name of the input file.  If
+      input is from the standard input the displayed filename is '<stdin>',
+      and if it is from a data structure then displayed filename
       is '<source_stream>'.
 
     - implement issue RT#130425: check mode.  A new flag '--assert-tidy'
index 9fe355e2caf04716083663acf0537e514642f746..0079841271fb832c7e4d5666f4da22cf25e44669 100644 (file)
@@ -150,7 +150,7 @@ sub AUTOLOAD {
     print {*STDERR} <<EOM;
 ======================================================================
 Unexpected call to Autoload looking for sub $AUTOLOAD
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
@@ -757,7 +757,7 @@ EOM
             croak <<EOM;
 ------------------------------------------------------------------------
 Please check value of -dump_options_type in call to perltidy;
-saw: '$dump_options_type' 
+saw: '$dump_options_type'
 expecting: 'perltidyrc' or 'full'
 ------------------------------------------------------------------------
 EOM
@@ -801,7 +801,7 @@ EOM
             my ( $rargv_str, $msg ) = parse_args($argv);
             if ($msg) {
                 Die(<<EOM);
-Error parsing this string passed to to perltidy with 'argv': 
+Error parsing this string passed to to perltidy with 'argv':
 $msg
 EOM
             }
@@ -2890,7 +2890,7 @@ sub process_iteration_layer {
             my $stopping_on_error = $stop_now;
             if ($stop_now) {
                 $convergence_log_message = <<EOM;
-Stopping iterations because of severe errors.                       
+Stopping iterations because of severe errors.
 EOM
             }
 
@@ -2919,7 +2919,7 @@ EOM
                         # them when they happen.
                         $rstatus->{'blinking'} = 1;
                         $convergence_log_message = <<EOM;
-BLINKER. Output for iteration $iter same as for $saw_md5{$digest}. 
+BLINKER. Output for iteration $iter same as for $saw_md5{$digest}.
 EOM
                         $stopping_on_error ||= $convergence_log_message;
                         DEVEL_MODE
@@ -3239,7 +3239,7 @@ EOM
         $msg .= <<EOM;
 <$counti:$linei
 >$counto:$lineo
-$line_diff 
+$line_diff
 EOM
         return $msg;
     } ## end while
@@ -4522,7 +4522,7 @@ sub _process_command_line {
             if ($config_file) {
                 Warn(<<EOM);
  Conflict: a perltidyrc configuration file was specified both as this
- perltidy call parameter: $perltidyrc_stream 
+ perltidy call parameter: $perltidyrc_stream
  and with this -profile=$config_file.
  Using -profile=$config_file.
 EOM
@@ -4925,15 +4925,15 @@ EOM
 
         if ( $rOpts->{'opening-brace-on-new-line'} ) {
             Warn(<<EOM);
- Conflict: you specified both 'opening-brace-always-on-right' (-bar) and 
+ Conflict: you specified both 'opening-brace-always-on-right' (-bar) and
   'opening-brace-on-new-line' (-bl).  Ignoring -bl.
 EOM
             $rOpts->{'opening-brace-on-new-line'} = 0;
         }
         if ( $rOpts->{'brace-left-and-indent'} ) {
             Warn(<<EOM);
- Conflict: you specified both 'opening-brace-always-on-right' (-bar) and 
-  '--brace-left-and-indent' (-bli).  Ignoring -bli. 
+ Conflict: you specified both 'opening-brace-always-on-right' (-bar) and
+  '--brace-left-and-indent' (-bli).  Ignoring -bli.
 EOM
             $rOpts->{'brace-left-and-indent'} = 0;
         }
@@ -5177,7 +5177,7 @@ EOM
 
             if ($config_file) {
                 Die(<<"DIE");
-Please check your configuration file $config_file for circular-references. 
+Please check your configuration file $config_file for circular-references.
 To deactivate it, use -npro.
 DIE
             }
@@ -5198,7 +5198,7 @@ sub dump_short_names {
     print {*STDOUT} <<EOM;
 List of short names.  This list shows how all abbreviations are
 translated into other abbreviations and, eventually, into long names.
-New abbreviations may be defined in a .perltidyrc file.  
+New abbreviations may be defined in a .perltidyrc file.
 For a list of all long names, use perltidy --dump-long-names (-dln).
 --------------------------------------------------------------------------
 EOM
@@ -5856,7 +5856,7 @@ sub readable_options {
 
 sub show_version {
     print {*STDOUT} <<"EOM";
-This is perltidy, v$VERSION 
+This is perltidy, v$VERSION
 
 Copyright 2000-2024, Steve Hancock
 
@@ -5897,8 +5897,8 @@ I/O control
  -f      force perltidy to read a binary file
  -g      like -log but writes more detailed .LOG file, for debugging scripts
  -opt    write the set of options actually used to a .LOG file
- -npro   ignore .perltidyrc configuration command file 
- -pro=file   read configuration commands from file instead of .perltidyrc 
+ -npro   ignore .perltidyrc configuration command file
+ -pro=file   read configuration commands from file instead of .perltidyrc
  -st     send output to standard output, STDOUT
  -se     send all error output to standard error output, STDERR
  -v      display version number to standard output and quit
@@ -5922,11 +5922,11 @@ Whitespace Control
  -bbvtl=s  make -bbvt to apply to selected list of block types
  -pt=n   paren tightness (n=0, 1 or 2)
  -sbt=n  square bracket tightness (n=0, 1, or 2)
- -bvt=n  brace vertical tightness, 
+ -bvt=n  brace vertical tightness,
          n=(0=open, 1=close unless multiple steps on a line, 2=always close)
  -pvt=n  paren vertical tightness (see -bvt for n)
  -sbvt=n square bracket vertical tightness (see -bvt for n)
- -bvtc=n closing brace vertical tightness: 
+ -bvtc=n closing brace vertical tightness:
          n=(0=open, 1=sometimes close, 2=always close)
  -pvtc=n closing paren vertical tightness, see -bvtc for n.
  -sbvtc=n closing square bracket vertical tightness, see -bvtc for n.
@@ -5934,9 +5934,9 @@ Whitespace Control
  -lp     line up parentheses, brackets, and non-BLOCK braces
  -sfs    add space before semicolon in for( ; ; )
  -aws    allow perltidy to add whitespace (default)
- -dws    delete all old non-essential whitespace 
+ -dws    delete all old non-essential whitespace
  -icb    indent closing brace of a code block
- -cti=n  closing indentation of paren, square bracket, or non-block brace: 
+ -cti=n  closing indentation of paren, square bracket, or non-block brace:
          n=0 none, =1 align with opening, =2 one full indentation level
  -icp    equivalent to -cti=2
  -wls=s  want space left of tokens in string; i.e. -nwls='+ - * /'
@@ -5959,7 +5959,7 @@ Line Break Control
  -cbl=s  list of blocks to cuddled, default 'try-catch-finally'
  -dnl    delete old newlines (default)
  -l=n    maximum line length;  default n=80
- -bl     opening brace on new line 
+ -bl     opening brace on new line
  -sbl    opening sub brace on new line.  value of -bl is used if not given.
  -bli    opening brace on new line and indented
  -bar    opening brace always on right, even for long clauses
@@ -5980,7 +5980,7 @@ Following Old Breakpoints
  -bom    break at old method call breakpoints: ->
  -bok    break at old list keyword breakpoints such as map, sort (default)
  -bot    break at old conditional (ternary ?:) operator breakpoints (default)
- -boa    break at old attribute breakpoints 
+ -boa    break at old attribute breakpoints
  -cab=n  break at commas after a comma-arrow (=>):
          n=0 break at all commas after =>
          n=1 stable: break unless this breaks an existing one-line container
@@ -5997,7 +5997,7 @@ Comment controls
  -cscp=s change closing side comment prefix to be other than '## end'
  -cscl=s change closing side comment to apply to selected list of blocks
  -csci=n minimum number of lines needed to apply a -csc tag, default n=6
- -csct=n maximum number of columns of appended text, default n=20 
+ -csct=n maximum number of columns of appended text, default n=20
  -cscw   causes warning if old side comment is overwritten with -csc
 
  -sbc    use 'static block comments' identified by leading '##' (default)
@@ -6009,18 +6009,18 @@ Comment controls
 
 Delete selected text
  -dac    delete all comments AND pod
- -dbc    delete block comments     
- -dsc    delete side comments  
+ -dbc    delete block comments
+ -dsc    delete side comments
  -dp     delete pod
 
 Send selected text to a '.TEE' file
  -tac    tee all comments AND pod
- -tbc    tee block comments       
- -tsc    tee side comments       
- -tp     tee pod           
+ -tbc    tee block comments
+ -tsc    tee side comments
+ -tp     tee pod
 
 Outdenting
- -olq    outdent long quoted strings (default) 
+ -olq    outdent long quoted strings (default)
  -olc    outdent a long block comment line
  -ola    outdent statement labels
  -okw    outdent control keywords (redo, next, last, goto, return)
@@ -6060,7 +6060,7 @@ HTML
 
 A prefix of "n" negates short form toggle switches, and a prefix of "no"
 negates the long forms.  For example, -nasc means don't add missing
-semicolons.  
+semicolons.
 
 If you are unable to see this entire text, try "perltidy -h | more"
 For more detailed information, and additional options, try "man perltidy",
index 1053132a6dc5a7c1fd8ba93f4d29854fa0a721d1..56cbb473c10f698421aae05a0844021631f98bfb 100644 (file)
@@ -35,7 +35,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index a53340ec35db7e34bded3c19cb3ab810c8dd982b..12d1a1d8221a85f48ab65054d4d8e4268f5f4f3f 100644 (file)
@@ -40,7 +40,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 711c90c8f3a0678b5e8d998f35a676db55235df2..05585ff948f6b4fd3ddf45ebefc8f977490ea432 100644 (file)
@@ -93,7 +93,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 85358dba698adf2b53a041e080a87cc1a36e97d8..1354c0b1310aa2e73d90151825c5bc98893e0198 100644 (file)
@@ -69,7 +69,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
@@ -623,10 +623,10 @@ sub write_style_sheet_data {
     $fh->print(<<"EOM");
 /* default style sheet generated by perltidy */
 body {background: $bg_color; color: $text_color}
-pre { color: $text_color; 
+pre { color: $text_color;
       background: $pre_bg_color;
       font-family: courier;
-    } 
+    }
 
 EOM
 
@@ -1248,7 +1248,7 @@ ENDCSS
         $timestamp = "on $date";
     }
     $html_fh->print( <<"HTML_START");
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!-- Generated by perltidy $timestamp -->
 <html xmlns="http://www.w3.org/1999/xhtml">
index 0faa728dc06b985256ef208fc59cdda0a17b7427..64458ab44a41ba15672888949aa8f7948323a3a6 100644 (file)
@@ -32,7 +32,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 24a212446ffec010c55ffad082834c3e81055a55..7a223facd1105388bd8e4c80dd628a505ff4717c 100644 (file)
@@ -35,7 +35,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index bd839a3a922307c18fd591044dfd8a18df047cd2..7da983064797f0b5e25609b347c8e628815460aa 100644 (file)
@@ -49,7 +49,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 860e1f6bd389f8e40ade37ed7f521702aba3087e..956b1ab9afdb42ea27909f6692dbe7fbc411b20b 100644 (file)
@@ -29,7 +29,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 67d21ec74ca50d297da75597a426683345e83e91..2153e7fc211c86a7a5c61753426f8f468d5b3310 100644 (file)
@@ -283,7 +283,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
@@ -2485,7 +2485,7 @@ EOM
                 $self->interrupt_logfile();
                 $self->warning(<<EOM);
 $input_line_number: Trouble parsing at characters '$excess' after special variable '$var'.
-A space may be needed after '$var'. 
+A space may be needed after '$var'.
 EOM
                 $self->resume_logfile();
             }
@@ -9948,7 +9948,7 @@ EOM
            [0-9a-fA-F_]*)                # optional Additional exponent digits
 
            # or hex integer
-           |([xX][0-9a-fA-F_]+)        
+           |([xX][0-9a-fA-F_]+)
 
            # or octal fraction
            |([oO]?[0-7_]+          # string of octal digits
@@ -9960,13 +9960,13 @@ EOM
            |([oO]?[0-7_]+)         # string of octal digits
 
            # or a binary float
-           |([bB][01_]*            # 'b' with string of binary digits 
+           |([bB][01_]*            # 'b' with string of binary digits
            (\.([01][01_]*)?)?      # optional decimal and fraction
            [Pp][+-]?[01]           # Required exponent indicator, no underscore
            [01_]*)                 # additional exponent bits
 
            # or binary integer
-           |([bB][01_]+)           # 'b' with string of binary digits 
+           |([bB][01_]+)           # 'b' with string of binary digits
 
            )}gx
           )
@@ -10672,18 +10672,18 @@ sub dump_token_types {
     # adding NEW_TOKENS: add a comment here
     $fh->print(<<'END_OF_LIST');
 
-Here is a list of the token types currently used for lines of type 'CODE'.  
-For the following tokens, the "type" of a token is just the token itself.  
+Here is a list of the token types currently used for lines of type 'CODE'.
+For the following tokens, the "type" of a token is just the token itself.
 
 .. :: << >> ** && .. || // -> => += -= .= %= &= |= ^= *= <>
 ( ) <= >= == =~ !~ != ++ -- /= x=
-... **= <<= >>= &&= ||= //= <=> 
+... **= <<= >>= &&= ||= //= <=>
 , + - / * | % ! x ~ = \ ? : . < > ^ &
 
 The following additional token types are defined:
 
  type    meaning
-    b    blank (white space) 
+    b    blank (white space)
     {    indent: opening structural curly brace or square bracket or paren
          (code block, anonymous hash reference, or anonymous array reference)
     }    outdent: right structural curly brace or square bracket or paren
@@ -10692,7 +10692,7 @@ The following additional token types are defined:
     (    left non-structural paren (all but a list right of an =)
     )    right non-structural paren
     L    left non-structural curly brace (enclosing a key)
-    R    right non-structural curly brace 
+    R    right non-structural curly brace
     ;    terminal semicolon
     f    indicates a semicolon in a "for" statement
     h    here_doc operator <<
@@ -10718,9 +10718,9 @@ The following additional token types are defined:
     p    unary +
     m    unary -
     pp   pre-increment operator ++
-    mm   pre-decrement operator -- 
+    mm   pre-decrement operator --
     A    : used as attribute separator
-    
+
     Here are the '_line_type' codes used internally:
     SYSTEM         - system-specific code before hash-bang line
     CODE           - line of perl code (including comments)
index 547422f54c645ed76bbdb8cf9aa025454c345ff6..2d18300497eee3ded2066b71360fa004758fd8d2 100644 (file)
@@ -47,15 +47,17 @@ use constant SPACE        => q{ };
 #                 sub _flush_comment_lines
 # CODE SECTION 5: Code to process groups of code lines
 #                 sub _flush_group_lines
-# CODE SECTION 6: Output Step A
+# CODE SECTION 6: Pad Signed Number Columns
+#                 sub pad_signed_number_columns
+# CODE SECTION 7: Output Step A
 #                 sub valign_output_step_A
-# CODE SECTION 7: Output Step B
+# CODE SECTION 8: Output Step B
 #                 sub valign_output_step_B
-# CODE SECTION 8: Output Step C
+# CODE SECTION 9: Output Step C
 #                 sub valign_output_step_C
-# CODE SECTION 9: Output Step D
+# CODE SECTION 10: Output Step D
 #                 sub valign_output_step_D
-# CODE SECTION 10: Summary
+# CODE SECTION 11: Summary
 #                 sub report_anything_unusual
 
 ##################################################################
@@ -4804,9 +4806,9 @@ sub align_side_comments {
     return;
 } ## end sub align_side_comments
 
-###############################
-# CODE SECTION 6: Output Step A
-###############################
+###########################################
+# CODE SECTION 6: Pad Signed Number Columns
+###########################################
 
 use constant DEBUG_VSN => 0;
 
@@ -4968,7 +4970,7 @@ sub pad_signed_field {
     # in a column of numbers.
     # Given:
     #  $rstr     = ref to string
-    #  $rstr_len = ref to length of string (could include wide chars)
+    #  $rstr_len = ref to display width of string (could include wide chars)
     #  $pos_start_number = string position of the leading digit
     #  $char_end_part1 = character at $pos_start_number - 1
     # Task: update $rstr and $rstr_len with a single space
@@ -4982,7 +4984,7 @@ sub pad_signed_field {
         my $len = length($str);
         if ( $pos_start_number >= $len ) {
             DEVEL_MODE && Fault(<<EOM);
-Expection position '$pos_start_number' < length $len of string '$str' 
+Expection position '$pos_start_number' < length $len of string '$str'
 EOM
             return;
         }
@@ -5033,6 +5035,12 @@ sub split_field {
     #   $char_end_part1 = the character preceding $pos_start_number
     #   $ch_opening     = the preceding opening container character, if any
 
+    # We have to find where the possible number starts in this field.
+    # This is a tricky operation because we are flying a little blind here,
+    # without the help of the original tokenization. The main danger would
+    # be to fall into some kind of quoted text which tricks the logic.
+    # The safe thing to do is return @fail if anything does not look right.
+
     my $pos_start_number = 0;
     my $char_end_part1   = EMPTY_STRING;
     my $ch_opening       = EMPTY_STRING;
@@ -5522,6 +5530,10 @@ sub pad_signed_number_columns {
     return;
 } ## end sub pad_signed_number_columns
 
+###############################
+# CODE SECTION 7: Output Step A
+###############################
+
 sub valign_output_step_A {
 
     #------------------------------------------------------------
@@ -5697,7 +5709,7 @@ sub get_output_line_number {
 } ## end sub get_output_line_number
 
 ###############################
-# CODE SECTION 7: Output Step B
+# CODE SECTION 8: Output Step B
 ###############################
 
 {    ## closure for sub valign_output_step_B
@@ -6218,7 +6230,7 @@ sub get_output_line_number {
 }
 
 ###############################
-# CODE SECTION 8: Output Step C
+# CODE SECTION 9: Output Step C
 ###############################
 
 {    ## closure for sub valign_output_step_C
@@ -6352,7 +6364,7 @@ sub get_output_line_number {
 }
 
 ###############################
-# CODE SECTION 9: Output Step D
+# CODE SECTION 10: Output Step D
 ###############################
 
 sub add_leading_tabs {
@@ -6473,7 +6485,7 @@ sub valign_output_step_D {
 } ## end sub valign_output_step_D
 
 ##########################
-# CODE SECTION 10: Summary
+# CODE SECTION 11: Summary
 ##########################
 
 sub report_anything_unusual {
index a217ed2b074b94689abb923b7ab3e9e7bb8ac4c8..81ce1e63b31af5ec58103ffff08a11da68c00f3e 100644 (file)
@@ -30,7 +30,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 0d236b2454634c23426bb863a634ff4ee46e69ac..f8621d09ab28fcb95a49dedf3691f37ffd668da2 100644 (file)
@@ -26,7 +26,7 @@ sub AUTOLOAD {
 ======================================================================
 Error detected in package '$my_package', version $VERSION
 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
-Called from package: '$pkg'  
+Called from package: '$pkg'
 Called from File '$fname'  at line '$lno'
 This error is probably due to a recent programming change
 ======================================================================
index 0de6c0d4f788ca6e24960a264e9dda9c8b4065ea..6630002f67ebfe17b12489a1ca17b0e832a542c1 100644 (file)
@@ -25,7 +25,7 @@
 - review/update the CHANGES.md file
 - be sure RPerl still works:
   - build and install the latest Perl::Tidy on development machine
-  - install the latest RPerl [currently RPerl-5.002000]
+  - install the latest RPerl [currently RPerl-7.000000]
   - perl Makefile.PL, make, make test - should complete ok
 - Review code, especially any ## commented out sections and "FIXME's"
 - run perlver on all modules to check minimum version; should be 5.8.0
index addfc2a68f4c120a0074334b97e43f8f3413bb00..74b6d209724519055e1a5953ffcb8ccf3ef49449 100644 (file)
@@ -458,7 +458,7 @@ after them.
 The B<-vt=2> style does not limit itself to a single indentation step
 per line.
 
-Note that in the above example the function 'do_sumething_about_it'
+Note that in the above example the function 'do_something_about_it'
 started on a new line. This is because it follows an opening code
 block brace and is governed by the flag previously set in
 L<Block Brace Vertical Tightness>.
index d856a1f3000f252ffb5b21238ef9a282c730a881..9de2e88a6b42f4db90a0e55879c3d1e905dc6612 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!-- Generated by perltidy  -->
 <html xmlns="http://www.w3.org/1999/xhtml">
@@ -8,10 +8,10 @@
 <!--
 /* default style sheet generated by perltidy */
 body {background: #FFFFFF; color: #000000}
-pre { color: #000000; 
+pre { color: #000000;
       background: #FFFFFF;
       font-family: courier;
-    } 
+    }
 
 .c  { color: #228B22;} /* comment */
 .cm { color: #000000;} /* comma */
index 427f2bb9c0a063baa501138243cf42bd3c0e671d..8231327b28c11fb170726b3ec76a57bfc7386d4d 100644 (file)
@@ -379,7 +379,7 @@ else                    { $editlblk = "off"; $editlblkchecked = "unchecked" }
             source => "html1",
             params => "html",
             expect => <<'#14...........',
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!-- Generated by perltidy  -->
 <html xmlns="http://www.w3.org/1999/xhtml">
@@ -389,10 +389,10 @@ else                    { $editlblk = "off"; $editlblkchecked = "unchecked" }
 <!--
 /* default style sheet generated by perltidy */
 body {background: #FFFFFF; color: #000000}
-pre { color: #000000; 
+pre { color: #000000;
       background: #FFFFFF;
       font-family: courier;
-    } 
+    }
 
 .c  { color: #228B22;} /* comment */
 .cm { color: #000000;} /* comma */