combinator
This object contains the combinators for attaching debuggers to parsers.
Attributes
- Since
-
5.0.0
- Source
- combinator.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
combinator.type
Members list
Type members
Classlikes
Dot accessor versions of the combinators.
Dot accessor versions of the combinators.
Attributes
- Source
- combinator.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Value members
Concrete methods
Attach a debugger to be rendered via a given view.
Attach a debugger to be rendered via a given view. This view will render whenever the parser produces debug content.
You would normally obtain a parsley.debug.DebugView from its respective package as either a static object or an instance object depending on whether the renderer stores state. In the latter case, it is better to regenerate the frontend with every new debugged parser. The view can be reusable (i.e. inherits from parsley.debug.DebugView.Reusable) or single-use (i.e. inherits from parsley.debug.DebugView.SingleUse).
The instrumented parser will automatically call the view to render the debug tree, so it may be recommended that you only use this with smaller parsers as large parsers may cause large amounts of memory to be used for rendering the tree.
Type parameters
- A
-
Output type of parser.
Value parameters
- parser
-
The parser to debug.
- toStringRules
-
If a parser's result matches any of the predicates in this sequence, it will get turned into a string before storing in the debug tree. This is usually for memory-usage optimisation. By default, all function-like objects will be converted into strings, as closures are expensive to store.
- view
-
The debug view instance to render with.
Attributes
- Returns
-
A modified parser which will ask the view to render the produced debug tree after a call to Parsley.parse is made.
- Note
-
Do not run a parser through this combinator multiple times.
- Source
- combinator.scala
Attach a debugger to be rendered via a given view.
Attach a debugger to be rendered via a given view. This view will render whenever the parser produces debug content.
This assumes the default rules of converting only lambdas and closures into strings when storing in the output debug tree.
Type parameters
- A
-
Output type of parser.
Value parameters
- parser
-
The parser to debug.
- view
-
The debug view instance to render with.
Attributes
- Returns
-
A modified parser which will ask the view to render the produced debug tree after a call to Parsley.parse is made.
- See also
-
The other overload of this method (attachDebugger) has more information on its usage.
- Note
-
Do not run a parser through this combinator multiple times.
- Source
- combinator.scala
Create a closure that freshly attaches a debugger and a tree-rendering view to a parser every time it is called.
Create a closure that freshly attaches a debugger and a tree-rendering view to a parser every time it is called.
Attributes
- Returns
-
Generator closure for view-debugged versions of the input parser.
- Note
-
Do not run a parser through this combinator multiple times.
- Source
- combinator.scala
Create a closure that freshly attaches a debugger and a tree-rendering view to a parser every time it is called.
Create a closure that freshly attaches a debugger and a tree-rendering view to a parser every time it is called.
This assumes the default rules of converting only lambdas and closures into strings when storing in the output debug tree.
Attributes
- Returns
-
Generator closure for view-debugged versions of the input parser.
- See also
-
The other overload of this method (attachDebugger) has more information on its usage.
- Note
-
Do not run a parser through this combinator multiple times.
- Source
- combinator.scala
Attributes
- Source
- combinator.scala
Attach a name to a parser, for display within the debugger output.
Attach a name to a parser, for display within the debugger output. Names assigned here have a higher precedence than names collected with parsley.debug.util.Collector.
Renaming the same parser multiple times simply overwrites its name to the most latest rename.
Attributes
- Source
- combinator.scala
Concrete fields
Returns true for any function type, which we ideally don't store as a string
Returns true for any function type, which we ideally don't store as a string
Attributes
- Source
- combinator.scala
Implicits
Implicits
Dot accessor versions of the combinators.