summary refs log tree commit diff stats
path: root/changelog.md
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-12-12 06:35:15 +0100
committerGitHub <noreply@github.com>2018-12-12 06:35:15 +0100
commit3a70d18b84d777b9c38f33692d3bf2aa1c0d1a85 (patch)
tree0745dc548a41f9f2798a66f68507b56014915ab3 /changelog.md
parentc682671feae3ae6c90416152f84b274cb5aa4a21 (diff)
parentc0a47f7e22039100123eea34a3cb2c956a9eb829 (diff)
downloadNim-3a70d18b84d777b9c38f33692d3bf2aa1c0d1a85.tar.gz
Merge pull request #9755 from flaviut/nre-missing-match
Fix for #9243, nre returns "" instead of nil for missing matches 
Diffstat (limited to 'changelog.md')
-rw-r--r--changelog.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index 093ea7ae2..9c1b218f5 100644
--- a/changelog.md
+++ b/changelog.md
@@ -31,6 +31,25 @@
 
 - `options.UnpackError` is no longer a ref type and inherits from `System.Defect` instead of `System.ValueError`.
 
+- nre's `RegexMatch.{captureBounds,captures}[]`  no longer return `Option` or
+  `nil`/`""`, respectivly. Use the newly added `n in p.captures` method to
+  check if a group is captured, otherwise you'll recieve an exception.
+
+- nre's `RegexMatch.{captureBounds,captures}.toTable` no longer accept a
+  default parameter. Instead uncaptured entries are left empty. Use
+  `Table.getOrDefault()` if you need defaults.
+
+- nre's `RegexMatch.captures.{items,toSeq}` now returns an `Option[string]`
+  instead of a `string`. With the removal of `nil` strings, this is the only
+  way to indicate a missing match. Inside your loops, instead of `capture ==
+  ""` or `capture == nil`, use `capture.isSome` to check if a capture is
+  present, and `capture.get` to get its value.
+
+- nre's `replace()` no longer throws `ValueError` when the replacement string
+  has missing captures. It instead throws `KeyError` for named captures, and
+  `IndexError` for un-named captures. This is consistant with
+  `RegexMatch.{captureBounds,captures}[]`.
+
 #### Breaking changes in the compiler
 
 - The compiler now implements the "generic symbol prepass" for `when` statements