-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[language] Added byte string literal support. b"" #4058
Conversation
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
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.
Thanks for doing this! Mostly some style comments, and we will need some additional tests especially on the runtime side of things
669d77e
to
4b4a214
Compare
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
4e04779
to
752c965
Compare
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
language/move-lang/tests/move_check/parser/byte_string_success.move
Outdated
Show resolved
Hide resolved
language/move-lang/tests/move_check/parser/byte_string_invalid_escaped_sequence.exp
Outdated
Show resolved
Hide resolved
language/move-lang/tests/move_check/parser/byte_string_invalid_hex.exp
Outdated
Show resolved
Hide resolved
language/move-lang/tests/move_check/parser/byte_string_invalid_unicode.exp
Outdated
Show resolved
Hide resolved
752c965
to
86eaee7
Compare
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
86eaee7
to
f9ab9bb
Compare
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
☔ The latest upstream changes (presumably cf22ca2) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Overall, its really starting to shape up! I made some comments about style (particularly in language/move-lang/src/parser/byte_string.rs
).
But these aren't critical to getting the PR in.
I would focus on the test cases first and foremost. Then we can get in this great contribution! After it lands, I might take a pass to make the decoding logic fit more inline with the style used in the rest of the project.
filename: &'static str, | ||
start_offset: usize, | ||
buffer: Vec<u8>, | ||
escape_sequence: Option<Sequence>, |
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.
Do we really need this escape sequence field? I feel like we can just make a loop to eat the sequence in between the braces
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 think this will make it harder to handle the hex sequence. And it might make it harder to add other sequences.
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 not sure how it will make it harder to do the hex sequence? I'm envisioning a separate loop for just the hex case, where it starts and stops at the { and } respectively
I don't see any other cases being added. And if they are, I don't see this solution being better than just a separate function or loop for that case
f9ab9bb
to
98499ff
Compare
A wild Move coverage report has appeared! New coverage report
Baseline coverage report
If these two differ, you should look at updating the baseline, or adding more tests. You can get more details here |
Sorry to be slow to respond here. I had a packed schedule of meetings yesterday. I've caught up on the discussion here, and I'm pretty happy with the current PR. I see Todd had one or two comments still, so I'll leave it to him to approve. |
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.
Tests look good! As I mentioned before, I might make some changes to this after it lands, but the overall logic looks good.
Thanks for the contribution!
@bors-libra r=tnowacki |
📌 Commit 98499ff has been approved by |
Cluster Test Result
Repro cmd:
|
☀️ Test successful - checks-actions_land_blocking_test, checks-circle_commit_workflow |
Motivation
Added byte string literal support. b""
Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
Unit test.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/libra/website, and link to your PR here.)