Skip to content

improve error message for unterminated string and character literals #22783

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

Closed
wants to merge 1 commit into from

Conversation

WillLillis
Copy link
Contributor

@WillLillis WillLillis commented Feb 6, 2025

Followup to #21459 based on this comment.

This improves the error message for unterminated string and character literals. Instead of showing the invalid byte, the error message now indicates that the given literal is unterminated.

@WillLillis WillLillis force-pushed the invalid_byte_followup branch from 1216bca to c51bd2a Compare February 6, 2025 05:26
@WillLillis WillLillis force-pushed the invalid_byte_followup branch from c51bd2a to e21162f Compare February 7, 2025 02:21
@andrewrk
Copy link
Member

The more general code that you have added special case to avoid prints this:

error: character literal contains invalid byte: '\n'

I find that to be sufficient and pleasing. No need for this added complexity.

@andrewrk andrewrk closed this Feb 23, 2025
@WillLillis WillLillis deleted the invalid_byte_followup branch February 23, 2025 04:35
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.

3 participants