Skip to content

Tighten up some syntax rules #393

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 3 commits into from
May 13, 2022

Conversation

hamishknight
Copy link
Contributor

  • Ban numeric escapes in custom character classes e.g [\7]. In PCRE, this is an octal sequence, but we require a 0 prefix.
  • Ban multiple-scalar non-letter non-digit ASCII characters, as they may be confusable with metacharacters.
  • Reserve <{...}> for a future interpolation syntax.

Resolves #303

PCRE treats them as octal, but we require a `0`
prefix.
Ban multi-scalar characters that start with ASCII,
and are not letters, numbers, or `\r\n`. These
may be confused with metacharacters and as such
should be spelled explicitly.
Ban a balanced set of `<{...}>` delimiters for a
potential future interpolation syntax.
@hamishknight hamishknight requested a review from milseman May 10, 2022 11:34
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 9cf3cfc into swiftlang:main May 13, 2022
@hamishknight hamishknight deleted the stricter-syntax branch May 13, 2022 14:21
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.

Regex parser should be wary of combining characters
2 participants