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

[bug] Skip correct number of escape characters #1538

Closed
ianlewis opened this issue Aug 23, 2024 · 1 comment · Fixed by #1541
Closed

[bug] Skip correct number of escape characters #1538

ianlewis opened this issue Aug 23, 2024 · 1 comment · Fixed by #1541
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ianlewis
Copy link
Owner

The correct escape characters in strings should be skipped. The current code skips a single character if an escape character is detected but it should skip as many characters as needed.

// Skip the backslash character.
if _, err := s.reader.Discard(1); err != nil {
return st, fmt.Errorf("parsing string: %w", err)
}

The escapeFunc should return the characters (or number of characters) that were escaped instead of just a bool.

type escapeFunc func(s *CommentScanner, st *stateString) (bool, error)

@ianlewis ianlewis added the bug Something isn't working label Aug 23, 2024
@ianlewis ianlewis self-assigned this Aug 23, 2024
@ianlewis ianlewis added this to the v1.0.0 milestone Aug 23, 2024
@ianlewis
Copy link
Owner Author

This doesn't really seem to be an issue for any supported languages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant