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

fix tokenEnd and cursor for string, template, xml literals and comments when using multibyte characters #1745

Merged
merged 5 commits into from
Dec 3, 2024

Conversation

meraedit
Copy link
Contributor

@meraedit meraedit commented Dec 2, 2024

When using multibyte characters, the tokenEnd and cursor need to be adjusted otherwise the length of string, template, xml literals and comments is not correct.

@@ -1208,6 +1212,41 @@ public void testParseUnicodeMultibyteCharacter() {
AstNode first = ((ExpressionStatement) root.getFirstChild()).getExpression();
assertEquals("𠮷", first.getString());
}

@Test
public void testParseMultibyteCharacter_StringLiteral() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is no need to start the method name with 'test' as we have the annotation. Can you please change the names to use the same pattern as for the other test (in this file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the names, but 2 unit tests which were already there started with "test" (changed those as well)

@rbri
Copy link
Collaborator

rbri commented Dec 2, 2024

@meraedit many thanks for this contribution.

The spotless checks are failing because of some format violations.

Please run './gradlew :tests:spotlessApply' to fix these violations

@rbri
Copy link
Collaborator

rbri commented Dec 2, 2024

Sorry @meraedit, still some spotless failures

@gbrail
Copy link
Collaborator

gbrail commented Dec 3, 2024

Thanks! I agree with @rbri 's comments, which you addressed, so thanks for fixing this!

@gbrail gbrail merged commit 75e9c9f into mozilla:master Dec 3, 2024
3 checks passed
@meraedit
Copy link
Contributor Author

meraedit commented Dec 3, 2024

Thank you, @rbri and @gbrail, for taking the time to review and merge the pull request!

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