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
242
242
end
243
243
244
244
"""
245
- mutable struct _LexerState
246
- io::IO
245
+ mutable struct _LexerState{O<:IO}
246
+ io::O
247
247
line::Int
248
248
peek_char::Union{Nothing,Char}
249
249
peek_tokens::Vector{_Token}
@@ -257,12 +257,12 @@ A struct that is used to manage state when lexing. It stores:
257
257
* `peek_char`: the next `Char` in the `io`
258
258
* `peek_tokens`: the list of upcoming tokens that we have already peeked
259
259
"""
260
- mutable struct _LexerState
261
- io:: IO
260
+ mutable struct _LexerState{O <: IO }
261
+ io:: O
262
262
line:: Int
263
263
peek_char:: Union{Nothing,Char}
264
264
peek_tokens:: Vector{_Token}
265
- _LexerState (io:: IO ) = new (io, 1 , nothing , _Token[])
265
+ _LexerState (io:: IO ) = new {typeof(io)} (io, 1 , nothing , _Token[])
266
266
end
267
267
268
268
"""
You can’t perform that action at this time.
0 commit comments