@@ -20,26 +20,26 @@ trait CompletionExpansionSupport extends RegexCompletionSupport {
20
20
* @tparam T the parser type
21
21
* @return a parser adapter performing completion expansion
22
22
*/
23
- def allExpandedCompletions [T ](p : Parser [T ], onlyAtInputEnd : Boolean = true ): Parser [T ] = expandedCompletions (p, p, onlyAtInputEnd)
23
+ def expandedCompletions [T ](p : Parser [T ], onlyAtInputEnd : Boolean = true ): Parser [T ] = expandedCompletionsWithLimiter (p, p, onlyAtInputEnd)
24
24
25
25
/**
26
26
* Adapts a parser so that completing it will construct the list of all possible alternatives up to the point
27
- * where the passed `stop ` parser successfully parses the expansions.
27
+ * where the passed `limiter ` parser successfully parses the expansions.
28
28
* (note that if this is used within the context of a grammar allowing for infinitely growing expressions,
29
- * selecting the relevant stop parser is critical to avoid infinite recursion)
29
+ * selecting the relevant limiter parser is critical to avoid infinite recursion)
30
30
* @param p the parser
31
31
* @param onlyAtInputEnd expansion happens only when input is positioned exactly at the end upon completion
32
- * @param stop the parser signalling the end of exploration upon successful parse
32
+ * @param limiter the parser signalling the end of exploration upon successful parse
33
33
* @tparam T the parser type
34
- * @return a parser adapter performing completion expansion limited according to `stop ` parser
34
+ * @return a parser adapter performing completion expansion limited according to `limiter ` parser
35
35
*/
36
- def expandedCompletions [T ](p : Parser [T ], stop : Parser [Any ], onlyAtInputEnd : Boolean = true ): Parser [T ] =
36
+ def expandedCompletionsWithLimiter [T ](p : Parser [T ], limiter : Parser [Any ], onlyAtInputEnd : Boolean = true ): Parser [T ] =
37
37
Parser (
38
38
p,
39
39
in => {
40
40
lazy val isAtInputEnd = dropAnyWhiteSpace(in).atEnd
41
41
if (! onlyAtInputEnd || isAtInputEnd) {
42
- val Completions (_, sets) = exploreCompletions(p, stop , in)
42
+ val Completions (_, sets) = exploreCompletions(p, limiter , in)
43
43
Completions (OffsetPosition (in.source, handleWhiteSpace(in)), sets)
44
44
} else
45
45
p.completions(in)
0 commit comments