Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privatize annotated string API, take two #55845

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions base/public.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ public
ImmutableDict,
OneTo,
LogRange,
AnnotatedString,
AnnotatedChar,
UUID,

# Annotated strings
annotatedstring,
annotate!,
annotations,

# Semaphores
Semaphore,
acquire,
Expand Down
14 changes: 0 additions & 14 deletions base/strings/annotated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ the combined range.
See also [`AnnotatedChar`](@ref), [`annotatedstring`](@ref),
[`annotations`](@ref), and [`annotate!`](@ref).

!!! warning
While the constructors are part of the Base public API, the fields
of `AnnotatedString` are not. This is to allow for potential future
changes in the implementation of this type. Instead use the
[`annotations`](@ref), and [`annotate!`](@ref) getter/setter
functions.

# Constructors

```julia
Expand Down Expand Up @@ -81,13 +74,6 @@ More specifically, this is a simple wrapper around any other
See also: [`AnnotatedString`](@ref), [`annotatedstring`](@ref), `annotations`,
and `annotate!`.

!!! warning
While the constructors are part of the Base public API, the fields
of `AnnotatedChar` are not. This it to allow for potential future
changes in the implementation of this type. Instead use the
[`annotations`](@ref), and [`annotate!`](@ref) getter/setter
functions.

# Constructors

```julia
Expand Down
19 changes: 14 additions & 5 deletions doc/src/base/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ Core.String(::AbstractString)
Base.SubString
Base.LazyString
Base.@lazy_str
Base.AnnotatedString
Base.AnnotatedChar
Base.annotatedstring
Base.annotations
Base.annotate!
Base.transcode
Base.unsafe_string
Base.ncodeunits(::AbstractString)
Expand Down Expand Up @@ -101,3 +96,17 @@ Base.escape_string
Base.escape_raw_string
Base.unescape_string
```

## `AnnotatedString`s

!!! note
The API for AnnotatedStrings is considered experimental and is subject to change between
Julia versions.

```@docs
Base.AnnotatedString
Base.AnnotatedChar
Base.annotatedstring
Base.annotations
Base.annotate!
```
4 changes: 4 additions & 0 deletions doc/src/manual/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,10 @@ last backslash escapes a quote, since these backslashes appear before a quote.

## [Annotated Strings](@id man-annotated-strings)

!!! note
The API for AnnotatedStrings is considered experimental and is subject to change between
Julia versions.

It is sometimes useful to be able to hold metadata relating to regions of a
string. A [`AnnotatedString`](@ref Base.AnnotatedString) wraps another string and
allows for regions of it to be annotated with labelled values (`:label => value`).
Expand Down