Skip to content

[Integration] main (f779459) -> swift/main #400

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
merged 29 commits into from
May 11, 2022
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e748aea
Add NegativeLookahead and Anchor comments (#372)
natecook1000 May 2, 2022
13342eb
Add matching support for `\p{Lc}`
hamishknight May 3, 2022
925f51b
Add parser support for `\p{L&}`
hamishknight May 3, 2022
ade8f01
Merge pull request #373 from hamishknight/case-in-prop
hamishknight May 3, 2022
c44efeb
Update ProposalOverview.md
milseman May 3, 2022
9801855
Add tests for AnyRegexOutput (#371)
milseman May 3, 2022
0e5cfa8
Rename noAutoCapture -> namedCapturesOnly
hamishknight May 4, 2022
2a4b3a6
Implement the `(?n)` option
hamishknight May 4, 2022
f22cb4f
Merge pull request #377 from hamishknight/named-captures-only
hamishknight May 4, 2022
6d833aa
Improve Unicode/UTS18 and semantic level support (#268)
natecook1000 May 5, 2022
09a385b
Support Unicode scalar names in `\p{name=...}` (#382)
natecook1000 May 6, 2022
39c0ed5
Modify DSL test to test for uncaptured backreference (#355)
natecook1000 May 6, 2022
9740416
Introduce ASTStage parameter to `parse`
hamishknight May 9, 2022
4b31736
Implement semantic diagnostics
hamishknight May 9, 2022
466b375
Validate capture lists
hamishknight May 9, 2022
c95e862
Address review feedback
hamishknight May 9, 2022
7f068dc
Merge pull request #379 from hamishknight/sema
hamishknight May 9, 2022
c16e389
Implement \R, \v, \h for character/scalar modes (#384)
natecook1000 May 9, 2022
c13980f
De-deprecate MatchingOptions.matchLevel (#390)
natecook1000 May 9, 2022
61965c3
Restrict character property fuzzy matching to "pattern whitespace"
hamishknight May 10, 2022
05e610a
Improve the wording of a diagnostic
hamishknight May 10, 2022
7752015
Introduce AST.Atom.Scalar
hamishknight May 10, 2022
f436cca
Introduce scalar sequences `\u{AA BB CC}`
hamishknight May 10, 2022
0597164
Fix invalid indexing
hamishknight May 10, 2022
0872d16
Fix source location tracking in `lexUntil`
hamishknight May 10, 2022
5b30c5b
Merge pull request #386 from hamishknight/multiscalar
hamishknight May 10, 2022
b209e4f
Tidy up build flags and fix implicit import circular dependency (#392)
rxwei May 10, 2022
f779459
Catch more unquantifiable elements (#391)
natecook1000 May 10, 2022
f37fc9b
Merge branch 'main' into main-merge
hamishknight May 11, 2022
File filter

Filter by extension

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
Modify DSL test to test for uncaptured backreference (#355)
  • Loading branch information
natecook1000 authored May 6, 2022
commit 39c0ed535b9d4ed99aa88b3e20b1a7c61e0d8bc1
48 changes: 48 additions & 0 deletions Tests/RegexBuilderTests/RegexDSLTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,54 @@ class RegexDSLTests: XCTestCase {
}
}
}

// Post-hoc captured reference w/ attempted match before capture
// #"(?:\w\1|(\w):)+"#
//
// This tests that the reference `a` simply fails to match instead of
// erroring when encountered before a match is captured into `a`. The
// matching process here goes like this:
// - the first time through, the first alternation is taken
// - `.word` matches on "a"
// - the `a` backreference fails on ":", because `a` hasn't matched yet
// - backtrack to the beginning of the input
// - now the second alternation is taken
// - `.word` matches on "a" and is captured as `a`
// - the literal ":" matches
// - proceeding from the position of the first "b" in the first alternation
// - `.word` matches on "b"
// - the `a` backreference now contains "a", and matches on "a"
// - proceeding from the position of the first "c" in the first alternation
// - `.word` matches on "c"
// - the `a` backreference still contains "a", and matches on "a"
// - proceeding from the position of the first "o" in the first alternation
// - `.word` matches on "o"
// - the `a` backreference still contains "a", so it fails on ":"
// - now the second alternation is taken
// - `.word` matches on "o" and is captured as `a`
// - the literal ":" matches
// - continuing as above from the second "b"...
try _testDSLCaptures(
("a:bacao:boco", ("a:bacao:boco", "o")),
matchType: (Substring, Substring?).self,
==
) {
// NOTE: "expression too complex to type check" when inferring the generic
// parameter.
OneOrMore {
let a = Reference(Substring.self)
ChoiceOf<(Substring, Substring?)> {
Regex {
.word
a
}
Regex {
Capture(.word, as: a)
":"
}
}
}
}
}

func testSemanticVersionExample() {
Expand Down