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 parser #554

Merged
merged 4 commits into from
Nov 30, 2024
Merged

Fix parser #554

merged 4 commits into from
Nov 30, 2024

Conversation

goccy
Copy link
Owner

@goccy goccy commented Nov 29, 2024

total:[402] passed:[290] failure:[112] passedRate:[72.139305%]

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.09%. Comparing base (01f4bac) to head (341f0bd).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #554      +/-   ##
==========================================
+ Coverage   77.00%   77.09%   +0.09%     
==========================================
  Files          21       21              
  Lines        7270     7321      +51     
==========================================
+ Hits         5598     5644      +46     
- Misses       1277     1283       +6     
+ Partials      395      394       -1     

Comment on lines +521 to +528
var marker string
if len(src) == 3 {
marker = string(src)
} else {
marker = strings.TrimRightFunc(string(src[:4]), func(r rune) bool {
return r == ' ' || r == '\t' || r == '\n' || r == '\r'
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we can simplify:

Suggested change
var marker string
if len(src) == 3 {
marker = string(src)
} else {
marker = strings.TrimRightFunc(string(src[:4]), func(r rune) bool {
return r == ' ' || r == '\t' || r == '\n' || r == '\r'
})
}
marker := string(src)
if len(src) != 3 {
marker = strings.TrimRightFunc(string(src[:4]), unicode.IsSpace)
}

Copy link
Owner Author

Choose a reason for hiding this comment

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

IsSpace contains \v and others, so it does not compatible this function.
https://pkg.go.dev/unicode#IsSpace

@goccy goccy merged commit c5254d7 into master Nov 30, 2024
19 checks passed
@goccy goccy deleted the fix-parser branch November 30, 2024 01:16
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