summaryrefslogtreecommitdiff
path: root/t/op/kvhslice.t
Commit message (Collapse)AuthorAgeFilesLines
* Add support for deleting key/value slices (RT#131328)Dagfinn Ilmari Mannsåker2017-06-021-8/+1
|
* Correct error msg for sub:lvalue{%h{k}} in sassignFather Chrysostomos2016-05-201-2/+6
| | | | | | | | | | This: sub foo : lvalue { %hash{'key'} } foo = 3; was incorrectly giving ‘Can't modify key/value hash slice in list assignment’. There is no list assignment there.
* Delete experimental autoderef featureAaron Crane2015-07-131-9/+11
|
* Put miniperl @INC logic in test.plFather Chrysostomos2014-09-021-2/+1
|
* Get kvhslice.t working under miniperlFather Chrysostomos2014-09-021-1/+2
| | | | | | | If things are broken enough that make_ext.pl cannot run, then mini- test may run this script before everything is built. Hence, we need to make sure the directories that buildcustomize.pl puts in @INC are not clobbered by the test script.
* Fatalize using hash|array as referenceKarl Williamson2014-06-161-12/+5
| | | | This has been deprecated, scheduled to come out in 5.22
* Deprecate unescaped literal "{" in regex patternsKarl Williamson2014-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit also causes escaped (by a backslash) "(", "[", and "{" to be considered literally. In the previous 2 Perl versions, the escaping was ignored, and a (default-on) deprecation warning was raised. Now that we have warned for 2 release cycles, we can change the meaning.of escaping to actually do something Warning when a literal left brace is not escaped by a backslash, will allow us to eventually use this character in more contexts as being meta, allowing us to extend the language. For example, the lower limit of a quantifier could be omited, and better error checking instituted, or things like \w could be followed by a {...} indicating some special word character, like \w{Greek} to restrict to just Greek word characters. We tried to do this in v5.16, and many CPAN modules changed to backslash their left braces at that time. However we had to back out that change before 5.16 shipped because it turned out that escaping a left brace in some contexts didn't work, namely when the brace would normally be a metacharacter (for example surrounding a quantifier), and the pattern delimiters were { }. Instead we raised the useless backslash warning mentioned above, which has now been there for the requisite 2 cycles. This patch partially reverts 2 patches. The first, e62d0b1335a7959680be5f7e56910067d6f33c1f, partially reverted the deprecation of unescaped literal left brace. The other, 4d68ffa0f7f345bc1ae6751744518ba4bc3859bd, instituted the deprecation of the useless left-characters. Note that, as in the original attempt to deprecate, we don't raise a warning if the left brace is the first character in the pattern. This is because in that position it can't be a metacharacter, so we don't require any disambiguation, and we found that if we did raise an error, there were quite a few places where this occurred.
* rename aggref warnings to autoderefRicardo Signes2014-01-141-1/+1
|
* Make key/push $scalar experimentalFather Chrysostomos2014-01-141-1/+1
| | | | | We need a better name for the experimental category, but I have not thought of one, even after sleeping on it.
* Warn for all uses of %hash{...} in scalar cxFather Chrysostomos2013-11-081-12/+15
| | | | | | | | | | | | | | and reword the warning slightly. See <20131027204944.20489.qmail@lists-nntp.develooper.com>. To avoid getting a warning about scalar context for ‘delete %a[1,2]’, which dies anyway, I stopped scalar context from being applied to delete’s argument. Scalar context is not meaningful here anyway, and the context is not really scalar. This also means that ‘delete sort’ no longer produces a warning about scalar context before dying, so I added a test for that.
* Test kv slices in places that expect %{}Father Chrysostomos2013-09-131-1/+19
|
* Fewer false positives for %hash{$scalar} warningFather Chrysostomos2013-09-131-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | Instead of warning in the lexer, flag the op and then warn in op.c, when the op tree is available, so we don’t end up warning for actual lists or for sub calls. Also, only warn in scalar context, as in list context $hash{$scalar} and %hash{$scalar} do different things. In op.c we no longer have easy access to the source code, so recon- struct the hash/array access based on the op tree. This means %hash{foo} becomes %hash{"foo"}. We only reconstruct constant keys, so %hash{++$x} becomes %hash{...}. This also corrects erroneous dumps, like %hash{"} for %hash{"}"}. Instead of triggering the warning solely based on the op tree, we still keep the heuristic in toke.c, so that common workarounds for that warning (e.g., {q<key>} and {("key")}) continue to work. The heuristic in toke.c is tweaked to avoid warning for qw(). In a future commit I plan to extend this to the existing @array[0] and @hash{key} warnings, to avoid false positives.
* Suppress a warning in kvhslice.tFather Chrysostomos2013-09-131-0/+1
| | | | | The bugginess of the ‘Scalar value better written as...’ warning applies to %new{silce} syntax, too.
* test key/value hash slicesRuslan Zakirov2013-09-131-0/+191