$m
) );
+The welded closing tokens are by default on a separate line but this can be
+modified with the B<-vtc=n> flag (described in the next section). For example,
+the same example adding B<-vtc-2> is
+
+ # perltidy -wn -vtc=2
+ $x->badd( bmul(
+ $class->new( abs(
+ $sx * int( $xr->numify() ) & $sy * int( $yr->numify() ) ) ),
+ $m ) );
+
This format option is quite general but there are some limitations.
One limitation is that any line length limit still applies and can cause long
The following list shows all short parameter names which allow a prefix
'n' to produce the negated form:
- D anl asc aws b bbb bbc bbs bl bli boc bok bol bot ce
- csc dac dbc dcsc ddf dln dnl dop dp dpro dsc dsm dsn dtt dwls
- dwrs dws f fll frm fs hsc html ibc icb icp iob isbc lal log
- lp lsl ohbr okw ola oll opr opt osbr otr ple pod pvl q
- sbc sbl schb scp scsb sct se sfp sfs skp sob sohb sop sosb sot
- ssc st sts syn t tac tbc toc tp tqw tsc w x bar kis
+ D anl asbl asc ast asu aws b baa baao
+ bar bbao bbb bbc bbs bl bli boa boc bok
+ bol bom bos bot cblx ce conv csc cscb cscw
+ dac dbc dcbl dcsc ddf dln dnl dop dp dpro
+ dsc dsm dsn dtt dwls dwrs dws f fll frm
+ fs fso gcs hbc hbcm hbco hbh hbhh hbi hbj
+ hbk hbm hbn hbp hbpd hbpu hbq hbs hbsc hbv
+ hbw hent hic hicm hico hih hihh hii hij hik
+ him hin hip hipd hipu hiq his hisc hiv hiw
+ hsc html ibc icb icp iob isbc iscl kgb kgbd
+ kgbi kis lal log lop lp lsl mem nib ohbr
+ okw ola olc oll olq opr opt osbc osbr otr
+ ple pod pvl q sac sbc sbl scbb schb scp
+ scsb sct se sfp sfs skp sob sobb sohb sop
+ sosb sot ssc st sts t tac tbc toc tp
+ tqw trp ts tsc tso vmll w wn x xci
+ xs
Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be
used.
$m
) );</code></pre>
+<p>The welded closing tokens are by default on a separate line but this can be modified with the <b>-vtc=n</b> flag (described in the next section). For example, the same example adding <b>-vtc-2</b> is</p>
+
+<pre><code> # perltidy -wn -vtc=2
+ $x->badd( bmul(
+ $class->new( abs(
+ $sx * int( $xr->numify() ) & $sy * int( $yr->numify() ) ) ),
+ $m ) );</code></pre>
+
<p>This format option is quite general but there are some limitations.</p>
<p>One limitation is that any line length limit still applies and can cause long welded sections to be broken into multiple lines.</p>
<p>The following list shows all short parameter names which allow a prefix 'n' to produce the negated form:</p>
-<pre><code> D anl asc aws b bbb bbc bbs bl bli boc bok bol bot ce
- csc dac dbc dcsc ddf dln dnl dop dp dpro dsc dsm dsn dtt dwls
- dwrs dws f fll frm fs hsc html ibc icb icp iob isbc lal log
- lp lsl ohbr okw ola oll opr opt osbr otr ple pod pvl q
- sbc sbl schb scp scsb sct se sfp sfs skp sob sohb sop sosb sot
- ssc st sts syn t tac tbc toc tp tqw tsc w x bar kis</code></pre>
+<pre><code> D anl asbl asc ast asu aws b baa baao
+ bar bbao bbb bbc bbs bl bli boa boc bok
+ bol bom bos bot cblx ce conv csc cscb cscw
+ dac dbc dcbl dcsc ddf dln dnl dop dp dpro
+ dsc dsm dsn dtt dwls dwrs dws f fll frm
+ fs fso gcs hbc hbcm hbco hbh hbhh hbi hbj
+ hbk hbm hbn hbp hbpd hbpu hbq hbs hbsc hbv
+ hbw hent hic hicm hico hih hihh hii hij hik
+ him hin hip hipd hipu hiq his hisc hiv hiw
+ hsc html ibc icb icp iob isbc iscl kgb kgbd
+ kgbi kis lal log lop lp lsl mem nib ohbr
+ okw ola olc oll olq opr opt osbc osbr otr
+ ple pod pvl q sac sbc sbl scbb schb scp
+ scsb sct se sfp sfs skp sob sobb sohb sop
+ sosb sot ssc st sts t tac tbc toc tp
+ tqw trp ts tsc tso vmll w wn x xci
+ xs </code></pre>
<p>Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be used.</p>
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use warnings;
+
+# Dump a list of perltidy abbreviation flags which can be negated.
+# This list goes in the man page section near the bottom titled
+# SWITCHES WHICH MAY BE NEGATED
+
+# Get the long names which may be negated
+my $rlong_names = get_long_names();
+my @binary_long_names;
+foreach my $long_name ( @{$rlong_names} ) {
+ my ( $name, $flag, $type ) = ( "", "", "" );
+ $long_name =~ s/\s+$//;
+ if ( $long_name =~ /^([\w\-]+)([^\s]*)/ ) {
+ $name = $1;
+ $flag = $2;
+ $flag = "" unless $flag;
+ if ( $flag eq '!' ) { push @binary_long_names, $name }
+ }
+}
+
+# Get a list of all short names
+my $rshort_names = get_short_names();
+my %abbrev;
+foreach my $short_name ( @{$rshort_names} ) {
+ if ( $short_name =~ /^(\w+) --> ([\w\-]+)$/ ) {
+ my $short = $1;
+ my $long = $2;
+ $abbrev{$long} = $short;
+ }
+}
+
+# delete these: -check-syntax or -syn is accepted but no longer does anything
+my @skip = qw(
+ check-syntax
+);
+foreach (@skip) {
+ if ( $abbrev{$_} ) { delete $abbrev{$_} }
+}
+
+
+# Select the short names which can be negated
+my @short_list;
+foreach my $long (@binary_long_names) {
+ my $short = $abbrev{$long};
+ if ( !defined($short) ) {
+ next;
+ }
+ push @short_list, $short;
+}
+
+# special aliases not obtained automatically
+my @special = qw(
+oll
+dac
+tac
+html
+sob
+baa
+bbs
+kgb
+icp
+otr
+sot
+sct
+sac
+sobb
+conv
+);
+
+my $FIELD_WIDTH = 6;
+my $WORDS_PER_LINE = 10;
+
+my $line = " ";
+my $count = 0;
+foreach my $word ( sort (@short_list, @special) ) {
+ my $len = length($word);
+ my $nsp = $FIELD_WIDTH - $len + 1;
+ $word .= " " x $nsp;
+ $line .= $word;
+ $count++;
+ if ( $count == $WORDS_PER_LINE ) {
+ print "$line\n";
+ $count = 0;
+ $line = " ";
+ }
+}
+print "$line\n";
+
+sub get_long_names {
+
+ # get latest parameters from perltidy
+ use File::Temp qw(tempfile);
+ my ( $fout, $tmpnam ) = File::Temp::tempfile();
+ if ( !$fout ) { die "cannot get tempfile\n" }
+ my @parameters;
+ system "perltidy --dump-long-names >$tmpnam";
+ open( IN, "<", $tmpnam ) || die "cannot open $tmpnam: $!\n";
+ while ( my $line = <IN> ) {
+ next if $line =~ /#/;
+ chomp $line, push @parameters, $line;
+ }
+ close IN;
+ unlink $tmpnam if ( -e $tmpnam );
+ return \@parameters;
+}
+
+sub get_short_names {
+
+ # get latest parameters from perltidy
+ use File::Temp qw(tempfile);
+ my ( $fout, $tmpnam ) = File::Temp::tempfile();
+ if ( !$fout ) { die "cannot get tempfile\n" }
+ my @parameters;
+ system "perltidy --dump-short-names >$tmpnam";
+ open( IN, "<", $tmpnam ) || die "cannot open $tmpnam: $!\n";
+ while ( my $line = <IN> ) {
+ next if $line =~ /#/;
+ chomp $line, push @parameters, $line;
+ }
+ close IN;
+ unlink $tmpnam if ( -e $tmpnam );
+ return \@parameters;
+}