[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Error String>>#copyReplacingAllRegex:with:
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] Error String>>#copyReplacingAllRegex:with: |
Date: |
Mon, 06 Feb 2006 18:43:56 +0100 |
User-agent: |
Mozilla Thunderbird 0.9 (Macintosh/20041103) |
Isaac Gouy wrote:
Seems like
String>>#copyFrom:to:replacingAllRegex:with:
expects a nil rather than a FailedMatchRegexResults ?
See
http://shootout.alioth.debian.org/gp4/benchmark.php?test=regexdna&lang=gst&id=0#log
Indeed. I attach a patch; you can include the fixed methods in the
regexdna.st file in order to run the benchmark with 2.2.
Paolo
--- orig/examples/regex.st
+++ mod/examples/regex.st
@@ -515,7 +515,7 @@
| regs beg end repl res |
regs := self searchRegex: pattern from: from to: to.
- regs notNil
+ regs matched
ifTrue: [
beg := regs from.
end := regs to.
@@ -544,7 +544,7 @@
idx := from.
[
regs := self searchRegex: regex from: idx to: to.
- regs notNil
+ regs matched
] whileTrue: [
beg := regs from.
end := regs to.