Skip to content

Commit

Permalink
revert removing check that was not redundant after all
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Nov 9, 2021
1 parent 65bad0f commit 62992b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ class CudfRegexTranspiler {
}

case RegexSequence(parts) =>
if (isRegexChar(parts.head, '|') || isRegexChar(parts.last, '|')) {
// examples: "a|", "|b"
throw new RegexUnsupportedException(nothingToRepeat)
}
if (isRegexChar(parts.head, '{')) {
// example: "{"
// cuDF would treat this as a quantifier even though in this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ class RegularExpressionTranspilerSuite extends FunSuite with Arm {
for (javaPattern <- javaPatterns) {
val cpu = cpuContains(javaPattern, input)
val cudfPattern = new CudfRegexTranspiler().transpile(javaPattern)
val gpu = gpuContains(cudfPattern, input)
val gpu = try {
gpuContains(cudfPattern, input)
} catch {
case e: CudfException =>
fail(s"cuDF failed to compile pattern: $cudfPattern", e)
}
for (i <- input.indices) {
if (cpu(i) != gpu(i)) {
fail(s"javaPattern=${toReadableString(javaPattern)}, " +
Expand Down

0 comments on commit 62992b1

Please sign in to comment.