@@ -206,16 +206,16 @@ cmp(a::AnnotatedString, b::AnnotatedString) = cmp(a.string, b.string)
206
206
# To prevent substring equality from hitting the generic fallback
207
207
208
208
function == (a:: SubString{<:AnnotatedString} , b:: SubString{<:AnnotatedString} )
209
- eval ( Expr ( :new , SubString{ typeof (a. string. string)} , a. string. string, a. offset, a. ncodeunits) ) ==
210
- eval ( Expr ( :new , SubString{ typeof (b. string. string)} , b. string. string, b. offset, b. ncodeunits) ) &&
209
+ @raw_substring ( typeof (a. string. string), a. string. string, a. offset, a. ncodeunits) ==
210
+ @raw_substring ( typeof (b. string. string), b. string. string, b. offset, b. ncodeunits) &&
211
211
annotations (a) == annotations (b)
212
212
end
213
213
214
214
== (a:: SubString{<:AnnotatedString} , b:: AnnotatedString ) =
215
- annotations (a) == annotations (b) && eval ( Expr ( :new , SubString{ typeof (a. string. string)} , a. string. string, a. offset, a. ncodeunits) ) == b. string
215
+ annotations (a) == annotations (b) && @raw_substring ( typeof (a. string. string), a. string. string, a. offset, a. ncodeunits) == b. string
216
216
217
217
== (a:: SubString{<:AnnotatedString} , b:: AbstractString ) =
218
- isempty (annotations (a)) && eval ( Expr ( :new , SubString{ typeof (a. string. string)} , a. string. string, a. offset, a. ncodeunits) ) == b
218
+ isempty (annotations (a)) && @raw_substring ( typeof (a. string. string), a. string. string, a. offset, a. ncodeunits) == b
219
219
220
220
== (a:: AbstractString , b:: SubString{<:AnnotatedString} ) = b == a
221
221
@@ -264,7 +264,7 @@ function annotatedstring(xs...)
264
264
push! (annotations, (rstart: rstop, annot))
265
265
end
266
266
end
267
- print (s, eval ( Expr ( :new , SubString{ typeof (x. string. string)} , x. string. string, x. offset, x. ncodeunits) ))
267
+ print (s, @raw_substring ( typeof (x. string. string), x. string. string, x. offset, x. ncodeunits))
268
268
elseif x isa AnnotatedChar
269
269
for annot in x. annotations
270
270
push! (annotations, (1 + size: 1 + size, annot))
0 commit comments