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

Allow True/False/None in grammar? #1268

Closed
lars-reimann opened this issue Nov 24, 2024 · 1 comment · Fixed by #1272
Closed

Allow True/False/None in grammar? #1268

lars-reimann opened this issue Nov 24, 2024 · 1 comment · Fixed by #1272
Labels
enhancement 💡 New feature or request released Included in a release

Comments

@lars-reimann
Copy link
Member

lars-reimann commented Nov 24, 2024

Is your feature request related to a problem?

Unlike in Python, all our keywords are lowercase, including true, false, and null. Users who come from Python may accidentally use True, False, and None instead, which leads to lexer errors.

Desired solution

We may allow the Python keywords in the grammar, but forbid them using validation checks.

Possible alternatives (optional)

True, False, and None are parsed as a reference in an expression context. We may instead change the scoping error message if these references cannot be resolved.

Screenshots (optional)

No response

Additional Context (optional)

The downside is that True, False, and None would become reserved keywords in the language. Since uppercase names only occur in stubs, though, it should not be a major deal.

@lars-reimann lars-reimann added the enhancement 💡 New feature or request label Nov 24, 2024
@lars-reimann lars-reimann added this to DSL Nov 24, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DSL Nov 24, 2024
@lars-reimann lars-reimann linked a pull request Nov 24, 2024 that will close this issue
lars-reimann added a commit that referenced this issue Nov 24, 2024
Closes #1268

### Summary of Changes

* Improve default error message of the linker.
* Add a default resolution to the message that might solve the issue
(check spelling and imports).
* Add special resolutions, if users likely used Python keywords instead
of Safe-DS keywords by accident (e.g. `True` instead of `true`).
@github-project-automation github-project-automation bot moved this from Backlog to ✔️ Done in DSL Nov 24, 2024
lars-reimann pushed a commit that referenced this issue Nov 24, 2024
## [0.22.0](v0.21.1...v0.22.0) (2024-11-24)

### Features

* categorize API elements ([#1263](#1263)) ([d0d971e](d0d971e)), closes [#1243](#1243)
* disable inlay hints for assignee types by default ([#1260](#1260)) ([a651ade](a651ade))
* improve error messages from linker ([#1272](#1272)) ([eddd868](eddd868)), closes [#1268](#1268)
* output statement ([#1262](#1262)) ([011ba31](011ba31)), closes [#1259](#1259)
* remove schema concept from grammar ([#1273](#1273)) ([1a3bf80](1a3bf80)), closes [#1133](#1133)
@lars-reimann
Copy link
Member Author

🎉 This issue has been resolved in version 0.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request released Included in a release
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

1 participant