Skip to content

Commit

Permalink
Remove several deprecated features (chapel-lang#23395)
Browse files Browse the repository at this point in the history
Removes the following features:

- `OrderedSet` and `OrderedMap`: chapel-lang#18767
- `regex.matches` arguments: chapel-lang#19077
- `list.extend`/`unrolledLinkList.extend`: chapel-lang#19828
- `regex.sub`/`regex.subn`: chapel-lang#21600
- `regex.compile`: chapel-lang#21636

[Reviewed by @benharsh]

Test:
- [x] linux64
- [x] gasnet
  • Loading branch information
e-kayrakli authored Sep 15, 2023
2 parents ae1742f + 3eb782e commit 5d1d9b7
Show file tree
Hide file tree
Showing 27 changed files with 57 additions and 346 deletions.
25 changes: 0 additions & 25 deletions modules/packages/OrderedMap.chpl

This file was deleted.

25 changes: 0 additions & 25 deletions modules/packages/OrderedSet.chpl

This file was deleted.

20 changes: 0 additions & 20 deletions modules/packages/UnrolledLinkedList.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -610,26 +610,6 @@ module UnrolledLinkedList {
return result;
}

@deprecated(notes="unrolledLinkedList.extend is deprecated, please use unrolledLinkedList.append")
proc ref extend(other: list(eltType, ?p)) lifetime this < other {
append(other);
}

@deprecated(notes="unrolledLinkedList.extend is deprecated, please use unrolledLinkedList.append")
proc ref extend(other: unrolledLinkedList(eltType, ?p)) lifetime this < other {
append(other);
}

@deprecated(notes="unrolledLinkedList.extend is deprecated, please use unrolledLinkedList.append")
proc ref extend(other: [?d] eltType) lifetime this < other {
append(other);
}

@deprecated(notes="unrolledLinkedList.extend is deprecated, please use unrolledLinkedList.append")
proc ref extend(other: range(eltType, ?b, ?d)) lifetime this < other {
append(other);
}

@chpldoc.nodoc
proc ref _insert(idx: int, in x: eltType)
lifetime this < x {
Expand Down
15 changes: 0 additions & 15 deletions modules/standard/List.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -1036,21 +1036,6 @@ module List {
return result;
}

@deprecated(notes="list.extend is deprecated, please use list.append")
proc ref extend(other: list(eltType, ?p)) lifetime this < other {
pushBack(other);
}

@deprecated(notes="list.extend is deprecated, please use list.append")
proc ref extend(other: [?d] eltType) lifetime this < other {
pushBack(other);
}

@deprecated(notes="list.extend is deprecated, please use list.append")
proc ref extend(other: range(eltType, ?b, ?d)) lifetime this < other {
pushBack(other);
}

/*
Insert an element at a given position in this list, shifting all elements
currently at and following that index one to the right. The call
Expand Down
113 changes: 0 additions & 113 deletions modules/standard/Regex.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -412,63 +412,6 @@ class BadRegexError : Error {
}
}

/*
Compile a regular expression. This routine will throw a
class:`BadRegexError` if compilation failed.
.. warning::
This procedure is deprecated. Please use :proc:`regex.init` via ``new
regex()``.
:arg pattern: the regular expression to compile. This argument can be string
or bytes. See :ref:`regular-expression-syntax` for details.
Note that you may have to escape backslashes. For example, to
get the regular expression ``\s``, you'd have to write
``"\\s"`` because the ``\`` is the escape character within
Chapel string/bytes literals. Note that, Chapel supports
triple-quoted raw string/bytes literals, which do not require
escaping backslashes. For example ``"""\s"""`` or ``b"""\s"""``
can be used.
:arg posix: (optional) set to true to disable non-POSIX regular expression
syntax
:arg literal: (optional) set to true to treat the regular expression as a
literal (ie, create a regex matching ``pattern`` as a string
rather than as a regular expression).
:arg noCapture: (optional) set to true in order to disable all capture groups
in the regular expression
:arg ignoreCase: (optional) set to true in order to ignore case when
matching. Note that this can be set inside the regular
expression with ``(?i)``.
:arg multiLine: (optional) set to true in order to activate multiline mode
(meaning that ``^`` and ``$`` match the beginning and end
of a line instead of just the beginning and end of the text.
Note that this can be set inside a regular expression
with ``(?m)``.
:arg dotAll: (optional) set to true in order to allow ``.``
to match a newline. Note that this can be set inside the
regular expression with ``(?s)``.
:arg nonGreedy: (optional) set to true in order to prefer shorter matches for
repetitions; for example, normally x* will match as many x
characters as possible and x*? will match as few as possible.
This flag swaps the two, so that x* will match as few as
possible and x*? will match as many as possible. Note that
this flag can be set inside the regular expression with
``(?U)``.
:throws BadRegexError: If the argument 'pattern' has syntactical errors.
Refer to https://github.com/google/re2/blob/master/re2/re2.h
for more details about error codes.
*/
@deprecated(notes="'Regex.compile' is deprecated. Please use 'new regex()' instead.")
proc compile(pattern: ?t, posix=false, literal=false, noCapture=false,
/*i*/ ignoreCase=false, /*m*/ multiLine=false, /*s*/ dotAll=false,
/*U*/ nonGreedy=false): regex(t) throws where t==string || t==bytes {
return new regex(pattern, posix, literal, noCapture, ignoreCase, multiLine,
dotAll, nonGreedy);
}

/* The regexMatch record records a regular expression search match
or a capture group.
Expand Down Expand Up @@ -557,7 +500,6 @@ record chpl_serializeHelper {

/* This record represents a compiled regular expression. Regular expressions
are currently cached on a per-thread basis and are reference counted.
To create a compiled regular expression, use the proc:`compile` function.
A string-based regex can be cast to a string (resulting in the pattern that
was compiled). A string can be cast to a string-based regex (resulting in a
Expand Down Expand Up @@ -999,61 +941,6 @@ record regex : serializable {
}
}

pragma "last resort"
@deprecated(notes="regex.matches arguments 'captures' and 'maxmatches' are deprecated. Use 'numCaptures' and/or 'maxMatches instead.")
iter matches(text: exprType, param captures=0, maxmatches: int = max(int))
{
for m in matches(text, numCaptures=captures, maxMatches=maxmatches) {
yield m;
}
}

/* Perform the same operation as :proc:`regex.sub` but return a tuple
containing the new text and the number of substitutions made.
.. warning::
This method is deprecated. Please use :proc:`string.replaceAndCount`.
:arg repl: replace matches with this string or bytes
:arg text: the text to search and replace within
:type text: `string` or `bytes`
:arg global: if true, replace multiple matches
:returns: a tuple containing (new text, number of substitutions made)
*/
@deprecated(notes="regex.subn is deprecated. Please use string.replaceAndCount.")
proc subn(repl: exprType, text: exprType, global = true ):(exprType, int)
{
if global then
return text.replaceAndCount(this, repl);
else
return text.replaceAndCount(this, repl, 1);
}

/*
Find matches to this regular expression and create a new string or bytes in
which those matches are replaced by repl.
.. warning::
This method is deprecated. Please use :proc:`string.replace` with `regex`
argument.
:arg repl: replace matches with this string or bytes
:arg text: the text to search and replace within
:type text: `string` or `bytes`
:arg global: if true, replace multiple matches
:returns: the new string or bytes
*/
@deprecated(notes="regex.sub is deprecated. Please use string.replace.")
proc sub(repl: exprType, text: exprType, global = true )
{
if global then
return text.replace(this, repl);
else
return text.replace(this, repl, count=1);
}

// TODO this could use _serialize to get the pattern and options
@chpldoc.nodoc
proc writeThis(f) throws {
Expand Down
16 changes: 0 additions & 16 deletions test/deprecated/listExtend.chpl

This file was deleted.

4 changes: 0 additions & 4 deletions test/deprecated/listExtend.good

This file was deleted.

7 changes: 0 additions & 7 deletions test/deprecated/oMap.chpl

This file was deleted.

2 changes: 0 additions & 2 deletions test/deprecated/oMap.good

This file was deleted.

8 changes: 0 additions & 8 deletions test/deprecated/oSet.chpl

This file was deleted.

2 changes: 0 additions & 2 deletions test/deprecated/oSet.good

This file was deleted.

5 changes: 0 additions & 5 deletions test/deprecated/regexCompile.chpl

This file was deleted.

2 changes: 0 additions & 2 deletions test/deprecated/regexCompile.good

This file was deleted.

1 change: 0 additions & 1 deletion test/deprecated/regexCompile.skipif

This file was deleted.

9 changes: 0 additions & 9 deletions test/deprecated/regexMatchesArgs.chpl

This file was deleted.

2 changes: 0 additions & 2 deletions test/deprecated/regexMatchesArgs.good

This file was deleted.

1 change: 0 additions & 1 deletion test/deprecated/regexMatchesArgs.skipif

This file was deleted.

7 changes: 0 additions & 7 deletions test/deprecated/regexSubSubn.chpl

This file was deleted.

4 changes: 0 additions & 4 deletions test/deprecated/regexSubSubn.good

This file was deleted.

1 change: 0 additions & 1 deletion test/deprecated/regexSubSubn.skipif

This file was deleted.

16 changes: 0 additions & 16 deletions test/deprecated/unrolledLinkedListExtend.chpl

This file was deleted.

4 changes: 0 additions & 4 deletions test/deprecated/unrolledLinkedListExtend.good

This file was deleted.

Empty file.
Empty file.
2 changes: 0 additions & 2 deletions test/unstable/packageModules.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import LockFreeStack;
import MPI;
import MatrixMarket;
import NetCDF;
import OrderedMap;
import OrderedSet;
import PeekPoke;
import Prefetch;
import ProtobufProtocolSupport;
Expand Down
Loading

0 comments on commit 5d1d9b7

Please sign in to comment.