Skip to content

[Integration] main -> swift/main #192

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 24 commits into from
Closed

[Integration] main -> swift/main #192

wants to merge 24 commits into from

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Feb 28, 2022

No description provided.

compnerd and others added 10 commits January 23, 2022 11:47
This is a first approximation of a CMake based build for this
repository.  The intent here is to localize the build rules for the
repository to allow it to be consumed during the build of the toolchain.
This allows the source list to be maintained in the repository as the
source of truth rather than be explicitly listed in the swift
repository.

For general purpose development, the SPM based build is recommended.
Unless there is a specific need for the tests to be included, testing
should be done via the SPM build.

This change is sufficient to build the content though does not perform
the install or export steps which will be required to consume the
results in the Swift build.

Example invocation:
~~~
cmake -B S:\b\16 ^
      -D CMAKE_BUILD_TYPE=Release ^
      -D ArgumentParser_DIR=S:\b\10\cmake\modules ^
      -G Ninja ^
      -S S:\SourceCache\swift-experimental-string-processing
cmake --build S:\b\16
~~~
Previously we followed PCRE's parsing of this syntax
such that it may either be an octal sequence or
backreference depending on a list of heuristics.
However this model is complicated and not particularly
intuitive, especially as there are other engines
that disambiguate using subtly different rules.

Instead, always parse `\DDD` as a backreference,
unless it begins with `0`, in which case it is an
octal sequence. This matches ICU and Java's
behavior. Once we start validating group references,
we can then start emitting an error on invalid
backreferences using this syntax, and suggest
prefixing with 0 if an octal sequence is desired.
Lots of ME stuff was annotated with vestigial public
build: add a CMake based build
@rxwei rxwei requested a review from shahmishal February 28, 2022 20:31
@rxwei
Copy link
Contributor Author

rxwei commented Feb 28, 2022

@shahmishal Could you let us know when the CI has been configured to run build-script tests on the swift/main branch?

rxwei added a commit to rxwei/swift that referenced this pull request Feb 28, 2022
Switch to using swift/main as the integration branch for apple/swift-experimental-string-processing.

Integration process documentation: swiftlang/swift-experimental-string-processing#170
Friend PR: swiftlang/swift-experimental-string-processing#192
hamishknight and others added 14 commits March 2, 2022 16:53
To avoid confusion with more general regex lexical
analysis.
Introduce a DelimiterLexer type to perform the
lexing.
This matches the behavior of the C++ lexer for
string literals.
Allow the C++ lexer to form a tok::regex_literal.
This avoids generic fallback behavior, and better
allows for things like code completion. The test
case for this will be in the C++ repo.
If a single quote is encountered with a prefix of
either `(?`, `(?(`, `\k`, `\g` or `(?C`, continue
to scan ahead to a closing `'`. Such prefixes would
not be valid endings for a regex literal anyway,
and this lets us handle the single quote variant
of their syntax.

For the group name cases, further refine this
skipping behavior by only skipping over characters
that could possibly appear in that case. This
improves diagnostic behavior by ensuring we don't
go wandering off into Swift code.
Change the default script property behavior for an
unqualified value e.g `\p{Greek}` from
`\p{Script=Greek}` to `\p{Script_Extension=Greek}`.
This is arguably the more intuitive behavior, and
matches what Perl does.
Adds a test with a `SemanticVersion` type that conforms to
`CustomRegexComponent`.
Document specially integrated modules and integration process.
This enables the `\y` and `\Y` anchors in regex literals and
`Anchor.textSegmentBoundary` in the DSL.

Note: This also includes `UnicodeScalar` conformance to
`RegexProtocol`, which acts like Unicode scalar literals in
regex literals.
@rxwei
Copy link
Contributor Author

rxwei commented Mar 3, 2022

@shahmishal I'm closing this PR since the current swift/main is equivalent to dev/8, which is fully tested. So merging swiftlang/swift#41588 without this PR is easier.

@rxwei rxwei closed this Mar 3, 2022
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.

5 participants