Skip to content

Commit

Permalink
some last flattening of lexer and deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Jan 6, 2024
1 parent b428aad commit b623afe
Show file tree
Hide file tree
Showing 5 changed files with 260 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,16 @@ private [parsley] abstract class CollectorImpl {
lexer.space,
lexer.lexeme,
lexer.lexeme.names,
lexer.lexeme.text,
lexer.lexeme.enclosing,
lexer.lexeme.separators,
lexer.lexeme.symbol,
lexer.lexeme.numeric,
lexer.nonlexeme,
lexer.nonlexeme.names,
lexer.nonlexeme.numeric,
lexer.nonlexeme.symbol,
lexer.nonlexeme.text
)

// All of these objects inside a lexer have private sub-objects which contain parsers.
// They require special handling where those sub-objects must be exposed, and then the parsers inside will be
// extracted in a second step.
@inline protected final def unsafeLexerObjects(lexer: Lexer): List[Any] = List(
lexer.lexeme.text,
lexer.lexeme.numeric,
lexer.nonlexeme.text,
lexer.nonlexeme.numeric
)
@deprecated("This method is no longer needed, because the lexer does not nest anymore for numeric/test/enclosing/separators", "4.5.0")
@inline protected final def unsafeLexerObjects(lexer: Lexer): List[Any] = Nil
}
// $COVERAGE-ON$
2 changes: 2 additions & 0 deletions parsley/jvm-native/src/main/scala/parsley/io.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import parsley.errors.ErrorBuilder

import parsley.internal.machine.Context

// $COVERAGE-OFF$
/** This module contains utilities to have parsers interact with IO, including the very useful `parseFromFile` method (exposed by `ParseFromIO`)
* @since 3.0.0
*/
Expand Down Expand Up @@ -60,3 +61,4 @@ object io {
}
}
}
// $COVERAGE-ON$
Loading

0 comments on commit b623afe

Please sign in to comment.