Skip to content
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

Error if problem name is empty #282

Open
niemela opened this issue Nov 15, 2024 · 1 comment
Open

Error if problem name is empty #282

niemela opened this issue Nov 15, 2024 · 1 comment

Comments

@niemela
Copy link
Member

niemela commented Nov 15, 2024

It should be an error if a problem has an empty (i.e. empty string or only non-printable characters) name.

This is much more likely now due to the changes in the problem format from legacy. In the new format you can use \problemname to insert the problem name in the statement, in the old this will set the name to empty string.

@thorehusfeldt
Copy link
Contributor

thorehusfeldt commented Mar 14, 2025

Very cool suggestion. I would look for at least one [[:print:]] and forbid the full match ^[[:space:]]$:

#name: =~ "[[:print:]]" & !~"^[[:space:]]*$"

// The name of this problem, such as "Hello" or { en: "Hello", da: "Hej" }
name!: #name | {[string]: #name}

(I think #name would make sense in many other places where we have string.)

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

No branches or pull requests

2 participants