Skip to content

Commit 2bf6592

Browse files
committed
Update
1 parent b5702df commit 2bf6592

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/FileFormats/LP/read.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,25 @@ end
275275
function _peek_inner(state::LexerState)
276276
while (c = peek(state, Char)) !== nothing
277277
if c == '\n'
278-
read(state, Char)
279-
return Token(_TOKEN_NEWLINE, "\n")
278+
_ = read(state, Char)
279+
return Token(_TOKEN_NEWLINE, nothing)
280280
elseif isspace(c) # Whitespace
281-
read(state, Char)
281+
_ = read(state, Char)
282282
elseif c == '\\' # Comment: backslash until newline
283283
while (c = read(state, Char)) !== nothing && c != '\n'
284284
end
285285
elseif isdigit(c) || (c == '-' && isdigit(peek(state, Char))) # Number
286286
buf = IOBuffer()
287287
while (c = peek(state, Char)) !== nothing && _is_number(c)
288288
write(buf, c)
289-
read(state, Char)
289+
_ = read(state, Char)
290290
end
291291
return Token(_TOKEN_NUMBER, String(take!(buf)))
292292
elseif _is_starting_identifier(c) # Identifier / keyword
293293
buf = IOBuffer()
294294
while (c = peek(state, Char)) !== nothing && _is_identifier(c)
295295
write(buf, c)
296-
read(state, Char)
296+
_ = read(state, Char)
297297
end
298298
val = String(take!(buf))
299299
l_val = lowercase(val)
@@ -315,17 +315,17 @@ function _peek_inner(state::LexerState)
315315
end
316316
return Token(_TOKEN_IDENTIFIER, val)
317317
elseif (op = get(_OPERATORS, c, nothing)) !== nothing
318-
read(state, Char) # Skip c
318+
_ = read(state, Char) # Skip c
319319
if c == '-' && peek(state, Char) == '>'
320-
read(state, Char)
321-
return Token(_TOKEN_IMPLIES, "->")
320+
_ = read(state, Char)
321+
return Token(_TOKEN_IMPLIES, nothing)
322322
elseif c == '=' && peek(state, Char) in ('<', '>')
323323
c = read(state, Char) # Allow =< and => as <= and >=
324-
return Token(_OPERATORS[c], string(c))
324+
return Token(_OPERATORS[c], nothing)
325325
elseif c in ('<', '>', '=') && peek(state, Char) == '='
326326
_ = read(state, Char) # Allow <=, >=, and ==
327327
end
328-
return Token(op, string(c))
328+
return Token(op, nothing)
329329
else
330330
throw(UnexpectedToken(Token(_TOKEN_UNKNOWN, "$c")))
331331
end

test/FileFormats/LP/LP.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ function test_parse_number()
12891289
state = LP.LexerState(io)
12901290
@test LP._parse_number(state, cache) == result
12911291
end
1292-
for input in ["x", "abc", "ten"]
1292+
for input in ["x", "abc", "ten", "1.1.1", "1eE1"]
12931293
io = IOBuffer(input)
12941294
seekstart(io)
12951295
state = LP.LexerState(io)

0 commit comments

Comments
 (0)