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 @@ -242,8 +242,8 @@ struct _Token
242242end
243243
244244"""
245- mutable struct _LexerState
246- io::IO
245+ mutable struct _LexerState{O<:IO}
246+ io::O
247247 line::Int
248248 peek_char::Union{Nothing,Char}
249249 peek_tokens::Vector{_Token}
@@ -257,12 +257,12 @@ A struct that is used to manage state when lexing. It stores:
257257 * `peek_char`: the next `Char` in the `io`
258258 * `peek_tokens`: the list of upcoming tokens that we have already peeked
259259"""
260- mutable struct _LexerState
261- io:: IO
260+ mutable struct _LexerState{O <: IO }
261+ io:: O
262262 line:: Int
263263 peek_char:: Union{Nothing,Char}
264264 peek_tokens:: Vector{_Token}
265- _LexerState (io:: IO ) = new (io, 1 , nothing , _Token[])
265+ _LexerState (io:: IO ) = new {typeof(io)} (io, 1 , nothing , _Token[])
266266end
267267
268268"""
You can’t perform that action at this time.
0 commit comments