Skip to content

Commit

Permalink
Rename .parse-names to .uniparse
Browse files Browse the repository at this point in the history
The original name existed only as a 6.d proposal and it was decided
to align its name with other `uni*` routines for actual 6.d. The
`.parse-names` method continues to exist in Rakudo impl. It'll
issue deprecation warning in 6.d and will be removed in 6.e

Rakudo impl: rakudo/rakudo@2a8287cf89
Spec:        Raku/roast@3efe6cb8da
  • Loading branch information
zoffixznet committed Dec 22, 2017
1 parent 06a0985 commit bff42f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
7 changes: 3 additions & 4 deletions doc/Language/unicode.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ can combine numeric and named styles as well:
say "\c[482,PENGUIN]"; # OUTPUT: «Ǣ🐧␤»
In addition to using C<\c[]> inside interpolated strings, you can also use
the L<parse-names routine|/type/Str#routine_parse-names>
or the parse-names method.
the L<uniparse>:
say "DIGIT ONE".parse-names; # OUTPUT: «1␤»
say parse-names("DIGIT ONE"); # OUTPUT: «1␤»
say "DIGIT ONE".uniparse; # OUTPUT: «1␤»
say uniparse("DIGIT ONE"); # OUTPUT: «1␤»
=head2 Name Aliases
Expand Down
6 changes: 3 additions & 3 deletions doc/Type/Cool.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ Defined as:
Interprets the invocant / first argument as a L<Str|/type/Str>, and returns the
Unicode codepoint name of the first codepoint of the first character. See
L<uninames|#routine_uninames> for a routine that works with multiple codepoints, and
L<parse-names|/type/Str#method_parse-names> for the opposite direction.
L<uninames|#routine_uninames> for a routine that works with multiple
codepoints, and L<uniparse> for the opposite direction.
# Camelia in Unicode
say ‘»ö«’.uniname;
Expand Down Expand Up @@ -936,7 +936,7 @@ codepoints in that character.
say "Ḍ̇'oh".comb>>.uninames.perl;
# OUTPUT: «(("LATIN CAPITAL LETTER D WITH DOT BELOW", "COMBINING DOT ABOVE").Seq, ("APOSTROPHE",).Seq, ("LATIN SMALL LETTER O",).Seq, ("LATIN SMALL LETTER H",).Seq)␤»
See L<parse-names|/type/Str#method_parse-names> for the opposite direction.
See L<uniparse> for the opposite direction.
=head2 method unimatch
Expand Down
12 changes: 10 additions & 2 deletions doc/Type/Str.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,21 @@ See also: L«:16<FF> syntax for number literals|/syntax/Number%20literals»
sub parse-names(Str:D $names --> Str:D)
method parse-names(Str:D $names: --> Str:D)
B<DEPRECATED>. Renamed to L<uniparse>. Exists only in speculative 6.d language.
In 6.d issues deprecation warnings and will be removed entirely in 6.e.
=head2 routine uniparse
sub uniparse(Str:D $names --> Str:D)
method uniparse(Str:D $names: --> Str:D)
Takes string with comma-separated Unicode names of characters and
returns a string composed of those characters. Will L«C<fail>|/routine/fail»
if any of the characters' names are empty or not recognized. Whitespace
around character names is ignored.
say "I {parse-names 'TWO HEARTS'} Perl"; # OUTPUT: «I 💕 Perl␤»
'TWO HEARTS, BUTTERFLY'.parse-names.say; # OUTPUT: «💕🦋␤»
say "I {uniparse 'TWO HEARTS'} Perl"; # OUTPUT: «I 💕 Perl␤»
'TWO HEARTS, BUTTERFLY'.uniparse.say; # OUTPUT: «💕🦋␤»
=head2 routine split
Expand Down

0 comments on commit bff42f8

Please sign in to comment.