Commit graph

254 commits

Author SHA1 Message Date
Andrei Alexandrescu
f639a9bc3d Merge pull request #4473 from WalterBright/unisafetoString
make safe inference of std.uni toString() work
2016-06-25 16:01:04 -05:00
Walter Bright
73cda6193f make safe inference of std.uni toString() work 2016-06-25 03:43:58 -07:00
Leandro Motta Barros
7907869129 Fixed typo: "below" instead of "bellow". 2016-06-18 15:54:10 -03:00
Andrei Alexandrescu
7172eda466 Merge pull request #4327 from tsbockman/isPowerOf2
Add `std.math.isPowerOf2()`. Supports floating-point and integers.
2016-06-16 23:09:02 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
Walter Bright
16099c6ec5 fix
Issue 14136 - std.uni.utfMatcher breaks @safety
2016-06-07 05:09:12 -07:00
tsbockman
18d1b436e4 Update Phobos to use the new std.math.isPowerOf2() everywhere.
`std.uni` looks like it may depend upon its local `isPowerOf2()` implementation
to return `true` for `0`. Since the semantics are different from the standard
version, I have renamed it to `isPow2OrZero()` to avoid confusion.
2016-06-04 21:19:38 -07:00
Joakim
a839be6dcc Fix five modules where imports were made more local and selective. 2016-06-04 00:09:48 +05:30
Joakim
6ced417517 std.uni: roll back module-scope selective import that slipped through, revert this once allowed 2016-06-02 15:55:32 +05:30
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00
anonymous
d648f9320e XREF_PACK -> REF (sed)
Done by:

