This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agosv.c: Silence VMS compiler warning
Karl Williamson [Sat, 23 Aug 2014 23:50:11 +0000 (17:50 -0600)]
sv.c: Silence VMS compiler warning

The result of this must be at least 0 as the type is unsigned, so
the compiler gives a warning.

9 years agoembed.fnc: Clarify m flag behavior comment
Karl Williamson [Sat, 23 Aug 2014 23:49:30 +0000 (17:49 -0600)]
embed.fnc: Clarify m flag behavior comment

9 years agoperlfunc: Improve the pointer from "elseif" to "elsif"
Ævar Arnfjörð Bjarmason [Mon, 25 Aug 2014 16:17:11 +0000 (16:17 +0000)]
perlfunc: Improve the pointer from "elseif" to "elsif"

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.

9 years agotoke.c: Remove unnecessary condition
Father Chrysostomos [Mon, 25 Aug 2014 05:42:51 +0000 (22:42 -0700)]
toke.c: Remove unnecessary condition

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

9 years agoStop ck_rvconst from treating GV constants as strings
Father Chrysostomos [Mon, 25 Aug 2014 05:31:10 +0000 (22:31 -0700)]
Stop ck_rvconst from treating GV constants as strings

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.

9 years agoRemove compile-time checking of rv2?v with const kid
Father Chrysostomos [Mon, 25 Aug 2014 05:12:52 +0000 (22:12 -0700)]
Remove compile-time checking of rv2?v with const kid

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.

9 years agoTest fpclassify() with full compile.
Jarkko Hietaniemi [Mon, 25 Aug 2014 01:21:04 +0000 (21:21 -0400)]
Test fpclassify() with full compile.

inlibc test is no good since it is likely to be a macro.

Also fix typo in fp_classify().  Yes, both exist.

9 years agoReorder the *fp*class* in preference order, add comments.
Jarkko Hietaniemi [Sun, 24 Aug 2014 22:43:29 +0000 (18:43 -0400)]
Reorder the *fp*class* in preference order, add comments.

Most importantly, try C99 fpclassify() first.

Use fp_classify() and fp_classl().

9 years agoConfigure scan for fp_classl().
Jarkko Hietaniemi [Mon, 25 Aug 2014 00:12:16 +0000 (20:12 -0400)]
Configure scan for fp_classl().

9 years agoConfigure scan for fp_classify().
Jarkko Hietaniemi [Sun, 24 Aug 2014 22:40:19 +0000 (18:40 -0400)]
Configure scan for fp_classify().

9 years agoMore is_inf() et alia dance.
Jarkko Hietaniemi [Sun, 24 Aug 2014 22:34:05 +0000 (18:34 -0400)]
More is_inf() et alia dance.

Too many almost similar interfaces.

Most importantly go for isinf() and isnan() if available,
instead of going for the labyrinth of *fp*class* interfaces.

9 years agoMore robust inf/nan recognition and generation.
Jarkko Hietaniemi [Sun, 24 Aug 2014 02:49:04 +0000 (22:49 -0400)]
More robust inf/nan recognition and generation.

Drop INFNAN_PEEK, premature optimization and hard to get right (it
basically imitates unrolled first half of grok_infnan).  Just keep
grok_infan fast.  (There is one spot in grok_number_flags() where we
peek at the next byte to avoid wasted work.)

If falling back (from not having NV_INF/NV_NAN) to the native strtod
(or similar), fake the input based on the grok_infnan result.
Add last-resort ways to generate inf/nan.

Recognize explicit unary plus, like "+Inf", and "INFINITE".

In tests use cmp_ok(), fix typos, add tests.

9 years ago[Merge] Eliminate PL_lex_expect; fix one bug; other clean-up
Father Chrysostomos [Mon, 25 Aug 2014 02:03:29 +0000 (19:03 -0700)]
[Merge] Eliminate PL_lex_expect; fix one bug; other clean-up

