Skip to content

Commit

Permalink
Deprecate currentToken
Browse files Browse the repository at this point in the history
  • Loading branch information
alllex committed Oct 5, 2023
1 parent 30669a6 commit 4f6501d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ internal class EagerChoiceParser<T>(

private val unknownFirstTokenParsers = parsers.filter { it.hasUnknownFirstTokens() }

@Suppress("DEPRECATION")
override suspend fun ParsingScope.parse(): T {
val currentToken = currentToken?.token ?: fail(NoMatchingToken(currentOffset))
val parsers = parsersByFirstToken[currentToken] ?: unknownFirstTokenParsers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface ParsingScope {
/**
* The token at the current offset in the input.
*/
@Deprecated("The new \"scannerless\" parsing approach does not eagerly tokenize the input. The `currentToken` is always null.")
val currentToken: TokenMatch?

/**
Expand Down

0 comments on commit 4f6501d

Please sign in to comment.