Skip to content

Some trivia fixes #431

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

Merged
merged 9 commits into from
May 25, 2022
Merged

Some trivia fixes #431

merged 9 commits into from
May 25, 2022

Conversation

hamishknight
Copy link
Contributor

Use this to replace the various places we're doing
`var src = self`.
We don't have to handle bailing early, the loop
will terminate if we don't lex another operator.
Make sure an inverted character class does not
dump the same as a regular character class.
`expectQuoted` expects non-empty contents, which
doesn't apply to comments.
PCRE does not allow whitespace here, instead
treating the sequence as literal if whitespace is
present. However this behavior is quite
unintuitive. Instead, lex whitespace between range
operands.
Previously we would only parse non-semantic
whitespace, but also expand to end-of-line
comments, which are supported by ICU.
Factor out the logic that deals with parsing an
individual character class member, and interleave
`lexTrivia` calls between range operand parsing.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight requested a review from milseman May 24, 2022 10:40
Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

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

LGTM

@hamishknight hamishknight merged commit bd9bf23 into swiftlang:main May 25, 2022
@hamishknight hamishknight deleted the trivia-pursuit branch May 25, 2022 12:44
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.

Allow end-of-line comments in custom character classes Allow empty inline comments Non-semantic whitespace doesn't work for character class ranges
2 participants