| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Made them return the 0xFF byte (and warn). Not necessarily the best
choice, but there's not that much room in just 256 bytes for all of
the inf/-inf/nan. This same choice will need to be made with wider
integer packs.
|
|
|
|
|
| |
%c was made to produce "Inf"/"NaN" earlier, but let's
keep with the Unicode way, and make chr() agree with %c.
|
| |
|
| |
|
|
|
|
| |
Interestingly, this bug has been unnoticed for almost 3 years.
|
| |
|
|
|
|
|
|
| |
Before: printf %[ducp] for Inf/NaN produced quite surprising results:
1, 0, -1, 18446744073709551615, 9223372036854775808, -9223372036854775807,
bogus Unicode code points, random heap addresses in hex.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
And prepare for the double double case being properly implemented.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This includes some blead changes, but more are still waiting to be
incorporated into the next CPAN release, namely 7738054cc9 and dcccc8ffbf.
|
|
|
|
| |
added a few commits ago.
|
|
|
|
|
|
|
|
| |
This was removed in commit eff754733a. It was necessary, as the
feature caused bugs #69456 and #122607.
Advertising the compile-time check with version-dependent qualifi-
cations would make the documentation too verbose.
|
|
|
|
|
| |
It is not possible to reach these without $symtab’s having been
assigned a stash reference.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
See the thread that includes
<20140821044934.29399.qmail@lists-nntp.develooper.com>.
This provides a way for a package to define constants in another pack-
age, without having to resort to *other::const = sub () { $value }.
Now one can write constant->import("other::const" => $value).
Documentation will be added in an upcoming commit.
|
|
|
|
|
|
|
| |
In this code path, we know that the next token is a parenthesis. It
also happens that the lexer always emits parentheses the same way,
so there is no question as to how to interpret it. Hence, the value
of PL_expect is actually irrelevant here.
|
| |
|
|
|
|
|
| |
I think ‘portable between’ sounds better in this particular context.
The rewrapping is for the sake of splain output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ ./perl -Ilib -e '${function_with_side_effects,42}'
$ ./perl -Ilib -e '${Function_with_side_effects,42}'
syntax error at -e line 1, near "${"
Execution of -e aborted due to compilation errors.
Why is the second one a syntax error?
Because the lexer is trying to disambiguate between a block and a hash
when it sees ‘{’ after ‘$’. But an anonymous hash constructor cannot
come after a funny character, so any time it chooses the hash inter-
pretation over the blocky one, a syntax error ensues.
|
|
|
|
|
|
| |
XPerlSpace is used elsewhere in this pod, so use it everywhere.
Spotted by Andrew Rodland.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I look at this output a lot to verify that patterns compiled correctly.
This commit makes them somewhat easier to read, while extending this to
also work on EBCDIC platforms (as yet untested).
In staring at these over time, I realized that punctuation literals are
mostly what contributes to being hard to read. [A-Z] is just as
readable as [A-Y], but [%!@\]~] is harder to read than if there were
fewer. Sometimes that can't be helped, but if many get output,
inverting the pattern [^...] can cause fewer to be output. This commit
employs heuristics to invert when it thinks that that would be more
legible. For example, it converts the output of [^"'] to be
ANYOF[^"'][{unicode_all}]
instead of
ANYOF[\x{00}-\x{1F} !#$%&()*+,\-./0-9:;<=>?@A-Z[\\\]\^_`a-z{|}~\x{7F}-\x{FF}][{unicode_all}]
Since it is a heuristic, it may not be the best under all circumstances,
and may need to be tweaked in the future.
If almost all the printables are to be output, it uses a hex range, as
that is probably more closely aligned with the intent of the pattern
than which individual printables are desired. Again this heuristic can
be tweaked.
And it prints a leading 0 on things it outputs as hex formerly as a
single digit \x{0A} now instead of \x{A} previously.
|
|
|
|
| |
This is in preparation for it to be used in more than one place.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This creates a #define that gives the highest code point that is an
ASCII printable. On ASCII-ish platforms, this is 0x7E, but on EBCDIC
platforms it varies, and can be as high as 0xFF. This is in preparation
for needing this value in a future commit in regcomp.c
|
| |
|
|
|
|
| |
This is in preparation for it to be used in more than one place
|
|
|
|
| |
Bring two case statements into line with their peers
|
|
|
|
|
| |
Perl supports \e and \b (in bracketed character classes). Use these on
outputting like we do \t and \n, instead of a hex value
|
|
|
|
|
| |
The result of this must be at least 0 as the type is unsigned, so
the compiler gives a warning.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A co-worker pointed out that the docs for "elsif" were quite confusing
because nothing when you "perldoc -f elseif" points out that it doesn't
exist, it just directs you to perlsyn where we only document "elsif".
Ricardo Signes added this aliasing back in v5.15.7-194-g8f0d6a6.
Improve this confusion, and also add a mention of the common "elif" and
"else if" variants while I'm at it. I was originally going to just alias
them, but t/porting/perlfunc.t started failing because we're missing
cross-references, and unlike "elseif" the other two aren't keywords,
even if the "elseif" one is only here to warn you about its use.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code skips over a quoted string, handling escapes. And to han-
dle escapes it skips past the character following a backslash if that
character is itself a backslash or the quote character. Skipping past
the character after the backslash unconditionally, regardless of what
it is, has the same effect and uses less code.
This change shrunk the .o file.
Before:
-rw-r--r-- 1 sprout staff 671148 Aug 24 20:28 toke.o
After:
-rw-r--r-- 1 sprout staff 671100 Aug 24 22:37 toke.o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sub foo { 42 }
use constant bar => *foo;
BEGIN { undef *foo }
warn &{+bar};
warn bar->();
Obviously the last two lines should print the same thing, because they
both call the value of the ‘bar’ constant as a suroutine.
But op.c:ck_rvconst messes up the ‘bar->()’ at compile time, treating
the bar glob (a copy of the original *foo glob, and not the *foo glob
itself, which has since been undefined) as a string and using it to
look up a glob.
ck_rvconst should not do anything if the constant’s value is a glob.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was code in op.c:ck_rvconst (which runs when creating a derefer-
ence op, such as rv2sv, rv2av, etc.) that would check that a constant
kid holding a reference pointed to something of the right type. It
failed to take overloading into account.
The result was that these lines would fail to compile:
constant_reference_to_hash_with_coderef_overloading->();
constant_reference_to_sub_with_hashref_overloading->{key};
constant_reference_to_sub_with_arrayref_overloading->[0];
constant_reference_to_sub_with_scalarref_overloading->$*;
even though they should work.
Since the overloadedness could change any time, even checking for that
in op.c is incorrect. The only correct fix is to remove this compile-
time check. If something naughty gets through, it will be caught
at run time.
This fixes bugs #122607 and #69456.
|
|
|
|
|
|
| |
inlibc test is no good since it is likely to be a macro.
Also fix typo in fp_classify(). Yes, both exist.
|
|
|
|
|
|
| |
Most importantly, try C99 fpclassify() first.
Use fp_classify() and fp_classl().
|