Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0b38ca9
Atomically load the lowered program (#610)
natecook1000 Oct 6, 2022
335a0c2
Add tests for line start/end word boundary diffs (#616)
natecook1000 Dec 2, 2022
54ff516
Add tweaks for Android
finagolfin Dec 5, 2022
eb7f801
Fix documentation typo (#615)
ole Dec 6, 2022
c51e8f2
Fix abstract for Regex.dotMatchesNewlines(_:). (#614)
amartini51 Dec 6, 2022
45f752a
Remove `RegexConsumer` and fix its dependencies (#617)
natecook1000 Dec 14, 2022
ed95066
Improve StringProcessing and RegexBuilder documentation (#611)
natecook1000 Dec 14, 2022
c34cea5
Set availability for inverted character class test (#621)
natecook1000 Dec 16, 2022
3ca8b13
Merge pull request #618 from buttaface/droid
Azoy Dec 18, 2022
3a3dc7a
Add type annotations in RegexBuilder tests
natecook1000 Feb 1, 2023
6c4f291
Workaround for fileprivate array issue
natecook1000 Feb 1, 2023
7e059b7
Merge pull request #628 from apple/result_builder_changes_workaround
natecook1000 Feb 1, 2023
6a4077f
Fix an issue where named character classes weren't getting converted …
DaveEwing Feb 1, 2023
8184fc0
Merge pull request #629 from apple/dewing/CharacterClassDSLConversion
DaveEwing Feb 2, 2023
2a78475
Stop at end of search string in TwoWaySearcher (#631)
natecook1000 Feb 8, 2023
d5a6cec
Correct misspelling in DSL renderer (#627)
natecook1000 Feb 8, 2023
7756942
Fix output type mismatch with RegexBuilder (#626)
natecook1000 Feb 9, 2023
070e0ec
Revert "Merge pull request #628 from apple/result_builder_changes_wor…
natecook1000 Feb 15, 2023
1358fc0
Use `some` syntax in variadics
natecook1000 Feb 15, 2023
083d32a
Type checker workaround: adjust test
milseman Apr 2, 2023
ca92db7
Further refactor to work around type checker regression
milseman Apr 3, 2023
336f9c5
Merge pull request #643 from milseman/typechecker_workaround
milseman Apr 3, 2023
852b890
Align availability macro with OS versions (#641)
milseman Apr 4, 2023
236b47c
Speed up general character class matching (#642)
milseman Apr 4, 2023
348e6c3
Test for \s matching CRLF when scalar matching (#648)
natecook1000 Apr 4, 2023
a7ba701
General ascii fast paths for character classes (#644)
milseman Apr 4, 2023
e01e43d
Remove the unsupported `anyScalar` case (#650)
natecook1000 Apr 4, 2023
e0352a2
Fix range-based quantification fast path (#653)
natecook1000 Apr 11, 2023
923cf5e
Add in ASCII fast-path for anyNonNewline (#654)
milseman Apr 11, 2023
9ea9936
Avoid long expression type checks (#657)
natecook1000 Apr 11, 2023
58626cc
Processor cleanup (#655)
milseman Apr 14, 2023
4418183
Fix `firstRange(of:)` search (#656)
natecook1000 Apr 14, 2023
57b343d
Bug fix and hot path for quantified `.` (#658)
milseman Apr 18, 2023
6695027
Run scalar-semantic benchmark variants (#659)
milseman Apr 18, 2023
8eafd55
Refactor operations to be on String (#664)
milseman Apr 19, 2023
0354667
Provide unique generic method parameter names (#669)
natecook1000 May 16, 2023
98d5ddc
Enable quantification optimizations for scalar semantics (#671)
milseman May 22, 2023
84bc9c8
Merge remote-tracking branch 'origin/main' into swift/main
milseman May 22, 2023
59fce2f
Remove redundant test
milseman May 24, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor operations to be on String (#664)
Finish refactoring logic onto String
  • Loading branch information
milseman authored Apr 19, 2023
commit 8eafd55fe3f0e5261c6e92365a6a6c6785670cbc
4 changes: 2 additions & 2 deletions Sources/RegexBenchmark/Utils/Stats.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Foundation
enum Stats {}

extension Stats {
// Maximum allowed standard deviation is 5% of the median runtime
static let maxAllowedStdev = 0.05
// Maximum allowed standard deviation is 7.5% of the median runtime
static let maxAllowedStdev = 0.075

static func tTest(_ a: Measurement, _ b: Measurement) -> Bool {
// Student's t-test
Expand Down
14 changes: 7 additions & 7 deletions Sources/_StringProcessing/Engine/MEBuiltins.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension Processor {
isStrictASCII: Bool,
isScalarSemantics: Bool
) -> Bool {
guard let next = input._matchBuiltinCC(
guard let next = input.matchBuiltinCC(
cc,
at: currentPosition,
isInverted: isInverted,
Expand Down Expand Up @@ -123,7 +123,7 @@ extension Processor {
extension String {
// TODO: Should the below have a `limitedBy` parameter?

func _matchAnyNonNewline(
func matchAnyNonNewline(
at currentPosition: String.Index,
isScalarSemantics: Bool
) -> String.Index? {
Expand All @@ -145,7 +145,7 @@ extension String {
}

@inline(__always)
func _quickMatchAnyNonNewline(
private func _quickMatchAnyNonNewline(
at currentPosition: String.Index,
isScalarSemantics: Bool
) -> QuickResult<String.Index?> {
Expand All @@ -165,7 +165,7 @@ extension String {
}

@inline(never)
func _thoroughMatchAnyNonNewline(
private func _thoroughMatchAnyNonNewline(
at currentPosition: String.Index,
isScalarSemantics: Bool
) -> String.Index? {
Expand All @@ -187,7 +187,7 @@ extension String {
// TODO: Should the below have a `limitedBy` parameter?

// Mentioned in ProgrammersManual.md, update docs if redesigned
func _matchBuiltinCC(
func matchBuiltinCC(
_ cc: _CharacterClassModel.Representation,
at currentPosition: String.Index,
isInverted: Bool,
Expand Down Expand Up @@ -222,7 +222,7 @@ extension String {

// Mentioned in ProgrammersManual.md, update docs if redesigned
@inline(__always)
func _quickMatchBuiltinCC(
private func _quickMatchBuiltinCC(
_ cc: _CharacterClassModel.Representation,
at currentPosition: String.Index,
isInverted: Bool,
Expand All @@ -240,7 +240,7 @@ extension String {

// Mentioned in ProgrammersManual.md, update docs if redesigned
@inline(never)
func _thoroughMatchBuiltinCC(
private func _thoroughMatchBuiltinCC(
_ cc: _CharacterClassModel.Representation,
at currentPosition: String.Index,
isInverted: Bool,
Expand Down
18 changes: 12 additions & 6 deletions Sources/_StringProcessing/Engine/MEQuantify.swift
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
extension Processor {
func _doQuantifyMatch(_ payload: QuantifyPayload) -> Input.Index? {
// FIXME: is the below updated for scalar semantics?
// TODO: This optimization is only enabled for grapheme cluster semantics,
// we want these for scalar semantics as well.

switch payload.type {
case .bitset:
return input.matchBitset(
registers[payload.bitset], at: currentPosition, limitedBy: end)
registers[payload.bitset],
at: currentPosition,
limitedBy: end,
isScalarSemantics: false)
case .asciiChar:
return input.matchScalar(
UnicodeScalar.init(_value: UInt32(payload.asciiChar)),
at: currentPosition,
limitedBy: end,
boundaryCheck: true)
boundaryCheck: true,
isCaseInsensitive: false)
case .builtin:
// FIXME: bounds check? endIndex or end?

// We only emit .quantify if it consumes a single character
return input._matchBuiltinCC(
return input.matchBuiltinCC(
payload.builtin,
at: currentPosition,
isInverted: payload.builtinIsInverted,
Expand All @@ -29,7 +35,7 @@ extension Processor {
return input.index(after: currentPosition)
}

return input._matchAnyNonNewline(
return input.matchAnyNonNewline(
at: currentPosition, isScalarSemantics: false)
}
}
Expand All @@ -41,7 +47,7 @@ extension Processor {
var trips = 0
var extraTrips = payload.extraTrips
var savePoint = startQuantifierSavePoint()

while true {
if trips >= payload.minTrips {
if extraTrips == 0 { break }
Expand Down
Loading