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

Missing spaces in .key files are ignored #3538

Open
mattulbrich opened this issue Jan 20, 2025 · 3 comments
Open

Missing spaces in .key files are ignored #3538

mattulbrich opened this issue Jan 20, 2025 · 3 comments

Comments

@mattulbrich
Copy link
Member

mattulbrich commented Jan 20, 2025

Description

In a .key file, there needs not be a space after a \backslash_keyword. But this should be reported.

Reproducible

always

Steps to reproduce

Load the following example

\rules {
  \lemmanospaces {
  \schemaVar \termint t;
  \find(t+0)
  \replacewith(t)
  };
}

\problem { 5+0=5 }

It will parse – unexpectedly. You can then also apply the rule "nospaces".

It should not parse

Additional information

The problem is that there is no lexer rule for essentially \[a-z]* in the key lexer which would match againt "\termint" to rule it out.
Perhaps adding that lexer rule would solve the issue.

(I assign this to Alexander @wadoon since he implemented the new KeYParser.)


@wadoon
Copy link
Member

wadoon commented Jan 20, 2025

fix on #3021

@mattulbrich
Copy link
Member Author

mattulbrich commented Jan 20, 2025

#3021 is quite a heavyweight change touching 70 files which happens to include the onliner

Image

which fixes this issue.

wadoon added a commit to wadoon/key that referenced this issue Jan 20, 2025
@wadoon
Copy link
Member

wadoon commented Jan 20, 2025

I was just on this branch, fixed it there. What is needed is the line above, and some fixes in the KeY file, (e.g., b6201c6#diff-a47d36ef63c8dd7f5770c4f9c4ded9efbfc5bee601e0d8b7e645ab3f0f21d322)

Errors in the key formatter were hidden by this "feature":

Image

@wadoon wadoon added this to the v2.12.4 milestone Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants