my %is_lt_gt_le_ge;
my %is_container_token;
+ my %binary_bond_strength_nospace;
my %binary_bond_strength;
my %nobreak_lhs;
my %nobreak_rhs;
# breakpoint token should appear at the end of one line or the
# beginning of the next line.
- %right_bond_strength = ();
- %left_bond_strength = ();
- %binary_bond_strength = ();
- %nobreak_lhs = ();
- %nobreak_rhs = ();
+ %right_bond_strength = ();
+ %left_bond_strength = ();
+ %binary_bond_strength_nospace = ();
+ %binary_bond_strength = ();
+ %nobreak_lhs = ();
+ %nobreak_rhs = ();
# The hash keys in this section are token types, plus the text of
# certain keywords like 'or', 'and'.
# a construction like '{-y}'. The '-' quotes the 'y' and prevents
# it from being taken as a transliteration. We have to keep
# token types 'L m w' together to prevent this error.
- $binary_bond_strength{'L{'}{'m'} = NO_BREAK;
- $binary_bond_strength{'m'}{'w'} = NO_BREAK;
+ $binary_bond_strength{'L{'}{'m'} = NO_BREAK;
+ $binary_bond_strength_nospace{'m'}{'w'} = NO_BREAK;
+
+ # keep 'bareword-' together, but only if there is no space between
+ # the word and dash. Do not keep together if there is a space.
+ # example 'use perl6-alpha'
+ $binary_bond_strength_nospace{'w'}{'m'} = NO_BREAK;
# use strict requires that bare word and => not be separated
$binary_bond_strength{'w'}{'=>'} = NO_BREAK;
}
}
- # keep 'bareword-' together, but only if there is no space between
- # the word and dash. Do not keep together if there is a space.
- # example 'use perl6-alpha'
- elsif ( $type eq 'w' && $next_type eq 'm' ) { $bond_str = NO_BREAK }
-
# Breaking before a ? before a quote can cause trouble if
# they are not separated by a blank.
# Example: a syntax error occurs if you break before the ? here
$rtype = $next_nonblank_type . $next_nonblank_token;
}
+ # apply binary rules which apply regardless of space between tokens
if ( $binary_bond_strength{$ltype}{$rtype} ) {
$bond_str = $binary_bond_strength{$ltype}{$rtype};
$tabulated_bond_str = $bond_str;
}
+ # apply binary rules which apply only if no space between tokens
+ if ( $binary_bond_strength_nospace{$ltype}{$next_type} ) {
+ $bond_str = $binary_bond_strength{$ltype}{$next_type};
+ $tabulated_bond_str = $bond_str;
+ }
+
if ( $nobreak_rhs{$ltype} || $nobreak_lhs{$rtype} ) {
$bond_str = NO_BREAK;
$tabulated_bond_str = $bond_str;
../snippets22.t xci.def
../snippets22.t xci.xci1
../snippets22.t xci.xci2
+../snippets22.t mangle4.def
+../snippets22.t mangle4.mangle
../snippets3.t ce_wn1.ce_wn
../snippets3.t ce_wn1.def
../snippets3.t colin.colin
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets22.t mangle4.def
-../snippets22.t mangle4.mangle
+../snippets22.t extrude5.def
+../snippets22.t extrude5.extrude
#10 xci.xci2
#11 mangle4.def
#12 mangle4.mangle
+#13 extrude5.def
+#14 extrude5.extrude
# To locate test #13 you can search for its name or the string '#13'
-bli -blil='*'
----------
'def' => "",
+ 'extrude' => "--extrude",
'here_long' => "-l=33",
'mangle' => "--mangle",
'xci1' => "-xci",
catch {
die;
};
+----------
+
+ 'extrude5' => <<'----------',
+use perl6-alpha;
+$var{-y} = 1;
----------
'here_long' => <<'----------',
{$a.$b}
#12...........
},
+
+ 'extrude5.def' => {
+ source => "extrude5",
+ params => "def",
+ expect => <<'#13...........',
+use perl6-alpha;
+$var{-y} = 1;
+#13...........
+ },
+
+ 'extrude5.extrude' => {
+ source => "extrude5",
+ params => "extrude",
+ expect => <<'#14...........',
+use
+perl6-alpha
+;
+$var{-y}
+=
+1
+;
+#14...........
+ },
};
my $ntests = 0 + keys %{$rtests};