Skip to content

Conversation

mr-briggs
Copy link

This builds upon PR #218 and partially resolves issue #228 by adding support for exporting string literals to Typescript, Python, and Go.

This builds upon PR 1Password#218 and partially resolves issue 1Password#228. Adds support
for exporting string literals to Typescript, Python, and Go.
@mr-briggs
Copy link
Author

Just a heads up to reviewers that I'm not as familiar with Go as the other languages! I've tried to be thorough with the testing but it's definitely possible that some edge cases aren't covered.

const ContainsDollarCurly string = "${not_interpolation}"
const EndsWithOddBackslash string = `Odd number of backslashes: \\\`
const NullByte string = "Null:\x00End"
const Combining string = "é vs é"
Copy link
Author

Choose a reason for hiding this comment

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

In the original Rust string, these two accented characters are encoded differently (one as a combining accent). That's still the case here, but we've output the raw characters instead of escaped unicode, which makes them look the same here.

I think ideally, we'd export escaped unicode as-is (e.g. have const Combining string = "e\u0301 vs é"), but I wasn't sure how to achieve that.

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.

1 participant