File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -248,8 +248,8 @@ struct _Token
248
248
end
249
249
250
250
"""
251
- mutable struct _LexerState
252
- io::IO
251
+ mutable struct _LexerState{O<:IO}
252
+ io::O
253
253
line::Int
254
254
peek_char::Union{Nothing,Char}
255
255
peek_tokens::Vector{_Token}
@@ -263,12 +263,12 @@ A struct that is used to manage state when lexing. It stores:
263
263
* `peek_char`: the next `Char` in the `io`
264
264
* `peek_tokens`: the list of upcoming tokens that we have already peeked
265
265
"""
266
- mutable struct _LexerState
267
- io:: IO
266
+ mutable struct _LexerState{O <: IO }
267
+ io:: O
268
268
line:: Int
269
269
peek_char:: Union{Nothing,Char}
270
270
peek_tokens:: Vector{_Token}
271
- _LexerState (io:: IO ) = new (io, 1 , nothing , _Token[])
271
+ _LexerState (io:: IO ) = new {typeof(io)} (io, 1 , nothing , _Token[])
272
272
end
273
273
274
274
"""
You can’t perform that action at this time.
0 commit comments