Skip to content

[DO NOT MERGE] main -> 5.7 diffs #362

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

Closed
wants to merge 160 commits into from

Conversation

milseman
Copy link
Member

This is not intended for merging, it's for showing what the remaining diffs and un-cherry-picked changes are between main and 5.7

hamishknight and others added 30 commits March 18, 2022 17:57
A quick pass to flip `/.../` out of the alternatives
and into the main syntax. Still needs a bunch of
work.

Also add some commentary on a regex with `]` as the
starting character.
…n. Split out Proposed solution from Detailed design. Parallelize the structure a bit better.
This isn't actually used, as we convert to a DSL
custom character class, and then use that consumer
logic.
Convert AST escape sequences that represent a
scalar value (e.g `\f`, `n`, `\a`) into scalars in
the DSL tree. This allows the matching engine to
match against them.
@milseman
Copy link
Member Author

@swift-ci please test

@@ -76,7 +76,7 @@ let package = Package(
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"]),
.unsafeFlags(["-Xfrontend", "-disable-availability-checking"])
]),
.target(
.testTarget(
Copy link
Member Author

Choose a reason for hiding this comment

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

@rxwei can you get this (3293905) cherry-picked on to 5.7?

//
//===----------------------------------------------------------------------===//

import _StringProcessing
Copy link
Member Author

Choose a reason for hiding this comment

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

@itingliu can you get this (5af1427) cherry-picked on to 5.7?

case .endOfLine: fatalError("Not yet supported")
case .wordBoundary: return .notWordBoundary
}
var baseAssertion: DSLTree._AST.AssertionKind {
Copy link
Member Author

Choose a reason for hiding this comment

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

@natecook1000 can you get this (f8e1dc2) and others cherry-picked onto 5.7?

"C\($0+1)\(opt)"
}.joined(separator: ", ")
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@milseman can you get this (435090d) and others cherry-picked onto 5.7?

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -1,116 +0,0 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
Copy link
Member Author

Choose a reason for hiding this comment

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

@Azoy can you make sure to get everything cherry-picked onto 5.7?

/// Returns `nil` otherwise.
public func `as`<Output>(_ type: Output.Type) -> Regex<Output>? {
fatalError("FIXME: Not implemented")
}
Copy link
Member Author

Choose a reason for hiding this comment

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

@milseman can you get this (e0922ec) and others cherry-picked onto 5.7?

@@ -133,10 +133,55 @@ func customTest<Match: Equatable>(
}
}

// Test support
struct Concat : Equatable {
Copy link
Member Author

Choose a reason for hiding this comment

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

@itingliu can you get this (73a5ccf) and others cherry-picked onto 5.7?

Optionally {
Capture(as: value) {
OneOrMore(.digit)
} transform: { Int($0)! }
Copy link
Member Author

Choose a reason for hiding this comment

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

@natecook1000 can you get this (d0598b7) and others cherry-picked onto 5.7?

"a|a|||a|a|||a|a|||".split(separator: "|||", maxSplits: 2),
["a|a", "a|a", "a|a|||"])

XCTAssertEqual(
Copy link
Member Author

Choose a reason for hiding this comment

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

@natecook1000 can you get this (d6a01e7) and others cherry-picked onto 5.7?

XCTFail()
case try! Regex("abc"):
XCTFail()

Copy link
Member Author

Choose a reason for hiding this comment

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

@rxwei can you make sure the ~= overloads and tests get onto 5.7?

amartini51 and others added 8 commits April 27, 2022 11:11
Confirmed (using the command below) that this branch now contains only
changes to doc comments, changes to // comments where content was moved
into or out of a doc comment, and one spelling correction to code.

% git diff origin/main... |
    grep -v '^+ *///\|- *///' |
    grep -v '^@@' |
    grep -v '^ ' |
    grep -v '^+++\|^---' |
    grep -v '^diff --git' |
    grep -v '^index '

+  // Individual public API functions are in the generated Variadics.swift file.
+// For now, we use String as the source while prototyping...
+
+  // NOTE: Currently, this means we have raw quotes.
+  // Better would be to have real Swift string delimiter parsing logic.
+
+  // NOTE: traditional comments are not nested. Currently, we are neither.
+  // Traditional comments can't have `)`, not even escaped in them either, we
+  // can. Traditional comments can have `*/` in them, we can't without
+  // escaping. We don't currently do escaping.
+
-  // Finish, flush, and clear. Returns the rendered output
+  // Finish, flush, and clear.
+  //
+  // - Returns: The rendered output.
+  // Note: The `Script` enum includes the "meta" script type "Katakana_Or_Hiragana", which
+  // isn't defined by https://www.unicode.org/Public/UCD/latest/ucd/Scripts.txt,
+  // but is defined by https://www.unicode.org/Public/UCD/latest/ucd/PropertyValueAliases.txt.
+  // We may want to split it out, as it's the only case that is a union of
+  // other script types.
+
+// TODO: These should become aliases for the Block (blk) Unicode character
+// property.
+
-  // Ensures `.0` always refers to the whole match.
-  // Allows `.0` when `Match` is not a tuple.
-  func withInversion(_ invertion: Bool) -> Self {
+  func withInversion(_ inversion: Bool) -> Self {
-    if invertion {
+    if inversion {
Revise doc comments for API reference style.
Add the SPI interface
`swiftCompilerLexRegexLiteral` and
`swiftCompilerParseRegexLiteral` for the Swift
compiler to call into. This allows us to avoid
depending on other library API on the compiler
side, while letting it keep the bridging gunk.

While we're here, add an extra `String` return for
the parsing function that could allow us to change
the regex emission format in the future. This still
needs to be plumbed through on the complier side
though.
…wiftlang#367)

Work around the compiler bug rdar://92459215 by
using generic parameters instead of opaque result
types for a couple of methods.
Introduce CaptureList, make CaptureStructure semi-vestigial
natecook1000 and others added 6 commits May 2, 2022 15:05
This is defined in UAX#44 as being equivalent to
`Lu | Ll | Lt`.
This is a PCRE spelling for a cased letter.
* Add tests for AnyRegexOutput

Fix a few missing areas of functionality while we're at it
@milseman milseman closed this May 10, 2022
@milseman milseman deleted the 5_7_mega_glob branch May 10, 2022 16:59
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.

9 participants