-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise specification after section #121
Conversation
This is probably the last thing I want to include with the current parser because it's getting too messy 😅. I'll have a go at a VRPLIB grammar soon. |
This also closes #118, right? |
@@ -79,6 +77,9 @@ def group_specifications_and_sections(lines: list[str]): | |||
end_section = start + 1 | |||
|
|||
for next_line in lines[start + 1 :]: | |||
if ":" in next_line: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a sufficient test for a specification? (probably yes but can there ever be data in a section with a colon in it?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot think of any data section that must include :
's. Only thing I can think of are strings but we should probably avoid strings in data sections as they can often be mapped to numerical values. I think we're OK if we define the VRPLIB standard to reserve :
as a specifications identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am excited about having a grammar for this so we can definitively say what's OK and what's not 😆.
Yea, linked it to the PR! |
This PR raises a ValueError when a specification is introduced after a section. Closes #118.