Commit graph

13645 commits

Author SHA1 Message Date
Sebastian Wilzbach
148fe78f95 Revert @trusted hotfix for std.uni 2018-07-19 18:29:18 +02:00
Sebastian Wilzbach
4211eecbe4
Merge pull request #6626 from wilzbach/renable-dip1000
[WIP] Re-enable -dip1000 on auto-tester + fix CircleCi
2018-07-19 16:27:02 +02:00
Sebastian Wilzbach
cfaf974dcb Re-enable -dip1000 on auto-tester + fix CircleCi 2018-07-19 14:56:25 +02:00
Sebastian Wilzbach
a01488689a
Merge pull request #6637 from aG0aep6G/19094
fix issue 19094 - Anchored section does not exist in std.uni.normaliz…
2018-07-19 14:53:51 +02:00
aG0aep6G
91659e60fe fix issue 19094 - Anchored section does not exist in std.uni.normalize phobos documentation 2018-07-18 16:53:03 +02:00
The Dlang Bot
3d41721141
Merge pull request #6497 from Zevenberge/feature/15732
Fix issue 15732 - std.function partial does not work with function / delegate references
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-07-15 13:06:31 +02:00
The Dlang Bot
53fc9912a6
Merge pull request #5755 from FreeSlave/public_statTimeToStdTime
Make statTimeToStdTime public
merged-on-behalf-of: unknown
2018-07-15 12:47:32 +02:00
The Dlang Bot
c7b1cf1994
Merge pull request #6576 from BBasile/rnd-cov-nogc-buff
RandomCover use a `@nogc` buffer to store already chosen results
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-07-15 12:25:40 +02:00
The Dlang Bot
25951d6f7a
Merge pull request #6617 from tylerknott/issue-16639
Fix issue 16639 - Review std.json wrt this article on JSON edge cases and ambiguities
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-07-11 17:41:49 +02:00
Martin Nowak
89a3990a4d Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-07-06 22:14:10 +02:00
Sebastian Wilzbach
224a1f83ee
Merge pull request #6625 from MartinNowak/merge_stable
Merge remote-tracking branch 'upstream/stable' into merge_stable
2018-07-06 01:36:37 +02:00
wazar
39bb4d7ae8 fix AA test: order of AA elements isn't determined 2018-07-05 02:02:27 +03:00
aG0aep6G
4338d3405b make "grapheme" a link
Clarifying the element type.
2018-07-04 18:18:27 +02:00
Martin Nowak
633e0635a1 Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-07-04 00:15:32 +02:00
Sebastian Wilzbach
320d4f85a7
Merge pull request #6622 from kinke/fixEffectiveAlignment
[stable] Fix std.experimental.allocator.common.effectiveAlignment()
2018-07-03 08:08:42 +02:00
Zevenberge
7d1af27290 Checked that the functor passed to partial has some opCall 2018-07-01 12:02:56 +02:00
Sebastian Wilzbach
510a14c401
Merge pull request #6611 from MartinNowak/merge_stable
Merge remote-tracking branch 'upstream/stable' into merge_stable
2018-06-30 22:08:09 +02:00
Sebastian Wilzbach
90a8fc387f
Merge pull request #6489 from dukc/staticArray
Static array UFCS-style
2018-06-30 21:18:11 +02:00
Sebastian Wilzbach
c246113423 Fix auto function without return statement 2018-06-30 20:39:22 +02:00
Sebastian Wilzbach
737f32e2a9
Merge pull request #6620 from jmdavis/stdio
Remove unnecessary conflicts in std.stdio.
2018-06-30 20:37:02 +02:00
Sebastian Wilzbach
2060d3809b
Merge pull request #6616 from wilzbach/bump-dscanner4
Bump Dscanner to 6d526bbf25ce662587c10d7e52bae800585f6846
2018-06-30 13:34:15 +02:00
dukc
16881035dc Addressed Andrei's review. 2018-06-29 22:18:12 +02:00
Timothee Cour
e191a7d6a4 Fixes Issue 16745 - Add template helper for creating static arrays with the size inferred 2018-06-29 22:18:12 +02:00
Martin Kinkelin
cce577165b Fix std.experimental.allocator.common.effectiveAlignment()
It was unable to handle alignments > 2^31 bytes, e.g., returning 2 for
the 64-bit pointer 0x2FA_00000000. Return a size_t instead of a uint.
Note that it's only called in one place, an assertion in a ctor of the
BitmappedBlockImpl mixin, which handles size_t fine.

