## 2024 05 11.06
+ - Add logical xor operator ^^ available in perl version 5.40, as
+ noted in git #157.
+
+ - Keyword 'state' now has default space before a paren, like 'my'.
+ Previously there was no space and no control. So the default
+ is now "state ($x)". This space can be removed with -nsak='state'.
+
- Add options --add-lone-trailing-commas, -altc and
--delete-lone-trailing-commas, -dltc, to add control over adding
and deleting the only comma in a list. See discussion in git #143
my @spaces_both_sides = qw#
+ - * / % ? = . : x < > | & ^ .. << >> ** && .. || // => += -=
.= %= x= &= |= ^= *= <> <= >= == =~ !~ /= != ... <<= >>= ~~ !~~
- **= &&= ||= //= <=> A k f w F n C Y U G v P S
+ **= &&= ||= //= <=> A k f w F n C Y U G v P S ^^
#;
my @spaces_left_side = qw<
@q = qw(
.. :: << >> ** && || // -> => += -= .= %= &= |= ^= *= <>
- <= >= == =~ !~ != ++ -- /= x= ~~ ~. |. &. ^.
+ <= >= == =~ !~ != ++ -- /= x= ~~ ~. |. &. ^. ^^
);
@is_digraph{@q} = (1) x scalar(@q);
.. :: << >> ** && .. || // -> => += -= .= %= &= |= ^= *= <>
( ) <= >= == =~ !~ != ++ -- /= x=
... **= <<= >>= &&= ||= //= <=>
-, + - / * | % ! x ~ = \ ? : . < > ^ &
+, + - / * | % ! x ~ = \ ? : . < > ^ & ^^
The following additional token types are defined:
my @digraphs = qw(
.. :: << >> ** && || // -> => += -= .= %= &= |= ^= *= <>
- <= >= == =~ !~ != ++ -- /= x= ~~ ~. |. &. ^.
+ <= >= == =~ !~ != ++ -- /= x= ~~ ~. |. &. ^. ^^
);
@is_digraph{@digraphs} = (1) x scalar(@digraphs);
**= += -= .= /= *= %= x= &= |= ^= <<= >>= &&= ||= //=
<= >= == != => \ > < % * / ? & | ** <=> ~~ !~~ <<~
f F pp mm Y p m U J G j >> << ^ t
- ~. ^. |. &. ^.= |.= &.=
+ ~. ^. |. &. ^.= |.= &.= ^^
#;
push( @value_requestor_type, ',' )
; # (perl doesn't like a ',' in a qw block)
--- /dev/null
+$x ^^ $y and say "One of x or y is true, but not both";
--- /dev/null
+$x^^$y and say "One of x or y is true, but not both";
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
+../snippets30.t logical_xor.def
#8 dltc.def
#9 dltc.dltc1
#10 dltc.dltc2
+#11 logical_xor.def
# To locate test #13 you can search for its name or the string '#13'
[ [ 1950, 150, ], [ 2050, 150, ], ],
]
);
+----------
+
+ 'logical_xor' => <<'----------',
+$x^^$y and say "One of x or y is true, but not both";
----------
};
);
#10...........
},
+
+ 'logical_xor.def' => {
+ source => "logical_xor",
+ params => "def",
+ expect => <<'#11...........',
+$x ^^ $y and say "One of x or y is true, but not both";
+#11...........
+ },
};
my $ntests = 0 + keys %{$rtests};