You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The @migration annotation can now be used like @Deprecation.
Old syntax is still supported, but deprecated.
Improve wording and consistency of migration messages, migration
warnings also print the version in which the change occurred now.
Partially fixes SI-4990.
Copy file name to clipboardExpand all lines: src/library/scala/util/parsing/combinator/Parsers.scala
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -89,14 +89,14 @@ trait Parsers {
89
89
sealedabstractclassParseResult[+T] {
90
90
/** Functional composition of ParseResults.
91
91
*
92
-
* @param`f` the function to be lifted over this result
92
+
* @paramf the function to be lifted over this result
93
93
* @return `f` applied to the result of this `ParseResult`, packaged up as a new `ParseResult`
94
94
*/
95
95
defmap[U](f: T=>U):ParseResult[U]
96
96
97
97
/** Partial functional composition of ParseResults.
98
98
*
99
-
* @param`f` the partial function to be lifted over this result
99
+
* @paramf the partial function to be lifted over this result
100
100
* @paramerror a function that takes the same argument as `f` and
101
101
* produces an error message to explain why `f` wasn't applicable
102
102
* (it is called when this is the case)
@@ -240,7 +240,7 @@ trait Parsers {
240
240
241
241
// no filter yet, dealing with zero is tricky!
242
242
243
-
@migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
243
+
@migration("The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
* but easier to pattern match on) that contains the result of `p` and
260
260
* that of `q`. The resulting parser fails if either `p` or `q` fails.
261
261
*/
262
-
@migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
262
+
@migration("The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
* succeeds -- evaluated at most once, and only when necessary.
273
273
* @return a `Parser` that -- on success -- returns the result of `q`.
274
274
*/
275
-
@migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
275
+
@migration("The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
* @paramq a parser that will be executed after `p` (this parser) succeeds -- evaluated at most once, and only when necessary
288
288
* @return a `Parser` that -- on success -- returns the result of `p`.
289
289
*/
290
-
@migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
290
+
@migration("The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
* `p ~! q` succeeds if `p` succeeds and `q` succeeds on the input left over by `p`.
303
303
* In case of failure, no back-tracking is performed (in an earlier parser produced by the `|` combinator).
304
304
*
305
-
* @paramq a parser that will be executed after `p` (this parser) succeeds
305
+
* @paramp a parser that will be executed after `p` (this parser) succeeds
306
306
* @return a `Parser` that -- on success -- returns a `~` (like a Pair, but easier to pattern match on)
307
307
* that contains the result of `p` and that of `q`.
308
308
* The resulting parser fails if either `p` or `q` fails, this failure is fatal.
@@ -332,7 +332,7 @@ trait Parsers {
332
332
* @paramq0 a parser that accepts if p consumes less characters. -- evaluated at most once, and only when necessary
333
333
* @return a `Parser` that returns the result of the parser consuming the most characters (out of `p` and `q`).
334
334
*/
335
-
@migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
335
+
@migration("The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
* @paramv The new result for the parser, evaluated at most once (if `p` succeeds), not evaluated at all if `p` fails.
368
368
* @return a parser that has the same behaviour as the current parser, but whose successful result is `v`
369
369
*/
370
-
@migration(2, 9, "As of 2.9, the call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
370
+
@migration("The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
* @return A parser that returns a list of results produced by first applying `f` and then
707
707
* repeatedly `p` to the input (it only succeeds if `f` matches).
708
708
*/
709
-
@migration(2, 9, "As of 2.9, the p0 call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.")
709
+
@migration("The `p0` call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.", "2.9.0")
710
710
defrep1[T](first: =>Parser[T], p0: =>Parser[T]):Parser[List[T]] =Parser { in =>
711
711
lazyvalp= p0 // lazy argument
712
712
valelems=newListBuffer[T]
@@ -733,9 +733,9 @@ trait Parsers {
733
733
* `repN(n, p)` uses `p` exactly `n` time to parse the input
734
734
* (the result is a `List` of the `n` consecutive results of `p`).
735
735
*
736
-
* @paramp a `Parser` that is to be applied successively to the input
737
-
* @paramn the exact number of times `p` must succeed
738
-
* @return A parser that returns a list of results produced by repeatedly applying `p` to the input
736
+
* @parampa `Parser` that is to be applied successively to the input
737
+
* @paramnum the exact number of times `p` must succeed
738
+
* @returnA parser that returns a list of results produced by repeatedly applying `p` to the input
739
739
* (and that only succeeds if `p` matches exactly `n` times).
0 commit comments