This fixes sporadic
std.experimental.allocator.building_blocks.bitmapped_block unittest
failures for LDC CI on Win64 (something like 1 out of 100 runs failing).
2018-06-29 19:23:37 +02:00
The Dlang Bot
0e8722abbd
Merge pull request #6471 from schveiguy/putstrings
char[] and wchar[] should be output ranges
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-06-29 10:04:28 +02:00
Jonathan M Davis
7e9a2615f2 Remove unnecessary conflicts in std.stdio.
fopen and popen wrap C functions that exist in druntime, and it's not
uncommon for folks to end up accidentally trying to use the private
functions in std.stdio instead of the ones from druntime - which then
tends to result in questions on D.Learn. There's no reason that either
of these private functions needs to be named the same as the C function
that it wraps. It just causes confusion when folks accidentally try to
use them instead of the C functions.

So, this changes them to _fopen and _popen so that there will be no such
conflict, and the error messages when folks try to call the C functions
but do so incorrectly will not mention std.stdio's internals.
2018-06-28 20:57:59 -06:00
The Dlang Bot
dcfb5d1e58
Merge pull request #6618 from jmdavis/scope_datetime_systime
Clean up use of scope in std.datetime.systime.
merged-on-behalf-of: Jonathan M Davis <jmdavis@users.noreply.github.com>
2018-06-28 23:10:48 +02:00
Sebastian Wilzbach
8115d50f14 Fix auto function without return statement 2018-06-28 10:58:14 +02:00
Jonathan M Davis
371ed2c475 Clean up use of scope in std.datetime.systime.
This removes unnecessary uses of scope, adds a lot of necessary uses of
scope, and adds basic tests that ensure that each of the functions in
std.datetime.systime compile when given scope arguments. It also enables
some previously commented out tests involving immutable SysTimes (IIRC,
they didn't use to compile due to compiler bugs related to
Rebindable!(immutable TimeZone), but they now compiler, so they should
be enabled).
2018-06-27 21:27:43 -06:00
Tyler Knott
20353df3d9 Fix issue 16639 - Review std.json wrt this article on JSON edge cases and ambiguities
The test corpus provided at https://github.com/nst/JSONTestSuite/ revealed some issues with the std.json.parseJSON function. Since addressing some of the issues required parseJSON to reject input it previously accepted, I have added a new JSONOptions.strictParsing flag so callers can opt-in to the stricter parsing.

The issues, and how I've addressed them, are listed below (approximately from most severe to least):

Silently dropping ASCII NUL characters from strings:
n_string_unescaped_crtl_char.json

This is the most serious problem I found while fixing the test cases. The current implementation of parseJSON() uses a helper function called peekChar() which can store the next character to handle in a variable of type Char (an alias of the character type). Unfortunately it was using 0 to indicate it has not read a character yet so if an ASCII NUL (which will have the value 0) is present in the text and someone reads it with peekChar() then it will effectively be skipped over, which was happening in string and whitespace parsing.

I changed peekChar() to use a Nullable!Char as the temporary storage for the next character to disambiguate the case where there is no pending unconsumed character from the case where there is a pending unconsumed ASCII NUL. In strict mode JSON with unescaped ASCII NULs in strings will throw an exception while in non-strict mode the JSON will be accepted with the NUL included in the string value.

Failure to accept ASCII DEL (0x7f) unescaped in strings:
y_string_unescaped_char_delete.json
y_string_with_del_character.json

