Skip to content

[5.7] Tighten up some syntax rules #428

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

Conversation

hamishknight
Copy link
Contributor

5.7 cherry-pick of #393

  • 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 added the r5.7 5.7 Release Cherry Picks label May 23, 2022
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 3c1c93a into swiftlang:swift/release/5.7 May 24, 2022
@hamishknight hamishknight deleted the stricter-syntax-5.7 branch May 24, 2022 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r5.7 5.7 Release Cherry Picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants