Skip to content

Commit

Permalink
rephrase deprecation message, remove redundant test lines
Browse files Browse the repository at this point in the history
Signed-off-by: arezaii <ahmad.rezaii@hpe.com>
  • Loading branch information
arezaii committed Nov 28, 2022
1 parent 06ed5ee commit 4bab3aa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
4 changes: 2 additions & 2 deletions modules/standard/Regex.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -1142,14 +1142,14 @@ inline operator :(x: regex(bytes), type t: bytes) {

// Cast string to regex
pragma "no doc"
deprecated "Casting strings to regex is deprecated. Use regex.compile(string) instead."
deprecated "Casting strings to regex is deprecated. Use compile(string) from the Regex module instead."
inline operator :(x: string, type t: regex(string)) throws {
return compile(x);
}

// Cast bytes to regex
pragma "no doc"
deprecated "Casting bytes to regex is deprecated. Use regex.compile(bytes) instead."
deprecated "Casting bytes to regex is deprecated. Use compile(bytes) from the Regex module instead."
inline operator :(x: bytes, type t: regex(bytes)) throws {
return compile(x);
}
Expand Down
4 changes: 2 additions & 2 deletions test/deprecated/regexTertiary.good
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
regexTertiary.chpl:8: warning: Casting strings to regex is deprecated. Use regex.compile(string) instead.
regexTertiary.chpl:9: warning: Casting bytes to regex is deprecated. Use regex.compile(bytes) instead.
regexTertiary.chpl:8: warning: Casting strings to regex is deprecated. Use compile(string) from the Regex module instead.
regexTertiary.chpl:9: warning: Casting bytes to regex is deprecated. Use compile(bytes) from the Regex module instead.
regexTertiary.chpl:11: warning: string.search is deprecated, use regex search instead
regexTertiary.chpl:12: warning: bytes.search is deprecated, use regex search instead
regexTertiary.chpl:14: warning: string.search is deprecated, use regex search instead
Expand Down
10 changes: 0 additions & 10 deletions test/regex/bytes/cast.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ use Regex;
var s = "contains";
var b = b"contains";

var rs = s:regex(string);
var rb = b:regex(bytes);

writeln("contains regular expression".find(rs));
writeln(b"contains regular expression".find(rb));

writeln("doesn't contain regular expression".find(rs));
writeln(b"doesn't contain regular expression".find(rb));


var rcs = compile(s);
var rcb = compile(b);

Expand Down
6 changes: 0 additions & 6 deletions test/regex/bytes/cast.good
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
cast.chpl:8: warning: Casting strings to regex is deprecated. Use regex.compile(string) instead.
cast.chpl:9: warning: Casting bytes to regex is deprecated. Use regex.compile(bytes) instead.
0
0
-1
-1
0
0
-1
Expand Down

0 comments on commit 4bab3aa

Please sign in to comment.