Skip to content

Commit 363b36d

Browse files
committed
Rename _MatchingEngine to _RegexParserSupport and fix CMake.
The _MatchingEngine module no longer contains the matching engine. It has the regex AST and parser. This patch renames it to `_RegexParserSupport`. Also fix the CMake build which has been broken for a while.
1 parent bb1f34a commit 363b36d

File tree

73 files changed

+136
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+136
-124
lines changed

Package.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ let package = Package(
1414
name: "Prototypes",
1515
targets: ["Prototypes"]),
1616
.library(
17-
name: "_MatchingEngine",
18-
targets: ["_MatchingEngine"]),
17+
name: "_RegexParserSupport",
18+
targets: ["_RegexParserSupport"]),
1919
.executable(
2020
name: "VariadicsGenerator",
2121
targets: ["VariadicsGenerator"])
@@ -27,27 +27,27 @@ let package = Package(
2727
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
2828
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2929
.target(
30-
name: "_MatchingEngine",
30+
name: "_RegexParserSupport",
3131
dependencies: [],
3232
swiftSettings: [
3333
.unsafeFlags(["-enable-library-evolution"])
3434
]),
3535
.testTarget(
3636
name: "MatchingEngineTests",
3737
dependencies: [
38-
"_MatchingEngine", "_StringProcessing"]),
38+
"_RegexParserSupport", "_StringProcessing"]),
3939
.target(
4040
name: "_CUnicode",
4141
dependencies: []),
4242
.target(
4343
name: "_StringProcessing",
44-
dependencies: ["_MatchingEngine", "_CUnicode"],
44+
dependencies: ["_RegexParserSupport", "_CUnicode"],
4545
swiftSettings: [
4646
.unsafeFlags(["-enable-library-evolution"]),
4747
]),
4848
.target(
4949
name: "RegexBuilder",
50-
dependencies: ["_StringProcessing", "_MatchingEngine"],
50+
dependencies: ["_StringProcessing", "_RegexParserSupport"],
5151
swiftSettings: [
5252
.unsafeFlags(["-enable-library-evolution"]),
5353
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"])
@@ -63,7 +63,7 @@ let package = Package(
6363
]),
6464
.target(
6565
name: "Prototypes",
66-
dependencies: ["_MatchingEngine", "_StringProcessing"]),
66+
dependencies: ["_RegexParserSupport", "_StringProcessing"]),
6767

6868
// MARK: Scripts
6969
.executableTarget(
@@ -75,14 +75,14 @@ let package = Package(
7575
name: "PatternConverter",
7676
dependencies: [
7777
.product(name: "ArgumentParser", package: "swift-argument-parser"),
78-
"_MatchingEngine",
78+
"_RegexParserSupport",
7979
"_StringProcessing"
8080
]),
8181

8282
// MARK: Exercises
8383
.target(
8484
name: "Exercises",
85-
dependencies: ["_MatchingEngine", "Prototypes", "_StringProcessing", "RegexBuilder"],
85+
dependencies: ["_RegexParserSupport", "Prototypes", "_StringProcessing", "RegexBuilder"],
8686
swiftSettings: [
8787
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"])
8888
]),

Sources/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
add_subdirectory(_Unicode)
3-
add_subdirectory(_MatchingEngine)
2+
add_subdirectory(RegexBuilder)
3+
add_subdirectory(_RegexParserSupport)
44
add_subdirectory(_StringProcessing)
55
add_subdirectory(Prototypes)
66
add_subdirectory(VariadicsGenerator)

Sources/PatternConverter/PatternConverter.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// swift run PatternConverter <regex>
1313

1414
import ArgumentParser
15-
import _MatchingEngine
15+
import _RegexParserSupport
1616
import _StringProcessing
1717

1818
@main
@@ -52,7 +52,7 @@ struct PatternConverter: ParsableCommand {
5252
let delim = experimentalSyntax ? "|" : "/"
5353
print("Converting '\(delim)\(regex)\(delim)'")
5454

55-
let ast = try _MatchingEngine.parse(
55+
let ast = try _RegexParserSupport.parse(
5656
regex,
5757
experimentalSyntax ? .experimental : .traditional)
5858

Sources/Prototypes/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ add_library(Prototypes
1515
TourOfTypes/CharacterClass.swift
1616
TourOfTypes/Literal.swift)
1717
target_link_libraries(Prototypes PUBLIC
18-
_MatchingEngine)
18+
_RegexParserSupport)

Sources/Prototypes/Combinators/Combinators.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
import _MatchingEngine
12+
import _RegexParserSupport
1313

1414
/*
1515

Sources/RegexBuilder/Anchor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
import _MatchingEngine
12+
import _RegexParserSupport
1313
@_spi(RegexBuilder) import _StringProcessing
1414

1515
public struct Anchor {

Sources/RegexBuilder/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
add_library(RegexBuilder
3+
Anchor.swift
4+
Builder.swift
5+
DSL.swift
6+
Match.swift
7+
Variadics.swift)
8+
target_compile_options(RegexBuilder PRIVATE
9+
-enable-library-evolution
10+
-Xfrontend -enable-experimental-pairwise-build-block)

Sources/RegexBuilder/DSL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
import _MatchingEngine
12+
import _RegexParserSupport
1313
@_spi(RegexBuilder) import _StringProcessing
1414

1515
extension Regex {

Sources/RegexBuilder/Variadics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// BEGIN AUTO-GENERATED CONTENT
1313

14-
import _MatchingEngine
14+
import _RegexParserSupport
1515
@_spi(RegexBuilder) import _StringProcessing
1616

1717
extension RegexComponentBuilder {

Sources/VariadicsGenerator/VariadicsGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct VariadicsGenerator: ParsableCommand {
120120
121121
// BEGIN AUTO-GENERATED CONTENT
122122
123-
import _MatchingEngine
123+
import _RegexParserSupport
124124
@_spi(RegexBuilder) import _StringProcessing
125125
126126

0 commit comments

Comments
 (0)