-
Notifications
You must be signed in to change notification settings - Fork 45
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
Store unescaped content in StringLiteral.value and raw content in StringLiteral.raw #203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using .val
and .raw_val
in compare-locales, and I'm very unhappy about that. Just yesterday had to change one for the other, because the difference isn't obvious.
That said, maybe that's OK within this context, but we'll need comments for that.
Also, please keep the current semantics of .value
, as most tools use that and will want to continue to use that.
How about .format_value
or .bundle_value
for the unescaped value? That indicates the API in which to use that variant?
Where would you put it?
Tools will need to be updated anyways for Syntax 08, right? That's not a good reason for not making this change. I prefer to call out the special-ness of the raw value field, which is why I called it If you feel very strongly about this, I guess we could keep |
In |
This is technically OK, but I disagree with the choice out of my own experience in compare-locales. Practically, this is going to add a significant risk in particular to the Pontoon support, as we're changing the data the existing Not going to block this, but also not going to r+ this, so removing myself from the review. |
Meh, can't find a way to actually remove myself without showing my previous r-. |
Thank you for you comment. I think I'm misunderstanding something here. When we update Pontoon to Syntax 0.8, we'll change the code which deals with |
Actually, it looks like updating the serializer to use |
My point is that I made the same exact API decision, and it's been a source of bugs (just this week, actually). That said, I don't want to spend more time on this ticket. |
OK, thanks again. I'm going to merge this as-is. |
This also forbids escape sequences representing surrogate code points, following @Pike's suggestion from #194 (comment). If we allow them, then their handling becomes environment/implementation dependent. E.g. they are ill-formed in the UTF-8 encoding.