Skip to content

Commit f7af623

Browse files
committed
Use concrete refs in macro parser state struct
It's recently come to my attention that RefValue is actually what Ref looks like at a glance.
1 parent 41b2446 commit f7af623

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/styledmarkup.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ Its fields are as follows:
7777
- `pending_styles::Vector{Tuple{UnitRange{Int}, Union{Symbol, Expr, Pair{Symbol, Any}}}}`,
7878
A list of styles that have been terminated, and so are known to occur over a certain range,
7979
but have yet to be applied.
80-
- `offset::Ref{Int}`, a record of the between the `content` index and the index in the resulting
80+
- `offset::RefValue{Int}`, a record of the between the `content` index and the index in the resulting
8181
styled string, as markup structures are absorbed.
82-
- `point::Ref{Int}`, the current index in `content`.
83-
- `escape::Ref{Bool}`, whether the last character seen was an escape character.
84-
- `interpolated::Ref{Bool}`, whether any interpolated values have been seen. Knowing whether or not
82+
- `point::RefValue{Int}`, the current index in `content`.
83+
- `escape::RefValue{Bool}`, whether the last character seen was an escape character.
84+
- `interpolated::RefValue{Bool}`, whether any interpolated values have been seen. Knowing whether or not
8585
anything needs to be evaluated allows the resulting string to be computed at macroexpansion time,
8686
when possible.
8787
- `errors::Vector`, any errors raised during parsing. We collect them instead of immediately throwing
@@ -97,10 +97,10 @@ struct State
9797
parts::Vector{Any}
9898
active_styles::Vector{Vector{Tuple{Int, Int, Union{Symbol, Expr, Pair{Symbol, Any}}}}}
9999
pending_styles::Vector{Tuple{UnitRange{Int}, Union{Symbol, Expr, Pair{Symbol, Any}}}}
100-
offset::Ref{Int}
101-
point::Ref{Int}
102-
escape::Ref{Bool}
103-
interpolated::Ref{Bool}
100+
offset::Base.RefValue{Int}
101+
point::Base.RefValue{Int}
102+
escape::Base.RefValue{Bool}
103+
interpolated::Base.RefValue{Bool}
104104
errors::Vector
105105
end
106106

0 commit comments

Comments
 (0)