Skip to content

Commit

Permalink
Merge pull request #56 from ceedubs/document-limitations
Browse files Browse the repository at this point in the history
Document limitations
  • Loading branch information
ceedubs committed Jun 14, 2019
2 parents eb0050e + 3eda9f7 commit 9ede7ec
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ Gen.listOfN(3, phraseGen).apply(Gen.Parameters.default, Seed(1046527L))
// )
```

## warnings and limitations

At the moment, irrec does not support the following features:

* **capturing and backreferences** (ex: using `hello, (\w+)` and capturing the string that matched `\w+`)
* **lookarounds** (ex: `(?=...)` for positive lookahead, `?<=...)` for negative lookahead)
* **non-greedy matches** (ex: `.*?`)
* **inline modifiers** (ex: `(?i)` for case-insensitive mode)
* **anchors** (ex: `\b`, `^`, `$`)
* some other odds and ends that are probably mostly straightforward to support if desired

Irrec only checks that an entire string matches a regex, as though the regex had a leading `^` and a trailing `$`.

The wildcard `.` matches on newlines (consistent with a `DOTALL` flag being turned on in some regular expression implementations).

Some of these limitations would probably be pretty easy to remove. Others might be tough to address with the current design of irrec.

## getting irrec

If you are using SBT, you can add irrec as a dependency to your project with:
Expand Down
17 changes: 17 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ val phraseGen: Gen[String] = regexMatchingStringGen(arbitrary[Char])(phrase)
Gen.listOfN(3, phraseGen).apply(Gen.Parameters.default, Seed(1046527L))
```

## warnings and limitations

At the moment, irrec does not support the following features:

* **capturing and backreferences** (ex: using `hello, (\w+)` and capturing the string that matched `\w+`)
* **lookarounds** (ex: `(?=...)` for positive lookahead, `?<=...)` for negative lookahead)
* **non-greedy matches** (ex: `.*?`)
* **inline modifiers** (ex: `(?i)` for case-insensitive mode)
* **anchors** (ex: `\b`, `^`, `$`)
* some other odds and ends that are probably mostly straightforward to support if desired

Irrec only checks that an entire string matches a regex, as though the regex had a leading `^` and a trailing `$`.

The wildcard `.` matches on newlines (consistent with a `DOTALL` flag being turned on in some regular expression implementations).

Some of these limitations would probably be pretty easy to remove. Others might be tough to address with the current design of irrec.

## getting irrec

If you are using SBT, you can add irrec as a dependency to your project with:
Expand Down
1 change: 0 additions & 1 deletion regex/src/main/scala/Glushkov.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ object Glushkov {
case KleeneF.Zero => List.empty
}

// TODO ceedubs formatting
def kleeneLocalTransitions[I, A](k: KleeneF[LocalLanguage[I, A]])(
implicit orderingI: Ordering[I]): SortedMap[I, List[(I, A)]] = {
implicit val orderI: Order[I] = Order.fromOrdering(orderingI)
Expand Down

0 comments on commit 9ede7ec

Please sign in to comment.