Skip to content

Modified 1451.lp to test code to permit keywords as constraint names - #2812

Merged
jajhall merged 2 commits into
latestfrom
fix-lp-reader
Feb 8, 2026
Merged

jajhall merged 2 commits into
latestfrom
fix-lp-reader

Conversation

@jajhall

@jajhall jajhall commented Feb 5, 2026

Copy link
Copy Markdown
Member

Model supplied by @khantute in #1345 failed to load - since it contains a constraint named "end" - which was interpreted as an LP keyword. However, because it's followed by ":", this is illegal in LP files.

Added code to interpret an LP keyword followed by a colon as a constraint name followed by a colon!

@codecov

codecov Bot commented Feb 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.26%. Comparing base (28a9e28) to head (93ae1b1).
⚠️ Report is 23 commits behind head on latest.

Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2812      +/-   ##
==========================================
- Coverage   80.32%   80.26%   -0.07%     
==========================================
  Files         348      348              
  Lines       86093    86162      +69     
==========================================
- Hits        69157    69154       -3     
- Misses      16936    17008      +72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jajhall

jajhall commented Feb 5, 2026

Copy link
Copy Markdown
Member Author

To clarify, @khantute, it's the keyword followed by colon that's illegal, not your use of "end" as a constraint name!

@odow

odow commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

I wrote a proper LP parser last year. Some of the grammar can be horrific!

https://jump.dev/MathOptInterface.jl/stable/submodules/FileFormats/LP/#Whether-variables-can-have-the-same-name-as-a-keyword

@jajhall
jajhall merged commit 174322d into latest Feb 8, 2026
392 of 393 checks passed
@jajhall
jajhall deleted the fix-lp-reader branch February 8, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants