Collector

parsley.debugger.util.Collector
object Collector

Attempt to collect all the fields in a class or object that contain a parser of type parsley.Parsley, or from a parsley.token.Lexer.

This information is used later in the debug tree-building process to rename certain parsers so that they do not end up being named things like "packageanon".

You only need to run this once per parser-holding object.

Attributes

Since

4.5.0

Source
Collector.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Collector.type

Members list

Value members

Concrete methods

def assignName(par: Parsley[_], name: String): Unit

Manually add a name for a parser by reference.

Manually add a name for a parser by reference.

Can also be used if a more informative name for a parser is wanted. In this case, use this method after using names or lexer to override the automatically collected / found name.

Attributes

Note

Names assigned using this will take precedence over names assigned using parsley.debugger.combinator.named.

Source
Collector.scala

Does the implementation of the collector for the current Scala platform actually work in automatically finding parsers in objects and getting their field names as written in your parser code?

Does the implementation of the collector for the current Scala platform actually work in automatically finding parsers in objects and getting their field names as written in your parser code?

Attributes

Note

Manually named parsers using assignName or parsley.debugger.combinator.named will still work regardless if the platform is supported or not.

Source
Collector.scala
def lexer(lexer: Lexer): Unit

Collect names of parsers from a parsley.token.Lexer.

Collect names of parsers from a parsley.token.Lexer.

Attributes

See also

names for more information regarding the warning.

Note

For Scala 3 on the JVM, this may trigger a warning about setAccessible for private members being deprecated.

Source
Collector.scala
def names(obj: Any): Unit

Collect names of parsers from an object.

Collect names of parsers from an object.

Attributes

Note

For Scala 3 on the JVM, it is advised that all parsers in objects being introspected are marked public, as otherwise, a semi-deprecated call to setAccessible will be called on a private object, which may be restricted or removed in a future version of the JVM. It may be advised to manually name one's parsers (to be debugged) using assignName or parsley.debugger.combinator.named if that warning is not desirable.

Source
Collector.scala