from='\$\(XREF_PACK\s+([^(),]*),\s*([^(),]*),\s*([^(),]*)\)'
to='$(REF \3, std,\1,\2)'
(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r "s/$from/$to/g"
2016-05-27 21:32:46 +02:00
anonymous
764caefa36 XREF -> REF (sed)
Done by:

(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r \
    's/\$\(XREF\s+([^(),]*),\s*([^(),]*)\)/$(REF \2, std,\1)/g'
2016-05-27 21:32:46 +02:00
Dmitry Olshansky
519ff9fa46 Merge pull request #4365 from joakim-noah/uni_imports
std.uni: use selective imports and document module-scope imported symbols
2016-05-27 13:53:00 +04:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Joakim
19e5af264f std.uni: use selective imports and document symbols imported at module scope, checked with ddmd 2016-05-26 04:20:49 +05:30
Sebastian Wilzbach
f2edef56ea fix table formatting in uni.d 2016-05-25 03:53:03 +02:00
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Dmitry Olshansky
e378f3e0cc Merge pull request #4304 from JackStouffer/uni
Clean up of std.uni (part 2)
2016-05-11 16:29:28 +04:00
Jack Stouffer
a37b1168ac Fixed long lines in std/uni.d 2016-05-10 20:51:39 -04:00
Dmitry Olshansky
478d08d2b8 Merge pull request #4295 from JackStouffer/conv
Clean up of std.uni
2016-05-10 21:12:44 +04:00
Jack Stouffer
a8c4b4dd28 Changed all total, non-global imports in std.uni to selective imports 2016-05-10 11:12:47 -04:00
Jack Stouffer
628417716e Make public undocumented functions package and fix broken documentation 2016-05-10 10:47:59 -04:00
Dmitry Olshansky
f257e8330e Merge pull request #4297 from jondegenhardt/toCaser-Ascii-check
ASCII optimization check in toCaser, for asLowerCase and asUpperCase
2016-05-10 17:12:52 +04:00
Jon Degenhardt
49f9c8226f Review feedback: formatting. 2016-05-10 04:34:58 -07:00
Jon Degenhardt
afc28fb093 Add ASCII optimization check to toCaser, for asLowerCase and asUpperCase. 2016-05-10 02:29:15 -07:00
Jack Stouffer
5f7ac08ca0 replace custom equal function with the one from std.algorithm 2016-05-09 21:23:48 -04:00
Jack Stouffer
64056b8b91 Removed functions that had std.math analogs 2016-05-09 21:08:44 -04:00
Jack Stouffer
5e40a7553a Fix Issue 11229: Add ASCII case for string versions of std.uni.toLower/toUpper 2016-05-09 17:38:53 -04:00
Jack Stouffer
afd54b5f1c Improve docs for icmp 2016-04-28 15:01:16 -04:00
Jack Stouffer
7922bc8d6e Fix Issue 15964: The template constraints for std.uni.sicmp are too permissive 2016-04-28 11:25:38 -04:00
k-hara
59b8791d2d fix Issue 15963 - Hidden unresolved forward reference issue in std.uni
Add explicit return type to two auto functions `Grapheme.opSlice`, then
their calls will have no dependency to return type inference.
2016-04-28 10:21:10 +09:00
Dmitry Olshansky
c1027f1970 Merge pull request #4246 from wilzbach/sed_spaces_part_2
style fix: add space after 'for' operator
2016-04-27 16:17:18 +04:00
Sebastian Wilzbach
d1714c9afb minor style fixes 2016-04-27 04:18:22 +03:00
Sebastian Wilzbach
5a8988c149 style fix: add space after for operator 2016-04-27 02:04:02 +03:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Dmitry Olshansky
11f8935aaf Merge pull request #4150 from JackStouffer/isNumber
std.uni.isPunctuation: significant performance increase for ASCII
2016-04-11 15:39:28 +04:00
Jack Stouffer
3fed73960f Added ASCII optimization for isPunctuation 2016-04-09 15:49:13 -04:00
Jack Stouffer
966a058530 Fix-up for PR #4137 2016-04-09 15:49:07 -04:00
Dmitry Olshansky
e7d23db2c0 Merge pull request #4151 from JackStouffer/issue13422
[Issue 13422] std.ascii has isAlphaNum but std.uni doesn't
2016-04-05 19:02:31 +04:00
Jack Stouffer
0c642797cd Fix Issue 13422: std.ascii has isAlphaNum but std.uni doesn't 2016-04-04 23:06:29 -04:00
Jack Stouffer
e47d5f3f3e std.uni.isNumber: significant performance increase for ASCII numbers 2016-04-01 16:11:01 -04:00
Steven Schveighoffer
b0acb7a394 Fix remaining import deprecation messages 2016-02-22 16:03:12 -05:00
Martin Nowak
ce2ac192c9 fix incorrect imports/fqn usages
- mostly of the form `import a.b : sym; a.b.sym();`, which is wrong b/c
  selective imports do not add the module to the current scope
2016-02-20 14:41:44 +01:00
anonymous
73bd032bbd fix issue 15686 - std.uni overloads documentation
No actual code changes. Just moving one overload of toLower next to the
other one.
2016-02-16 23:25:32 +01:00
David Nadlinger
6b0be3b89f Fix testAliasedString() unit test helper
Many of the functions for which this wrapper is used return
string ranges. Comparing these for object identity does not
make a lot of sense.

This is actually an issue, because toUTF, which is used in quite
a few of the tested functions, contains a void-initialized buffer,
so the identity comparison is not guaranteed to succeed. The tests
just so happen to pass on current DMD regardless, but this is not
the case for an optimized LDC build.
2016-02-14 00:28:41 +01:00
k-hara
e864e53adc fix property enforcement 2015-12-04 15:42:53 +09:00
David Nadlinger
b813578a5a Revert "New primitive - Tiny UTF Binary Search Table" 2015-11-14 20:21:37 +01:00
Brian Schott
2812f9a676 Merge pull request #3710 from DmitryOlshansky/uni-tab
New primitive - Tiny UTF Binary Search Table
2015-11-07 23:22:41 -08:00
Dmitry Olshansky
aba3fe84a3 New primitive - Tiny UTF Binary Search Table
This lays on the foundation of UTF word notion,
a 32-bit integer that contains UTF encoded codepoint.
Top non-zero byte is the UTF-8 starter, so it's BigEndian
when reading directly from strings.

Same applies to UTF-16 word.

Also this invents simpler API for matching that easily combines:
 - length of code point matched
 - result of match (true/false if belongs to this set)
 - bad encoding flag

in one packed 32-bit machine word - UtfLookup. This struct is
going to be reused for all of "directly on UTF" matchers in std.uni.
2015-11-07 13:40:47 +03:00