These were the only test cases that std.json rejected that it should have accepted. This issue was addressed by changing the string parsing logic to explicitly check for character values < 0x20 instead of using std.ascii.isControl (which also returned true for 0x7f), with a special exception for ASCII NULs in non-strict mode as mentioned above.

Parsing "true", "false", and "null" tokens case-insensitively:
n_structure_capitalized_True.json

In strict mode those tokens are now parsed case-sensitively.

Accepting control characters other than ' ', '\t', '\r', and '\n' as whitespace:
n_structure_null-byte-outside-string.json
n_structure_whitespace_formfeed.json

In strict mode only the listed characters are accepted as whitespace, while non-strict mode continues to use std.ascii.isWhite with an additional exception for ASCII NUL for a similar reason as the n_string_unescaped_ctrl_char.json case (the skipWhitespace() function used peekChar() so it didn't handle ASCII NULs consistently; non-strict mode after my changes is actually more permissive than the previous behavior but it is at least consistently permissive).

Silently accepting empty data:
n_structure_no_data.json

In strict mode an exception is now thrown instead of returning an empty value.

Failure to enforce that numbers beginning with 0 cannot have any additional digits in the non-fractional part:
n_number_-01.json
n_number_neg_int_starting_with_zero.json
n_number_with_leading_zero.json

An additional check is now performed in strict mode when the whole part of a number begins with zero to ensure trailing digits are not present.

Failure to check for trailing characters after parsing:
n_array_comma_after_close.json
n_array_extra_close.json
n_multidigit_number_then_00.json
n_object_trailing_comment.json
n_object_trailing_comment_open.json
n_object_trailing_comment_slash_open_incomplete.json
n_object_trailing_comment_slash_open.json
n_object_with_trailing_garbage.json
n_string_with_trailing_garbage.json
n_structure_array_trailing_garbage.json
n_structure_array_with_extra_array_close.json
n_structure_close_unopened_array.json
n_structure_double_array.json
n_structure_number_with_trailing_garbage.json
n_structure_object_followed_by_closing_object.json
n_structure_object_with_trailing_garbage.json
n_structure_trailing_#.json

An additional check is now performed in strict mode to ensure any trailing characters after the initial JSON value are only whitespace.

In addition to the above issues, parseJSON() will throw ConvException for numbers out of the range of double/long/ulong which was not previously documented. I have updated the ddoc comment to reference that exception.
2018-06-27 21:29:00 -05:00
The Dlang Bot
da273092e7
Merge pull request #6525 from joakim-noah/fpu
std.math fixes for ARM
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-06-27 07:48:37 +02:00
David Bennett
5c9b11901a Speedup text() wtext() and dtext() by allowing them to add chars to it's own appender rather then using to! then coping them back. 2018-06-27 05:03:47 +09:30
The Dlang Bot
ec8bb20d28
Merge pull request #6591 from jmdavis/issue_17732_again
Fix issue 12507: SysTime.init.toString() segfaults.
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2018-06-26 13:33:50 +02:00
Jonathan M Davis
9b1f72d89b Fix issue 12507: SysTime.init.toString() segfaults.
This adds a special TimeZone type internal to SysTime which _timezone is
directly initialized to so that SysTime.init will work without
segfaulting but will still be uniquely identifiable with the is
operator. Or at least, _timezone is _supposed_ to be directly
initialized to it, but issue# 17740 currently prevents that. So,
_timezone has been temporarily renamed to _timezoneStorage and private
getters and setters named _timezone have been added. The getter then
does a null check and returns InitTimeZone() for SysTime.init to
simulate the member variable having been initialized to InitTimeZone().
Once issue# 17740 has been fixed, these accessors will be unnecessary,
and the code should be updated so that _timezone is properly a variable
again and is directly initialized with InitTimeZone().

The new TimeZone type - InitTimeZone - is internal to SysTime and can
only be obtained by the timezone getter on SysTime.init. It acts the
same as UTC except that it is not special-cased by the to*String
functions and thus will print out its timezone as +00:00 instead of z,
which is perfectly legitimate per the spec. And as such, if _timezone
were directly initialized with InitTimeZone(), there would be no extra
checks due to this change, and everything would just work. However,
until issue# 17740 is fixed, there will be an extra null check any time
that a function is called on _timezone, because _timezone is currently a
wrapper that does a null check rather than being a member variable
directly like it's supposed to be.

Unlike previous attempts along these lines, this does not make it so
that SysTime.init has NaN behavior such that any operation (other than
assignment) on an an uninitialized SysTime would result in SysTime.init,
and the timezone setter property does not set the SysTime to
SysTime.init if it's passed this TimeZone. So, unfortunately, it _is_
possible to have other SysTime values with the special TimeZone, but it
was deemed unnecessarily complex for too little benefit to add the NaN
behavior. And regardless, SysTime.init is still uniquely identifiable
via the is operator. It's just that it can't technically be uniquely
identified by the timezone getter, which was never a supported feature
anyway.
2018-06-26 02:22:49 -06:00
The Dlang Bot
9c9718bad4
Merge pull request #6541 from wilzbach/markdown-path
Remove invalid Markdown backticks in std.path
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-06-26 03:16:23 +02:00
The Dlang Bot
9334f46371
Merge pull request #6610 from jmdavis/scope_const_date
Remove const scope from value types in std.datetime.date.
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-06-26 01:19:15 +02:00
Martin Nowak
13bfc065de Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-06-25 19:20:29 +02:00
Martin Nowak
3c1a43e587
Merge pull request #6608 from aG0aep6G/findSplit
fix findSplit and friends (issues 19020, 19023)
2018-06-25 15:18:02 +02:00
Martin Nowak
75feb5726a
Merge pull request #6537 from aG0aep6G/18937
fix issue 18937 - [REG 2.080.0] std.experimental.allocator: compiling…
2018-06-25 15:14:47 +02:00
Sebastian Wilzbach
7d89379af8
Merge pull request #6609 from jmdavis/deprecations_timezone
Remove deprecated functions from std.datetime.timezone.
2018-06-25 06:56:06 +02:00
Jonathan M Davis
9e09703b8c Remove const scope from value types in std.datetime.date.
None of these uses of const scope should be required, because Date,
TimeOfDay, and DateTime are all value types with no indirections.
2018-06-24 19:38:12 -06:00
Jonathan M Davis
e3de72cfea Remove deprecated functions from std.datetime.timezone. 2018-06-24 18:03:51 -06:00
aG0aep6G
0b8f203041 fix issue 19023 - findSplitBefore and findSplitAfter give wrong bool result 2018-06-24 23:00:00 +02:00
aG0aep6G
93faca7ed5 fix issue 19020 - findSkip, findSplit and findSplitBefore return wrong results 2018-06-24 22:49:55 +02:00
Joakim
c37092a5bf std.math: IEEE Quadruple-precision fixes for AArch64 2018-06-24 16:33:55 +05:30
Joakim
789843992e std.math: sign of NaN returned by remainder with zero divisor doesn't matter 2018-06-24 16:33:55 +05:30
Joakim
f85f98ee60 std.math: only version out tests that rely on a FPU with D_HardFloat 2018-06-24 16:33:55 +05:30
Sebastian Wilzbach
c810c56538 Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-06-24 12:38:18 +02:00
The Dlang Bot
d682187cfe
Merge pull request #6598 from Alexibu/patch-1
Document deprecation of TimeZone.getTimeZone
merged-on-behalf-of: Jonathan M Davis <jmdavis@users.noreply.github.com>
2018-06-24 12:15:26 +02:00
The Dlang Bot
67a86ee574
Merge pull request #6602 from WalterBright/date-in
dip1000: std.datetime.date replace 'in' with 'scope const'
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2018-06-24 11:19:51 +02:00