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
248248end
249249
250250"""
251- mutable struct _LexerState
252- io::IO
251+ mutable struct _LexerState{O<:IO}
252+ io::O
253253 line::Int
254254 peek_char::Union{Nothing,Char}
255255 peek_tokens::Vector{_Token}
@@ -263,12 +263,12 @@ A struct that is used to manage state when lexing. It stores:
263263 * `peek_char`: the next `Char` in the `io`
264264 * `peek_tokens`: the list of upcoming tokens that we have already peeked
265265"""
266- mutable struct _LexerState
267- io:: IO
266+ mutable struct _LexerState{O <: IO }
267+ io:: O
268268 line:: Int
269269 peek_char:: Union{Nothing,Char}
270270 peek_tokens:: Vector{_Token}
271- _LexerState (io:: IO ) = new (io, 1 , nothing , _Token[])
271+ _LexerState (io:: IO ) = new {typeof(io)} (io, 1 , nothing , _Token[])
272272end
273273
274274"""
You can’t perform that action at this time.
0 commit comments