]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix spelling errors
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 27 May 2022 14:42:29 +0000 (07:42 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 27 May 2022 14:42:29 +0000 (07:42 -0700)
lib/Perl/Tidy.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm

index 94f7a0a76368813b5f0bd50682f86f25a795de94..d6b31ad4e0d852a924dffe9e2bb4f26a4196ede5 100644 (file)
@@ -3669,7 +3669,7 @@ EOM
             # The following warning could be added but would annoy a lot of
             # users who have a perltidyrc with both -t and -et=n.  So instead
             # there is a note in the manual that -et overrides -t.
-            ##Warn("-tabs and -et=n confict; ignoring -tabs\n");
+            ##Warn("-tabs and -et=n conflict; ignoring -tabs\n");
             $rOpts->{'tabs'} = 0;
         }
     }
@@ -3925,7 +3925,7 @@ sub check_vms_filename {
                 \.-?\d*$       # match . version number
               /$1/x;
 
-    # normalise filename, if there are no unescaped dots then append one
+    # normalize filename, if there are no unescaped dots then append one
     $base .= '.' unless $base =~ /(?:^|[^^])\./;
 
     # if we don't already have an extension then we just append the extension
index e54a2ddcf820be4968d6737487bc0896461c2f1e..11adf2a6e3bc6ee2df813371f67508773aa7ff12 100644 (file)
@@ -23,7 +23,7 @@
 #                 sub set_forced_breakpoint
 # CODE SECTION 9: Process batches of code
 #                 sub grind_batch_of_CODE
-# CODE SECTION 10: Code to break long statments
+# CODE SECTION 10: Code to break long statements
 #                  sub break_long_lines
 # CODE SECTION 11: Code to break long lists
 #                  sub break_lists
@@ -267,7 +267,7 @@ my (
     # Initialized in sub prepare_cuddled_block_types
     $rcuddled_block_types,
 
-    # Initialized and configured in check_optioms
+    # Initialized and configured in check_options
     %outdent_keyword,
     %keyword_paren_inner_tightness,
 
@@ -588,7 +588,7 @@ BEGIN {
 
     # Map related block names into a common name to allow vertical alignment
     # used by sub make_alignment_patterns. Note: this is normally unchanged,
-    # but it contains 'grep' and can be re-initized in
+    # but it contains 'grep' and can be re-initialized in
     # sub initialize_grep_and_friends in a testing mode.
     %block_type_map = (
         'unless'  => 'if',
@@ -1579,7 +1579,7 @@ EOM
         if ( defined($opt) && $opt > 0 && $break_before_container_types{$tok} )
         {
 
-            # (1) -lp is not compatable with opt=2, silently set to opt=0
+            # (1) -lp is not compatible with opt=2, silently set to opt=0
             # (2) opt=0 and 2 give same result if -i=-ci; but opt=0 is faster
             if ( $opt == 2 ) {
                 if (   $rOpts->{'line-up-parentheses'}
@@ -3293,7 +3293,7 @@ EOM
         #       { ... }
 
         # Also, I prefer not to put a ? and # together because ? used to be
-        # a pattern delmiter and spacing was used if guessing was needed.
+        # a pattern delimiter and spacing was used if guessing was needed.
 
         if ( $typer eq '#' ) {
 
@@ -3673,7 +3673,7 @@ EOM
         # real tokens
         $right_bond_strength{'b'} = NO_BREAK;
 
-        # try not to break on exponentation
+        # try not to break on exponentiation
         @q                       = qw# ** .. ... <=> #;
         @left_bond_strength{@q}  = (STRONG) x scalar(@q);
         @right_bond_strength{@q} = (STRONG) x scalar(@q);
@@ -4697,7 +4697,7 @@ sub dump_cuddled_block_list {
     #        },
     #    };
 
-    # SIMPLFIED METHOD: the simplified method uses a wildcard for
+    # SIMPLIFIED METHOD: the simplified method uses a wildcard for
     # the starting block type and puts all cuddled blocks together:
     #    my $rcuddled_block_types = {
     #        '*' => {
@@ -5643,7 +5643,7 @@ sub set_CODE_type {
     # 'IO'  = Indent Only - line goes out unchanged except for indentation
     # 'NIN' = No Internal Newlines - line does not get broken
     # 'VER' = VERSION statement
-    # ''    = ordinary line of code with no restructions
+    # ''    = ordinary line of code with no restrictions
 
     my $ix_line = -1;
     foreach my $line_of_tokens ( @{$rlines} ) {
@@ -6630,7 +6630,7 @@ sub respace_tokens {
         #        '$var = s/xxx/yyy/;'
         # in case it should have been '$var =~ s/xxx/yyy/;'
 
-        # Start by looking for a token begining with one of: s y m / tr
+        # Start by looking for a token beginning with one of: s y m / tr
         return
           unless ( $is_s_y_m_slash{ substr( $token, 0, 1 ) }
             || substr( $token, 0, 2 ) eq 'tr' );
@@ -6713,7 +6713,7 @@ sub respace_tokens {
         # An error here means that sub write_line() did not correctly
         # package the tokenized lines as it received them.  If we
         # get a fault here it has not output a continuous sequence
-        # of K values.  Or a line of CODE may have been mismarked as
+        # of K values.  Or a line of CODE may have been mis-marked as
         # something else.  There is no good way to continue after such an
         # error.
         # FIXME: Calling Fault will produce zero output; it would be best to
@@ -7078,7 +7078,7 @@ sub respace_tokens {
 
                 # Remove unnecessary semicolons, but not after bare
                 # blocks, where it could be unsafe if the brace is
-                # mistokenized.
+                # mis-tokenized.
                 if (
                     $rOpts->{'delete-semicolons'}
                     && (
@@ -7225,12 +7225,12 @@ EOM
 
             # We will define a list to be a container with one or more commas
             # and no semicolons. Note that we have included the semicolons
-            # in a 'for' container in the simicolon count to keep c-style for
+            # in a 'for' container in the semicolon count to keep c-style for
             # statements from being formatted as lists.
             if ( ( $comma_count || $fat_comma_count ) && !$semicolon_count ) {
                 $is_list = 1;
 
-                # We need to do one more check for a perenthesized list:
+                # We need to do one more check for a parenthesized list:
                 # At an opening paren following certain tokens, such as 'if',
                 # we do not want to format the contents as a list.
                 if ( $rLL_new->[$K_opening]->[_TOKEN_] eq '(' ) {
@@ -8002,7 +8002,7 @@ sub weld_containers {
     # flags.
     my ($self) = @_;
 
-    # This count is used to eliminate needless calls for weld checks elsewere
+    # This count is used to eliminate needless calls for weld checks elsewhere
     $total_weld_count = 0;
 
     return if ( $rOpts->{'indent-only'} );
@@ -9097,7 +9097,7 @@ EOM
                 # more complicated method has been developed.
 
                 # We are trying to avoid creating bad two-line welds when we are
-                # working on long, previously unwelded input text, such as
+                # working on long, previously un-welded input text, such as
 
                 # INPUT (example of a long input line weld candidate):
                 ## $mutation->transpos( $self->RNA->position($mutation->label, $atg_label));
@@ -10374,9 +10374,9 @@ sub break_before_list_opening_containers {
         }
 
         # The last check we can make is to see if this container could fit on a
-        # single line.  Use the least possble indentation in the estmate (ci=0),
+        # single line.  Use the least possible indentation estimate, ci=0,
         # so we are not subtracting $ci * $rOpts_continuation_indentation from
-        # tablulated $maximum_text_length  value.
+        # tabulated $maximum_text_length  value.
         my $maximum_text_length = $maximum_text_length_at_level[$level];
         my $K_closing           = $K_closing_container->{$seqno};
         my $length = $self->cumulative_length_before_K($K_closing) -
@@ -10496,7 +10496,7 @@ sub extended_ci {
     # The following variable can be used to allow a little extra space to
     # avoid blinkers.  A value $len_tol = 20 fixed the following
     # fixes cases: b1025 b1026 b1027 b1028 b1029 b1030 but NOT b1031.
-    # It turned out that the real problem was misparsing a list brace as
+    # It turned out that the real problem was mis-parsing a list brace as
     # a code block in a 'use' statement when the line length was extremely
     # small.  A value of 0 works now, but a slightly larger value can
     # be used to minimize the chance of a blinker.
@@ -10886,7 +10886,7 @@ use constant DEBUG_COLLAPSED_LENGTHS => 0;
 
 # Minimum space reserved for contents of a code block.  A value of 40 has given
 # reasonable results.  With a large line length, say -l=120, this will not
-# normally be noticable but it will prevent making a mess in some edge cases.
+# normally be noticeable but it will prevent making a mess in some edge cases.
 use constant MIN_BLOCK_LEN => 40;
 
 my %is_handle_type;
@@ -10922,7 +10922,7 @@ sub collapsed_lengths {
     # limit.
 
     # The basic idea is that at each node in the tree we imagine that we have a
-    # fork with a handle and collapsable prongs:
+    # fork with a handle and collapsible prongs:
     #
     #                            |------------
     #                            |--------
@@ -11067,7 +11067,7 @@ sub collapsed_lengths {
                 && $K_terminal > $K_first );
         }
 
-        # Use length to terminal comma if interrupded list rule applies
+        # Use length to terminal comma if interrupted list rule applies
         if ( @stack && $stack[-1]->[_interrupted_list_rule_] ) {
             my $K_c = $stack[-1]->[_K_c_];
             if (
@@ -11348,7 +11348,7 @@ EOM
                 $len = $token_length;
             }
 
-            # include everthing to end of line after a here target
+            # include everything to end of line after a here target
             elsif ( $type eq 'h' ) {
                 $len = $rLL->[$K_last]->[_CUMULATIVE_LENGTH_] -
                   $rLL->[ $KK - 1 ]->[_CUMULATIVE_LENGTH_];
@@ -11810,7 +11810,7 @@ EOM
     # Definitions:
     # ($ibeg, $iend) = starting and ending line indexes of this entire group
     #         $count = total number of keywords seen in this entire group
-    #     $level_beg = indententation level of this group
+    #     $level_beg = indentation level of this group
     #         @group = [ $i, $token, $count ] =list of all keywords & blanks
     #      @subgroup =  $j, index of group where token changes
     #       @iblanks = line indexes of blank lines in input stream in this group
@@ -12211,7 +12211,7 @@ EOM
         elsif ( $ibeg >= 0 ) {
 
             # - bail out on a large level change; we may have walked into a
-            #   data structure or anoymous sub code.
+            #   data structure or anonymous sub code.
             if ( $level > $level_beg + 1 || $level < $level_beg ) {
                 $end_group->(1);
                 next;
@@ -12667,7 +12667,7 @@ EOM
 
         if ( $max_index_to_go < 0 ) {
 
-            # This is harmless but should be elimintated in development
+            # This is harmless but should be eliminated in development
             if (DEVEL_MODE) {
                 Fault("End batch called with nothing to do; please fix\n");
             }
@@ -12751,7 +12751,7 @@ EOM
 
         # So this routine is just making an initial set of required line
         # breaks, basically regardless of the maximum requested line length.
-        # The subsequent stage of formating make additional line breaks
+        # The subsequent stage of formatting make additional line breaks
         # appropriate for lists and logical structures, and to keep line
         # lengths below the requested maximum line length.
 
@@ -12902,7 +12902,7 @@ EOM
 
         # Compare input/output indentation except for:
         #  - hanging side comments
-        #  - continuation lines (habe unknown amount of initial blank space)
+        #  - continuation lines (have unknown amount of initial blank space)
         #  - and lines which are quotes (because they may have been outdented)
         my $guessed_indentation_level =
           $line_of_tokens->{_guessed_indentation_level};
@@ -13439,7 +13439,7 @@ EOM
                     # keep going
                 }
 
-                # if no more tokens, postpone decision until re-entring
+                # if no more tokens, postpone decision until re-entering
                 elsif ( ( $next_nonblank_token_type eq 'b' )
                     && $rOpts_add_newlines )
                 {
@@ -13808,7 +13808,7 @@ sub starting_one_line_block {
         # For signatures and extended syntax ...
         # If this brace follows a parenthesized list, we should look back to
         # find the keyword before the opening paren because otherwise we might
-        # form a one line block which stays intack, and cause the parenthesized
+        # form a one line block which stays intact, and cause the parenthesized
         # expression to break open. That looks bad.
         if ( $tokens_to_go[$i_start] eq ')' ) {
 
@@ -14483,7 +14483,7 @@ EOM
     # - 'grind_batch_of_CODE' determines which tokens will form the OUTPUT
     # lines.
 
-    # So sub 'process_line_of_CODE' builds up the longest possible continouus
+    # So sub 'process_line_of_CODE' builds up the longest possible continuous
     # sequences of tokens, regardless of line length, and then
     # grind_batch_of_CODE breaks these sequences back down into the new output
     # lines.
@@ -14506,7 +14506,7 @@ EOM
         }
         my $Klimit = $self->[_Klimit_];
 
-        # The local batch tokens must be a continous part of the global token
+        # The local batch tokens must be a continuous part of the global token
         # array.
         my $KK;
         foreach my $ii ( 0 .. $max_index_to_go ) {
@@ -15888,7 +15888,7 @@ sub break_equals {
         # suggested by issue c118, which pushed about 5.e5 lines through here
         # and caused an excessive run time.
 
-        # Three lines of defence have been put in place to prevent excessive
+        # Three lines of defense have been put in place to prevent excessive
         # run times:
         #  1. do nothing if formatting under stress (c118 was under stress)
         #  2. break into small sub-sections to decrease the maximum n-squared.
@@ -18999,7 +18999,7 @@ EOM
 
                 elsif ( $is_opening_token{$token} ) {
 
-                    # do requeste -lp breaks at the OPENING token for BROKEN
+                    # do requested -lp breaks at the OPENING token for BROKEN
                     # blocks.  NOTE: this can be done for both -lp and -xlp,
                     # but only -xlp can really take advantage of this.  So this
                     # is currently restricted to -xlp to avoid excess changes to
@@ -21554,7 +21554,7 @@ EOM
                     # or if this is not a sequenced item
                     || !$last_nonblank_seqno
 
-                    # or this continer is excluded by user rules
+                    # or this container is excluded by user rules
                     # or contains here-docs or multiline qw text
                     || defined($last_nonblank_seqno)
                     && $ris_excluded_lp_container->{$last_nonblank_seqno}
@@ -22562,7 +22562,7 @@ EOM
         # to pass nesting depths to the vertical aligner. They remain invariant
         # under all formatting operations.  Previously, level values were sent
         # to the aligner.  But they can be altered in welding and other
-        # opeartions, and this can lead to alignement errors.
+        # operations, and this can lead to alignment errors.
         my $nesting_depth_beg = $nesting_depth_to_go[$ibeg];
         my $nesting_depth_end = $nesting_depth_to_go[$iend];
 
@@ -22903,7 +22903,7 @@ EOM
                     $i_good_paren++;
                 }
 
-                # Initializtion for 'elsif' patch: remember the paren range of
+                # Initialization for 'elsif' patch: remember the paren range of
                 # an elsif, and do not make alignments within them because this
                 # can cause loss of padding and overall brace alignment in the
                 # vertical aligner.
@@ -24990,7 +24990,7 @@ sub make_paren_name {
 
             # YVES patch 1 of 2:
             # Undo ci of line with leading closing eval brace,
-            # but not beyond the indention of the line with
+            # but not beyond the indentation of the line with
             # the opening brace.
             if (
                 $block_type_beg eq 'eval'
@@ -25029,7 +25029,7 @@ sub make_paren_name {
                 my $tok = $token_beg;
                 my $cti = $closing_token_indentation{$tok};
 
-                # Fix the value of 'cti' for an isloated non-welded closing qw
+                # Fix the value of 'cti' for an isolated non-welded closing qw
                 # delimiter.
                 if ( $seqno_qw_closing && $ibeg_weld_fix == $ibeg ) {
 
@@ -25258,7 +25258,7 @@ sub make_paren_name {
             }
         }
 
-        # Full indentaion of closing tokens (-icb and -icp or -cti=2)
+        # Full indentation of closing tokens (-icb and -icp or -cti=2)
         else {
 
             # handle -icb (indented closing code block braces)
@@ -25327,7 +25327,7 @@ sub make_paren_name {
 
             # Patch to make a line which is the end of a qw quote work with the
             # -lp option.  Make $token_beg look like a closing token as some
-            # type even if it is not.  This veriable will become
+            # type even if it is not.  This variable will become
             # $last_leading_token at the end of this loop.  Then, if the -lp
             # style is selected, and the next line is also a
             # closing token, it will not get more indentation than this line.
index 80792ee348f62706be8d5193ffe46d68979873d1..b4827d3da26de535ce8034cfb90ff3386c19cc40 100644 (file)
@@ -1318,7 +1318,7 @@ sub markup_tokens {
             $type  = 'M';
 
             # but don't include sub declarations in the toc;
-            # these wlll have leading token types 'i;'
+            # these will have leading token types 'i;'
             my $signature = join EMPTY_STRING, @{$rtoken_type};
             unless ( $signature =~ /^i;/ ) {
                 my $subname = $token;
index 566d4e920ff7117853d6a284acf5472062d7d24f..91cc25c5b2deb8151ab84268d2d613159897040e 100644 (file)
@@ -594,7 +594,7 @@ sub report_tokenization_errors {
     my ($self) = @_;
 
     # Report any tokenization errors and return a flag '$severe_error'.
-    # Set $severe_error = 1 if the tokenizations errors are so severe that
+    # Set $severe_error = 1 if the tokenization errors are so severe that
     # the formatter should not attempt to format the file. Instead, it will
     # just output the file verbatim.
 
@@ -627,7 +627,7 @@ EOM
     check_final_nesting_depths();
 
     # Likewise, large numbers of brace errors usually indicate non-perl
-    # scirpts, so set the severe error flag at a low number.  This is similar
+    # scripts, so set the severe error flag at a low number.  This is similar
     # to the level check, but different because braces may balance but be
     # incorrectly interlaced.
     if ( $tokenizer_self->[_true_brace_error_count_] > 2 ) {
@@ -3947,7 +3947,7 @@ EOM
         # mistaking {s} in the following for a quoted bare word:
         #     for(@[){s}bla}BLA}
         # Also treat q in something like var{-q} as a bare word, not
-        # a qoute operator
+        # a quote operator
         elsif (
             $next_nonblank_token eq '}'
             && (
@@ -3960,7 +3960,7 @@ EOM
             $type = 'w';
         }
 
-        # Scan a bare word following a -> as an identifir; it could
+        # Scan a bare word following a -> as an identifier; it could
         # have a long package name.  Fixes c037, c041.
         elsif ( $last_nonblank_token eq '->' ) {
             scan_bare_identifier();
@@ -5756,7 +5756,7 @@ sub operator_expected {
                 $op_expected = OPERATOR;
             }
 
-            # Patch to allow a ? following 'split' to be a depricated pattern
+            # Patch to allow a ? following 'split' to be a deprecated pattern
             # delimiter.  This patch is coordinated with the omission of split
             # from the list
             # %is_keyword_rejecting_question_as_pattern_delimiter. This patch
@@ -5876,7 +5876,7 @@ sub operator_expected {
 
         # Exception to weird parsing rules for 'x(' ... see case b1205:
         # In something like 'print $vv x(...' the x is an operator;
-        # Likewise in 'print $vv x$ww' the x is an operatory (case b1207)
+        # Likewise in 'print $vv x$ww' the x is an operator (case b1207)
         # otherwise x follows the weird parsing rules.
         elsif ( $tok eq 'x' && $next_type =~ /^[\(\$\@\%]$/ ) {
             $op_expected = OPERATOR;
@@ -6056,7 +6056,7 @@ sub code_block_type {
         # snippet is an anonymous hash ref and not a code block!
         #   print 'hi' if { x => 1, }->{x};
         # We can identify this situation because the last nonblank type
-        # will be a keyword (instead of a closing peren)
+        # will be a keyword (instead of a closing paren)
         if (
             $last_nonblank_type eq 'k'
             && (   $last_nonblank_token eq 'if'
@@ -6115,7 +6115,7 @@ sub code_block_type {
         if ( $paren_type && $is_sort_map_grep{$paren_type} ) {
 
             # We will mark this as a code block but use type 't' instead
-            # of the name of the contining function.  This will allow for
+            # of the name of the containing function.  This will allow for
             # correct parsing but will usually produce better formatting.
             # Braces with block type 't' are not broken open automatically
             # in the formatter as are other code block types, and this usually
@@ -6240,7 +6240,7 @@ sub decide_if_code_block {
             # Patched for RT #95708
             if (
 
-                # it is a comma which is not a pattern delimeter except for qw
+                # it is a comma which is not a pattern delimiter except for qw
                 (
                     $pre_types[$j] eq ','
                     ## !~ /^(s|m|y|tr|qr|q|qq|qx)$/
@@ -10303,7 +10303,7 @@ BEGIN {
 
     # These are keywords for which an arg may optionally be omitted.  They are
     # currently only used to disambiguate a ? used as a ternary from one used
-    # as a (depricated) pattern delimiter.  In the future, they might be used
+    # as a (deprecated) pattern delimiter.  In the future, they might be used
     # to give a warning about ambiguous syntax before a /.
     # Note: split has been omitted (see not below).
     my @keywords_taking_optional_arg = qw(
@@ -10378,7 +10378,7 @@ BEGIN {
     @is_keyword_taking_optional_arg{@keywords_taking_optional_arg} =
       (1) x scalar(@keywords_taking_optional_arg);
 
-    # This list is used to decide if a pattern delmited by question marks,
+    # This list is used to decide if a pattern delimited by question marks,
     # ?pattern?, can follow one of these keywords.  Note that from perl 5.22
     # on, a ?pattern? is not recognized, so we can be much more strict than
     # with a /pattern/. Note that 'split' is not in this list. In current
index a624b5dc8330c109441db8f1989ff5c8d8dab9b7..29a8530bb5e8b666aa75dd355d7ba6a221b91c26 100644 (file)
@@ -22,7 +22,7 @@ use constant SPACE        => q{ };
 #
 # The sub valign_input collects lines into groups.  When a group reaches
 # the maximum possible size it is processed for alignment and output.
-# The maximum group size is reached whenerver there is a change in indentation
+# The maximum group size is reached whenever there is a change in indentation
 # level, a blank line, a block comment, or an external flush call.  The calling
 # routine may also force a break in alignment at any time.
 #
@@ -319,7 +319,7 @@ sub flush {
     # flush() is the external call to completely empty the pipeline.
     my ($self) = @_;
 
-    # push things out the pipline...
+    # push things out the pipeline...
 
     # push out any current group lines
     $self->_flush_group_lines();
@@ -1803,7 +1803,7 @@ EOM
 
             # If this line has no matching tokens, then flush out the lines
             # BEFORE this line unless both it and the previous line have side
-            # comments.  This prevents this line from pushing side coments out
+            # comments.  This prevents this line from pushing side comments out
             # to the right.
             elsif ( $new_line->get_jmax() == 1 ) {
 
@@ -1895,7 +1895,7 @@ sub two_line_pad {
     #  two isolated (list) lines
     #  imax_min = number of common alignment tokens
     # Return:
-    #  $pad_max = maximum suggested pad distnce
+    #  $pad_max = maximum suggested pad distance
     #           = 0 if alignment not recommended
     # Note that this is only for two lines which do not have alignment tokens
     # in common with any other lines.  It is intended for lists, but it might
@@ -2259,7 +2259,7 @@ sub sweep_left_to_right {
                 #  my $unknown6        = pack( "VV",  0x00, 0x1000 );
 
                 # On the other hand, it is okay to keep matching at the same
-                # level such as in a simple list of commas and/or fat arrors.
+                # level such as in a simple list of commas and/or fat commas.
 
                 my $is_blocked = defined( $blocking_level[$ng] )
                   && $lev > $blocking_level[$ng];
@@ -2268,7 +2268,7 @@ sub sweep_left_to_right {
                 # Do not let one or two lines with a **different number of
                 # alignments** open up a big gap in a large block.  For
                 # example, we will prevent something like this, where the first
-                # line prys open the rest:
+                # line pries open the rest:
 
             #  $worksheet->write( "B7", "http://www.perl.com", undef, $format );
             #  $worksheet->write( "C7", "",                    $format );
@@ -3622,7 +3622,7 @@ sub prune_alignment_tree {
     # );
 
     # In the above example, all lines have three commas at the lowest depth
-    # (zero), so if there were no other alignements, these lines would all
+    # (zero), so if there were no other alignments, these lines would all
     # align considering only the zero depth alignment token.  But some lines
     # have additional comma alignments at the next depth, so we need to decide
     # if we should drop those to keep the top level alignments, or keep those
@@ -3840,7 +3840,7 @@ sub prune_alignment_tree {
     # construction.  The children nodes have links up to the parent node which
     # created them.  Now make links in the opposite direction, so the parents
     # can find the children.  We store the range of children nodes ($nc_beg,
-    # $nc_end) of each parent with two additional indexes in the orignal array.
+    # $nc_end) of each parent with two additional indexes in the original array.
     # These will be undef if no children.
     foreach my $depth ( reverse( 1 .. $MAX_DEPTH ) ) {
         next unless defined( $match_tree[$depth] );
@@ -4514,7 +4514,7 @@ sub align_side_comments {
     # and fake side comments.  This has the consequence that the lengths of
     # long lines without real side comments can cause 'push' all side comments
     # to the right.  This seems unusual, but testing with and without this
-    # feature shows that it is usually better this way.  Othewise, side
+    # feature shows that it is usually better this way.  Otherwise, side
     # comments can be hidden between long lines without side comments and
     # thus be harder to read.