Skip to content

Commit 9b9c175

Browse files
committed
Update
1 parent 4c35875 commit 9b9c175

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/FileFormats/LP/read.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,13 @@ function _parse_optional_name(state::LexerState, cache::Cache)
617617
return nothing
618618
end
619619

620-
# OBJECTIVE --> [NAME] EXPRESSION
620+
# OBJECTIVE --> [NAME] [EXPRESSION]
621621
function _parse_objective(state::LexerState, cache::Cache)
622622
_ = _parse_optional_name(state, cache)
623+
_skip_newlines(state)
624+
if _next_token_is(state, _TOKEN_KEYWORD)
625+
return # A line like `obj:\nsubject to`
626+
end
623627
f = _parse_expression(state, cache)
624628
MOI.set(cache.model, MOI.ObjectiveFunction{typeof(f)}(), f)
625629
return

0 commit comments

Comments
 (0)