PL_expect (PL_parser->expect) is what the lexer uses to keep track of
what type of thing to expect next.  This (partly) determines whether
‘{’ begins a block, or an anonymous hash, or a subscript.

In numerous cases PL_expect was being set to the wrong value.  There
were extra statements to set it back to the right value.  There was
also a mechanism to save the value (force_next/PL_lex_expect) and
restore it later.

If we just set PL_expect to the correct values to begin with, we can
simplify things conceptually and reduce the amount of code.

I fixed bug #80368 in the process, since it got in the way.

I also fixed up some comments in toke.c and changed PL_parser to
parser in perly.y.

9 years agoIn perly.y, change PL_parser to parser
Father Chrysostomos [Fri, 22 Aug 2014 13:18:01 +0000 (06:18 -0700)]
In perly.y, change PL_parser to parser

All these code snippets are embedded inside a function
(perly.c:yyparse) that puts the current value of PL_parser in a local
variable named parser.  So the two are equivalent, but the latter
only has to access a local variable.

Before:

$ ls -ld perly.o
-rw-r--r--  1 sprout  staff  94748 Aug 22 06:12 perly.o

After:

$ ls -ld perly.o
-rw-r--r--  1 sprout  staff  94340 Aug 22 06:15 perly.o

9 years agoSet PL_expect only once after curly subscripts
Father Chrysostomos [Fri, 22 Aug 2014 13:13:17 +0000 (06:13 -0700)]
Set PL_expect only once after curly subscripts

When curly subscripts are parsed, the lexer (toke.c:yylex) notes that
the value of PL_expect needs to be set to XSTATE (expecting a state-
ment) after the final brace.  When the final brace is encountered,
PL_expect is set to that recorded value.  But then the parser
(perly.y) sets it to XOPERATOR immediately thereafter.

This approach requires a plethora of identical statements in perly.y.
If we just set PL_expect to the right value to begin with, we can
avoid all those assignments.

9 years agoparser.h: Comment that lex_expect is unused
Father Chrysostomos [Sat, 23 Aug 2014 01:15:26 +0000 (18:15 -0700)]
parser.h: Comment that lex_expect is unused

There is at least one CPAN module (Data::Alias) that assigns to this.
Removing it won’t shrink the parser struct because of alignment, so
it doesn’t gain us anything.  Just leave it for now.  We can remove
it later if we have to.

9 years agotoke.c: Remove PL_lex_expect define
Father Chrysostomos [Sat, 23 Aug 2014 01:14:06 +0000 (18:14 -0700)]
toke.c: Remove PL_lex_expect define

This is no longer used.

9 years agoStop setting PL_lex_expect
Father Chrysostomos [Fri, 22 Aug 2014 13:02:17 +0000 (06:02 -0700)]
Stop setting PL_lex_expect

As of two commits ago, nothing uses its value any more.

9 years agotoke.c: Consolidate some PL_expect assignments
Father Chrysostomos [Fri, 22 Aug 2014 13:01:45 +0000 (06:01 -0700)]
toke.c: Consolidate some PL_expect assignments

The previous commit allows these settings of PL_expect to be combined.
We no longer need one before force_next in each instance.

9 years agoStop using the value of PL_expect
Father Chrysostomos [Fri, 22 Aug 2014 12:53:42 +0000 (05:53 -0700)]
Stop using the value of PL_expect

The changes in commits leading up to this one avoided unnecessary
PL_expect assignments that would soon be clobbered by this
‘PL_expect = PL_lex_expect’ that restores the previous value.

Hence, we no longer even need to read the value of PL_lex_expect since
PL_expect hasn’t changed.

Just one piece of code (KEY_package) was setting PL_lex_expect
directly instead of having force_next copy it from PL_expect, so this
commit changes it to set PL_expect to the correct value.

9 years agotoke.c: For plugins, don’t set PL_expect if PL_nexttoke
Father Chrysostomos [Sat, 23 Aug 2014 01:11:23 +0000 (18:11 -0700)]
toke.c: For plugins, don’t set PL_expect if PL_nexttoke

When a parsing plugin finishes parsing its stuff, the lexer may have
emitted one more token than the construct it was parsing (if the
plugin called parsing API functions like parse_fullstmt).  In such
cases, yyunlex has pushed that token on to the pending token stack
with force_next.

When the lexer is about to emit the plugin’s parsed statement or
expression, if there is a pending token, then it does not need to set
PL_expect, since the previous value will be restored anyway when the
pending token is emitted.

The next commit will disable that save-and-restore mechanism for
PL_expect, so we must not assign to it here.

9 years agotoke.c: Touch PL_expect less for implicit [.,] in quotes
Father Chrysostomos [Fri, 22 Aug 2014 12:45:27 +0000 (05:45 -0700)]
toke.c: Touch PL_expect less for implicit [.,] in quotes

When emitting implicit commas and cats, there is no need to set
PL_expect at the same time, since these code paths have already set
it to the correct value.  Also, the two instances of Aop would check
the current parse position for an ‘=’ to make an assignment operator.
But that could never happen in these two code paths, so the check
was a waste.

9 years ago[perl #80368] Fix implicit assignop in qq"a\U="
Father Chrysostomos [Fri, 22 Aug 2014 12:40:18 +0000 (05:40 -0700)]
[perl #80368] Fix implicit assignop in qq"a\U="

The bug report explains it all:
> $ perl -e 'print "a\U="'
> Can't modify constant item in concatenation (.) or string at -e line 1, near "print "a\U=""
> Execution of -e aborted due to compilation errors.
>
> The "a\U=" string constant ought to generate ops corresponding roughly to
> "a".uc("=") (which would then be constant-folded).  However, the "=" is
> being interpreted by the tokeniser as part of the concatenation operator,
> producing ops corresponding to "a".=uc("") (which generates the error).
>
> This happens because the implicit concatenation operator is generated
> in toke.c via the Aop() macro, which allows an addition-type operator
> to be mutated into an assignment operator if it is immediately followed
> by an "=".  It should instead be generated via one of the other macros,
> or possibly a new macro, that doesn't allow for mutation to an assignment
> operator.

This commit does the latter.

> There are multiple sites in toke.c making the same mistake.

The other two instances are harmless, but the next commit will change
them for a different reason (avoiding unnecessary PL_expect assign-
ments with a view to eventually removing PL_lex_expect).

9 years agotoke.c: Correct S_ao description
Father Chrysostomos [Fri, 22 Aug 2014 05:25:17 +0000 (22:25 -0700)]
toke.c: Correct S_ao description

It applies not just to control flow assignment operators, but to all
‘x=’-style operators.

9 years agotoke.c: Skip PL_expect assignment under KEY_require
Father Chrysostomos [Fri, 22 Aug 2014 04:44:39 +0000 (21:44 -0700)]
toke.c: Skip PL_expect assignment under KEY_require

Only set PL_expect here when force_word has realised there is no word
there and has not called force_next.  Setting PL_expect after a call
to force_next is useless, as force_next causes its saved value to be
restored when the next token is emitted.

Changing this may seem silly, as an unconditional assignment may even
be faster, but this will allow me to eliminate PL_lex_expect and make
PL_expect handling simpler than before.

9 years agotoke.c: Rework LOOPX macro
Father Chrysostomos [Fri, 22 Aug 2014 01:19:31 +0000 (18:19 -0700)]
toke.c: Rework LOOPX macro

All its callers have the same two lines preceding it, so fold them
into the macro.  Only assign to PL_expect after the force_word call if
force_word did not find a word.  (If it did find one, then force_next
would have recorded the previous PL_expect value, which will clobber
the one we have just assigned.)

9 years agotoke.c:S_lop: Don’t set PL_expect if PL_nexttoke
Father Chrysostomos [Fri, 22 Aug 2014 00:59:06 +0000 (17:59 -0700)]
toke.c:S_lop: Don’t set PL_expect if PL_nexttoke

Don’t set PL_expect if we have a ‘next token’, because when it is
popped off the pending token stack PL_expect will be set to the
saved value, clobbering this assigned value.  So the assignment is
unnecessary.

9 years agoExpand a comment in toke.c (eliminate ‘why?’)
Father Chrysostomos [Thu, 21 Aug 2014 20:16:59 +0000 (13:16 -0700)]
Expand a comment in toke.c (eliminate ‘why?’)

9 years agoSet PL_expect less often when parsing semicolons
Father Chrysostomos [Thu, 21 Aug 2014 19:47:58 +0000 (12:47 -0700)]
Set PL_expect less often when parsing semicolons

As it worked before, the parser (perly.y) would set PL_expect to
XSTATE after encountering a statement-terminating semicolon.

Two functions in op.c--package and utilize--had to set the value to
XSTATE as a result.

Also, in the case of a closing brace, the lexer emits an implicit
semicolon followed by '}' (emitted via force_next).  force_next
records the value of PL_expect and restores it when emitting the
token.  So in this case the value of PL_expect was flipping back and
forth between two values.

Instead of having the parser set it to XSTATE, we can have the lexer
set it to XSTATE by default when emitting an explicit semicolon.  (It
was setting it to XTERM.)  The parser can set it to XTERM in the only
place that matters; viz., the header of a for-loop.  This simplifies
things conceptually, and makes the code a whole line shorter.

(The diff stat shows more savings in line count, but that is because
the version of bison I used to regenerate the tables produces smaller
headers than what was already committed.)

9 years agotoke.c: Don’t set PL_expect when emitting USE tokens
Father Chrysostomos [Thu, 21 Aug 2014 05:18:38 +0000 (22:18 -0700)]
toke.c: Don’t set PL_expect when emitting USE tokens

This is a follow-up to 52d0e95bf.

It is not necessary to set PL_expect (via TERM or OPERATOR) since
tokenize_use has already done it.  In 52d0e95bf I only changed one of
tokenize_use’s callers, and changed it the wrong way.

No behaviour changes.

9 years agoUpdate Module-CoreList for 5.20.1
Steve Hay [Mon, 25 Aug 2014 01:10:42 +0000 (02:10 +0100)]
Update Module-CoreList for 5.20.1

(Excluding %upstream and %bug_tracker portions, which involve modules that
are no longer in blead (e.g. Module-Build) and therefore are not suitable
for committing to blead and then cherry-picking to maint; they will be
committed directly to maint instead.)

9 years agoAdd new pumpkin keeper victim following release of 5.21.3
Steve Hay [Sun, 24 Aug 2014 23:23:27 +0000 (00:23 +0100)]
Add new pumpkin keeper victim following release of 5.21.3

9 years agoperlxs: Add text about dealing with locales, etc
Karl Williamson [Fri, 22 Aug 2014 04:40:42 +0000 (22:40 -0600)]
perlxs: Add text about dealing with locales, etc

This pod has been totally silent about monkey wrenches that could be
thrown by XS code doing things that can affect perl.  Add a few
cautions, including some detailed information about one area where we
have been bitten: locales.

9 years agoMake eval_pv documentation more precise
Tadeusz Sośnierz [Sun, 24 Aug 2014 13:13:28 +0000 (15:13 +0200)]
Make eval_pv documentation more precise

9 years agoIncrease $_charnames::VERSION to 1.42
Father Chrysostomos [Sun, 24 Aug 2014 06:31:01 +0000 (23:31 -0700)]
Increase $_charnames::VERSION to 1.42

9 years agoPartial minitest fix-up
Father Chrysostomos [Sun, 24 Aug 2014 06:22:26 +0000 (23:22 -0700)]
Partial minitest fix-up

While minitest passes all its tests when everything has been
built, it is sometimes useful to run it when nothing has been
built but miniperl (especially when one is working on low-level
stuff that breaks miniperl).  Many tests fail if things have
not been built yet because miniperl can’t find modules like
re.pm.  This patch fixes up some tests to find those modules
and changes _charnames.pm to load File::Spec only when it
needs it.

There are still many more failures, but I’ll leave the rest
for another time (or another hacker :-).

9 years agoperldiag grammar tweaks
Father Chrysostomos [Tue, 19 Aug 2014 17:04:20 +0000 (10:04 -0700)]
perldiag grammar tweaks

9 years agoExplicitly cast to MANTISSATYPE since some compilers worry.
Jarkko Hietaniemi [Sun, 24 Aug 2014 01:43:17 +0000 (21:43 -0400)]
Explicitly cast to MANTISSATYPE since some compilers worry.

9 years agoFix bad quoting.
Jarkko Hietaniemi [Sun, 24 Aug 2014 01:24:14 +0000 (21:24 -0400)]
Fix bad quoting.

9 years agoUpdate HTTP-Tiny to CPAN version 0.048
Chris 'BinGOs' Williams [Sat, 23 Aug 2014 20:41:31 +0000 (21:41 +0100)]
Update HTTP-Tiny to CPAN version 0.048

  [DELTA]

0.048     2014-08-21 13:19:51-04:00 America/New_York

    [FIXED]

    - Protected proxy tests from ALL_PROXY in the environment

9 years agoUpdate ExtUtils-CBuilder version for CPAN release
Chris 'BinGOs' Williams [Sat, 23 Aug 2014 20:35:09 +0000 (21:35 +0100)]
Update ExtUtils-CBuilder version for CPAN release

9 years agoInclude fp.h with math.h on VMS.
Craig A. Berry [Sat, 23 Aug 2014 15:42:26 +0000 (10:42 -0500)]
Include fp.h with math.h on VMS.

It has some macros that really should be in math.h according to C99.

9 years agoVMS has the isfinite macro on all architectures.
Craig A. Berry [Sat, 23 Aug 2014 15:31:39 +0000 (10:31 -0500)]
VMS has the isfinite macro on all architectures.

And regardless of whether we're using IEEE math or not.  If we're
not, then everything is finite by definition because we would've
seen an exception before getting to the point of checking for
finitude, so the macro translates to "1" in those cases.

As of this writing, the isfinite macro requires the inclusion of
fp.h, not just math.h as C99 stipulates, and it also appears not
to handle long doubles.

9 years agoSkip strtold in concise-xs.t, "platform varying".
Jarkko Hietaniemi [Sat, 23 Aug 2014 14:41:29 +0000 (10:41 -0400)]
Skip strtold in concise-xs.t, "platform varying".

Not on Win32, for example.

9 years agoTest 9**9**9 for Inf and sin(9**9**9) for NaN.
Jarkko Hietaniemi [Sat, 23 Aug 2014 12:53:37 +0000 (08:53 -0400)]
Test 9**9**9 for Inf and sin(9**9**9) for NaN.

9 years agoRevert "Test 9**9**9 for Inf and sin(9**9**9) for NaN."
Jarkko Hietaniemi [Sat, 23 Aug 2014 12:49:29 +0000 (08:49 -0400)]
Revert "Test 9**9**9 for Inf and sin(9**9**9) for NaN."

This reverts commit 3761cb2c37385299211e45c965fb0d727e13c80b.

9 years agoThe less-than-zero branch needs to be the default always.
Jarkko Hietaniemi [Sat, 23 Aug 2014 12:40:51 +0000 (08:40 -0400)]
The less-than-zero branch needs to be the default always.

9 years agoTest 9**9**9 for Inf and sin(9**9**9) for NaN.
Jarkko Hietaniemi [Sat, 23 Aug 2014 12:21:27 +0000 (08:21 -0400)]
Test 9**9**9 for Inf and sin(9**9**9) for NaN.

9 years agoDo not test memcmp et al, now also Linux inlined it.
Jarkko Hietaniemi [Sat, 23 Aug 2014 12:14:20 +0000 (08:14 -0400)]
Do not test memcmp et al, now also Linux inlined it.

See perl #122595.

9 years agoOld HP-UXen had a non-standard strtold().
Jarkko Hietaniemi [Sat, 23 Aug 2014 00:38:25 +0000 (20:38 -0400)]
Old HP-UXen had a non-standard strtold().

9 years agoFix infnan.t Win32 failure.
Jarkko Hietaniemi [Fri, 22 Aug 2014 20:42:22 +0000 (16:42 -0400)]
Fix infnan.t Win32 failure.

9 years agoFix the PEEK_INFNAN (wrong macro arg name).
Jarkko Hietaniemi [Fri, 22 Aug 2014 18:52:46 +0000 (14:52 -0400)]
Fix the PEEK_INFNAN (wrong macro arg name).

Also rename as INFNAN_PEEK, to match HEXFP_PEEK.

Add "send" pointer to INFNAN_PEEK to guard againt past-the-buffer peeking.

HEXFP_PEEK doesn't easily lend itself to "send" pointer
because of it's calling environment doesn't have one.

9 years agoRemove obsolete comment.
Jarkko Hietaniemi [Fri, 22 Aug 2014 16:33:37 +0000 (12:33 -0400)]
Remove obsolete comment.

9 years agoIf this format ever happens, it is probably left-aligned.
Jarkko Hietaniemi [Fri, 22 Aug 2014 14:56:10 +0000 (10:56 -0400)]
If this format ever happens, it is probably left-aligned.

(Having unused bytes in the left/low/front makes no sense.)

9 years agoDarwin can have libfoo.0.dylib instead of libfoo.dylib.0
Jarkko Hietaniemi [Fri, 22 Aug 2014 16:28:00 +0000 (12:28 -0400)]
Darwin can have libfoo.0.dylib instead of libfoo.dylib.0

9 years agoFor Darwin MacPorts add the gcc/g++ libdir.
Jarkko Hietaniemi [Fri, 22 Aug 2014 16:31:59 +0000 (12:31 -0400)]
For Darwin MacPorts add the gcc/g++ libdir.

9 years agoBump version of POSIX.pm
Karl Williamson [Fri, 22 Aug 2014 18:12:10 +0000 (12:12 -0600)]
Bump version of POSIX.pm

9 years agoregcomp.c: Use symbolic constant instead of number
Karl Williamson [Fri, 22 Aug 2014 16:41:07 +0000 (10:41 -0600)]
regcomp.c: Use symbolic constant instead of number

This case was missed in converting to symbolic form in
dcb20b364cef1eec53dfee5ed1078aa04ef59ed8

9 years agoAdd and use macros for case-insensitive comparison
Karl Williamson [Thu, 21 Aug 2014 23:29:10 +0000 (17:29 -0600)]
Add and use macros for case-insensitive comparison

This adds to handy.h isALPHA_FOLD_EQ(c1,c2) which efficiently tests if
c1 and c2 are the same character, case-insensitively.  For example
isALPHA_FOLD_EQ(c, 's') returns true if and only if <c> is 's' or 'S'.
isALPHA_FOLD_NE() is also added by this commit.

At least one of c1 and c2 must be known to be in [A-Za-z] or this macro
doesn't work properly.  (There is an assert for this in the macro in
DEBUGGING builds).  That is why the name includes "ALPHA", so you won't
forget when using it.

This functionality has been in regcomp.c for a while, under a different
name.  I had thought that the only reason to make it more generally
available was potential speed gain, but recent gcc versions optimize to
the same code, so I thought there wasn't any point to doing so.

But I now think that using this makes things easier to read (and
certainly shorter to type in).  Once you grok what this macro does, it
simplifies what you have to keep in your mind when reading logical
expressions with multiple operands.  That something can be either upper
or lower case can be a distraction to understanding the larger point of
the expression.

9 years agoAdd some basic math tests.
Jarkko Hietaniemi [Thu, 21 Aug 2014 21:10:26 +0000 (17:10 -0400)]
Add some basic math tests.

Inspired by [perl #122571] where exp() and sin() were broken
in AIX with long doubles.

9 years agoImplement POSIX::strtold().
Jarkko Hietaniemi [Thu, 21 Aug 2014 20:30:04 +0000 (16:30 -0400)]
Implement POSIX::strtold().

Defined of course only with long doubles.

9 years agoIntroduce Perl_strtod (macro) to call strtold if long doubles.
Jarkko Hietaniemi [Thu, 21 Aug 2014 17:03:53 +0000 (13:03 -0400)]
Introduce Perl_strtod (macro) to call strtold if long doubles.

Not that much effect since strtod is now only used to parse inf/nan
and then only if NV_INF + NV_NAN are missing.  (Earlier strtod()
returned always the double inf/nan, not the long double inf/nan.)

9 years agoPerl_isinf and Perl_isfinite enhancements.
Jarkko Hietaniemi [Fri, 22 Aug 2014 11:48:57 +0000 (07:48 -0400)]
Perl_isinf and Perl_isfinite enhancements.

9 years agoClean up the fpclass forest.
Jarkko Hietaniemi [Fri, 22 Aug 2014 02:51:47 +0000 (22:51 -0400)]
Clean up the fpclass forest.

9 years agoAdd inf/nan tests.
Jarkko Hietaniemi [Thu, 21 Aug 2014 21:48:12 +0000 (17:48 -0400)]
Add inf/nan tests.

Try to skip robustly if no such values exist.

9 years agoUnify the Inf/-Inf/NaN also in basic NV stringify.
Jarkko Hietaniemi [Thu, 21 Aug 2014 22:15:04 +0000 (18:15 -0400)]
Unify the Inf/-Inf/NaN also in basic NV stringify.

9 years agoUnify inf/nan printf output to Inf, -Inf, and NaN.
Jarkko Hietaniemi [Thu, 21 Aug 2014 20:57:06 +0000 (16:57 -0400)]
Unify inf/nan printf output to Inf, -Inf, and NaN.

(Bypassing the native strtod.)

9 years agoUse grok_infnan() if NV_INF and NV_NAN are defined.
Jarkko Hietaniemi [Thu, 21 Aug 2014 16:36:44 +0000 (12:36 -0400)]
Use grok_infnan() if NV_INF and NV_NAN are defined.

The native strtod() is still the fallback.

The send was one too short, but it was only used in one code path,
obviously not tested.

Also really allow the trailing weirdnesses for nan (like "nanq").

9 years agoperlrecharclass: Remove now-irrelevant text
Karl Williamson [Thu, 21 Aug 2014 20:26:07 +0000 (14:26 -0600)]
perlrecharclass: Remove now-irrelevant text

v5.21 now uses the same definition of white-space that this gives, so
there is no need to repeat it here, and is misleading because it says
this is different from the other definition.

9 years agoperlop: Note that negative rep now warns
Karl Williamson [Thu, 21 Aug 2014 20:23:05 +0000 (14:23 -0600)]
perlop: Note that negative rep now warns

This doc change was missed in b3211734a7d280a8b7c6acaaba333f8f6a314675
but it appears that this will not be reverted, so safe to go in now
without having to worry very much about synchronizing should there be a
reversion

9 years agoregcomp.c: Avoid function call overhead
Karl Williamson [Sun, 10 Aug 2014 00:07:48 +0000 (18:07 -0600)]
regcomp.c: Avoid function call overhead

We don't need to call a function to convert from UTF-8 when the value is
invariant in and out of UTF-8.

9 years agoregcomp.c: Swap 'else' clauses.
Karl Williamson [Sat, 9 Aug 2014 23:47:02 +0000 (17:47 -0600)]
regcomp.c: Swap 'else' clauses.

It's easier to comprehend a tiny else clause followed by a large one and
vice-versa.  This is in preparation for further changes in future
commits.

9 years agoAvoid redundant text -in -Dr output
Karl Williamson [Fri, 1 Aug 2014 16:04:16 +0000 (10:04 -0600)]
Avoid redundant text -in -Dr output

There is an optimization in regcomp.c which saves memory when used, but
which caused -Dr output to display the same code points twice.
I didn't add a test to ext/re/t/regop.t because this only happens for a
Unicode property, under certain circumstances, and that triggers a lot
of other regex patterns to be compiled which are subject to change, so
the test would frequently have to be updated.  This only affects
debugging output anyway.

9 years agoregcomp.c: Reorder cases: in switch
Karl Williamson [Fri, 1 Aug 2014 15:58:02 +0000 (09:58 -0600)]
regcomp.c: Reorder cases: in switch

This makes it slightly more reader-friendly

9 years agoMove _get_regclass_nonbitmap_data() to regcomp.c
Karl Williamson [Fri, 1 Aug 2014 15:09:41 +0000 (09:09 -0600)]
Move _get_regclass_nonbitmap_data() to regcomp.c

This function, though mostly used by regexec.c and previously contained
therein, relies on the particular data structure in regcomp.c, so it
makes sense to move it adjacent to the code that generates the
structure.  Future commits will add function calls to this function that
are (currently) only in regcomp.c, and so will tie it tighter to that
file.

This just moves the code with surrounding #ifdef, adds a couple of blank
lines, removes some trailing white space, and adjusts the comments.  No
other changes were made.

9 years agoregex: Use #define for number of bits in ANYOF
Karl Williamson [Mon, 30 Jun 2014 21:03:14 +0000 (15:03 -0600)]
regex: Use #define for number of bits in ANYOF

ANYOF nodes (for bracketed character classes) currently are for code
points 0-255.  This is the first step in the eventual making that size
configurable.  This also renames a static function, as the domain may
not necessarily be 'latin1'

9 years agoUse constant now defined for ESC
Karl Williamson [Fri, 1 Aug 2014 15:46:12 +0000 (09:46 -0600)]
Use constant now defined for ESC

This avoids a runtime translation

9 years agoPartial revert of c6d2504a: do not use isfinite().
Jarkko Hietaniemi [Thu, 21 Aug 2014 19:04:47 +0000 (15:04 -0400)]
Partial revert of c6d2504a: do not use isfinite().

Instead return to a well-defined hack that has served us for years.

Immediate reason: VMS.  It has isfinite(), but due to messy
reasons it doesn't currently get the prototype.

9 years agoThe quest for the hexfp exponent continues.
Jarkko Hietaniemi [Thu, 21 Aug 2014 14:14:56 +0000 (10:14 -0400)]
The quest for the hexfp exponent continues.

9 years agoDo not anchor the matches, because of sprintf padding.
Jarkko Hietaniemi [Thu, 21 Aug 2014 13:54:27 +0000 (09:54 -0400)]
Do not anchor the matches, because of sprintf padding.

9 years agopp_sys.c: Generalize -B, -T for EBCDIC, clean up
Karl Williamson [Thu, 21 Aug 2014 18:10:39 +0000 (12:10 -0600)]
pp_sys.c: Generalize -B, -T for EBCDIC, clean up

There was discussion about extending these to work for Latin1,
(http://nntp.perl.org/group/perl.perl5.porters/214950 and following)
but in the end it was decided that this is a heuristic, and perturbing
that might break things.  So this patch keeps the same criteria as
before, but refactors things so it isn't ASCII-platform-centric.

However, the version it replaces checked for utf8ness piece-meal,
leading to possibly incorrect results, which this fixes.  If a buffer
isn't entirely UTF-8, then it can't be UTF-8.  So this uses
is_utf8_string() instead of reimplementing the utf8ness checks, and does
it for the buffer as a whole.

And, there was an inapproptiate test for ALPHA under locale that this
removes.  The test for locale non-strange characters is that they be
either printable or space (things like \t are space but not printable).

9 years agounicode_constants.h: Add definitions for ESC and VT
Karl Williamson [Thu, 21 Aug 2014 17:55:48 +0000 (11:55 -0600)]
unicode_constants.h: Add definitions for ESC and VT

These will be used in future commits

9 years agoperlfunc: Update -B, -T descriptions
Karl Williamson [Thu, 21 Aug 2014 17:49:15 +0000 (11:49 -0600)]
perlfunc: Update -B, -T descriptions

These descriptions were way out-of_date.

9 years agoRevert "cpan/Time-HiRes/t/itimer.t: better diagnostics"
David Mitchell [Thu, 21 Aug 2014 15:50:39 +0000 (16:50 +0100)]
Revert "cpan/Time-HiRes/t/itimer.t: better diagnostics"

This reverts commit 65dd9533e90d8e1ea84c091ff43133132c667a1c.

That commit was just temporary to help debug a smoke issue.
Since Time::Hires is a CPAN-first module, back the patch out from blead,
and leave it to the module's owner whether they want to add it back in.

9 years agodump.c: eliminate DUMP_OP_FLAGS/PRIVATE macros
David Mitchell [Thu, 21 Aug 2014 15:22:35 +0000 (16:22 +0100)]
dump.c: eliminate DUMP_OP_FLAGS/PRIVATE macros

With the MAD code, these macros were each used in two places to
symbolically dump op_flags and op_private. Now that the MAD code
has been removed, they are each only used once, so inline them.

9 years agoUpdate Pod-Perldoc to CPAN version 3.24
Chris 'BinGOs' Williams [Thu, 21 Aug 2014 10:35:53 +0000 (11:35 +0100)]
Update Pod-Perldoc to CPAN version 3.24

  [DELTA]

3.24 - Tue Aug 19 03:38:07 UTC 2014
    * Release 3.24

    Make sure when we open a filehandle for reading
    or writing, we set ':encoding(UTF-8)' on it
    everywhere.  Closes RT#98019.

3.23_01 - Sat Aug 16 16:47:45 UTC 2014
    * Test release to test UTF8 filehandles.
    * Happy CPAN Day!

9 years agoUpdate Socket version in Maintainers.pl
Chris 'BinGOs' Williams [Thu, 21 Aug 2014 10:34:14 +0000 (11:34 +0100)]
Update Socket version in Maintainers.pl

9 years agoUpdate Test-Harness to CPAN version 3.33
Chris 'BinGOs' Williams [Thu, 21 Aug 2014 10:32:26 +0000 (11:32 +0100)]
Update Test-Harness to CPAN version 3.33

  [DELTA]

3.33
        - Various documentation fixes (Leon Timmermans, Justin Cook)

9 years agoUpdate experimental to CPAN version 0.010
Chris 'BinGOs' Williams [Thu, 21 Aug 2014 10:07:03 +0000 (11:07 +0100)]
Update experimental to CPAN version 0.010

  [DELTA]

0.010     2014-08-19 17:47:20+02:00 Europe/Amsterdam
          Add returning 1's to evals in tests

0.009     2014-08-16 13:43:53+02:00 Europe/Amsterdam
          Hardcode features for perl < 5.15.7

9 years agoIEEE quadruple exponents were off.
Jarkko Hietaniemi [Thu, 21 Aug 2014 02:48:05 +0000 (22:48 -0400)]
IEEE quadruple exponents were off.

9 years agoModule::CoreList version number bump
Peter Martini [Thu, 21 Aug 2014 11:23:39 +0000 (07:23 -0400)]
Module::CoreList version number bump

9 years agoVersion bump addendum; changed a 5.21.1 to .3
Peter Martini [Thu, 21 Aug 2014 06:35:17 +0000 (02:35 -0400)]
Version bump addendum; changed a 5.21.1 to .3

The note on backwards compatibility notes that this
may not be binary compatible with version 5.21.1 or earlier.
That should float to always be one subversion behind the current,
so bumping it to 5.21.3.

9 years agoBump version number from 5.21.3 to 5.21.4
Peter Martini [Thu, 21 Aug 2014 06:32:55 +0000 (02:32 -0400)]
Bump version number from 5.21.3 to 5.21.4

9 years agoNew perldelta.
Peter Martini [Thu, 21 Aug 2014 06:02:48 +0000 (02:02 -0400)]
New perldelta.

9 years agoModule-CoreList CPAN version synchronisation
Chris 'BinGOs' Williams [Thu, 21 Aug 2014 09:50:39 +0000 (10:50 +0100)]
Module-CoreList CPAN version synchronisation

9 years agoEpigraph for 5.21.3
Peter Martini [Thu, 21 Aug 2014 05:39:04 +0000 (01:39 -0400)]
Epigraph for 5.21.3

9 years agoMerge branch 'release-5.21.3' into blead
Peter Martini [Thu, 21 Aug 2014 05:17:36 +0000 (01:17 -0400)]
Merge branch 'release-5.21.3' into blead

9 years agoScowl. 19 should have been '[VERSION]'
Peter Martini [Thu, 21 Aug 2014 02:47:01 +0000 (22:47 -0400)]
Scowl.  19 should have been '[VERSION]'

And I should have noticed that before I hit 'send'!

9 years agoperldelta: cleanup per JHI's comment origin/release-5.21.3 v5.21.3
Peter Martini [Wed, 20 Aug 2014 20:20:05 +0000 (16:20 -0400)]
perldelta: cleanup per JHI's comment

9 years agoAdd new release to perlhist
Peter Martini [Wed, 20 Aug 2014 08:23:26 +0000 (04:23 -0400)]
Add new release to perlhist