package errors
- Alphabetic
- Public
- All
Type Members
-
class
DefaultErrorBuilder extends ErrorBuilder[String] with Revision2
This is the class used to build Parsley's default error messages.
This is the class used to build Parsley's default error messages. While it compiles with the
ErrorBuilder
typeclass, it should not be considered a stable contract: the formatting can be changed at any time and without notice. The API, however, will remain stable.- Since
3.0.0
-
trait
ErrorBuilder[Err] extends AnyRef
This typeclass specifies how an error generated by a parser should be formatted.
This typeclass specifies how an error generated by a parser should be formatted. An instance of this trait is required when calling
parse
(or similar). By default, Parsley defines its own instance forErrorBuilder[String]
found in the ErrorBuilder companion object.To implement this trait, you will need to define a number of methods as well as decide on the representation types for a variety of different components. The relation between the various methods is closely linked to the types that they both produce and consume. If you only want to change the basics of formatting without having to define the entire instance, you can inherit from
DefaultErrorBuilder
, but this will lock in your implementation types (type aliases cannot be overriden in Scala).- Err
The final result type of the error message
- Since
3.0.0
Value Members
- object ErrorBuilder
-
object
combinator
This module contains combinators that can be used to directly influence error messages of parsers.
This module contains combinators that can be used to directly influence error messages of parsers.
- Since
3.0.0
-
object
revisions
Revisions help to ensure backwards-compatibility when the
ErrorBuilder
API changes.Revisions help to ensure backwards-compatibility when the
ErrorBuilder
API changes. By mixing in aRevision
to your instances, you are advertising that you want to remain compatible with that version of the API. If the API changes with minor version increases, then the revision mixed in will implement a compatiblity layer to ensure that your code should still compile. If you want to opt into a more recent revision, you just change the mixin. A major version bump will clear the revisions back toRevision0
again.- Since
3.0.0
This is the documentation for Parsley.
Package structure
The parsley package contains the
Parsley
class, as well as theResult
,Success
, andFailure
types. In addition to these, it also contains the following packages and "modules" (a module is defined as being an object which mocks a package):parsley.Parsley
contains the bulk of the core "function-style" combinators, as well as the implicit classes which enable the "method-style" combinators.parsley.combinator
contains many helpful combinators that simplify some common parser patterns.parsley.character
contains the combinators needed to read characters and strings, as well as combinators to match specific sub-sets of characters.parsley.debug
contains debugging combinators, helpful for identifying faults in parsers.parsley.io
contains extension methods to run parsers with input sourced from IO sources.parsley.expr
contains the following sub modules:parsley.expr.chain
contains combinators used in expression parsingparsley.expr.precedence
is a builder for expression parsers built on a precedence table.parsley.implicits
contains several implicits to add syntactic sugar to the combinators. These are sub-categorised into the following sub modules:parsley.implicits.character
contains implicits to allow you to use character and string literals as parsers.parsley.implicits.combinator
contains implicits related to combinators, such as the ability to make any parser into aParsley[Unit]
automatically.parsley.implicits.lift
enables postfix application of the lift combinator onto a function (or value).parsley.implicits.zipped
enables boths a reversed form of lift where the function appears on the right and is applied on a tuple (useful when type inference has failed) as well as a.zipped
method for building tuples out of several combinators.parsley.errors
contains modules to deal with error messages, their refinement and generation.parsley.errors.combinator
provides combinators that can be used to either produce more detailed errors as well as refine existing errors.parsley.lift
contains functions which lift functions that work on regular types to those which now combine the results of parsers returning those same types. these are ubiquitous.parsley.registers
contains combinators that interact with the context-sensitive functionality in the form of registers.parsley.token
contains theLexer
class that provides a host of helpful lexing combinators when provided with the description of a language.parsley.unsafe
contains unsafe (and not thread-safe) ways of speeding up the execution of a parser.