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

JSON5: fix escape sequences #187

Conversation

david-maison-TrustInSoft
Copy link
Contributor

According to the specification https://spec.json5.org/#escapes , as far as I understand :

  • \' should be ' in the returned string (not \')
  • \" should be " (not \")
  • and other characters should be returned without the leading backslash too (e.g., \a -> a)

However, I did not understand what happened for \1 to \9, so I kept the former behavior: rejecting the escape sequence.

…t for escape sequences for other regular char
Copy link
Member

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I agree that this is an issue. I like that there's a test, making sure it is correct but while here I think it would be nice to also properly map the other escape sequences.

@Leonidas-from-XIV Leonidas-from-XIV merged commit b8561df into ocaml-community:master Mar 28, 2025
3 of 4 checks passed
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.

2 participants