package errors
- Alphabetic
- Public
- Protected
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
ErrorBuildertypeclass, 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
ErrorBuilderAPI changes.Revisions help to ensure backwards-compatibility when the
ErrorBuilderAPI changes. By mixing in aRevisionto 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 toRevision0again.- Since
3.0.0
This is the documentation for Parsley.
Package structure
The parsley package contains the
Parsleyclass, as well as theResult,Success, andFailuretypes. 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.Parsleycontains the bulk of the core "function-style" combinators, as well as the implicit classes which enable the "method-style" combinators.parsley.combinatorcontains many helpful combinators that simplify some common parser patterns.parsley.charactercontains the combinators needed to read characters and strings, as well as combinators to match specific sub-sets of characters.parsley.debugcontains debugging combinators, helpful for identifying faults in parsers.parsley.iocontains extension methods to run parsers with input sourced from IO sources.parsley.exprcontains the following sub modules:parsley.expr.chaincontains combinators used in expression parsingparsley.expr.precedenceis a builder for expression parsers built on a precedence table.parsley.implicitscontains several implicits to add syntactic sugar to the combinators. These are sub-categorised into the following sub modules:parsley.implicits.charactercontains implicits to allow you to use character and string literals as parsers.parsley.implicits.combinatorcontains implicits related to combinators, such as the ability to make any parser into aParsley[Unit]automatically.parsley.implicits.liftenables postfix application of the lift combinator onto a function (or value).parsley.implicits.zippedenables 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.zippedmethod for building tuples out of several combinators.parsley.errorscontains modules to deal with error messages, their refinement and generation.parsley.errors.combinatorprovides combinators that can be used to either produce more detailed errors as well as refine existing errors.parsley.liftcontains 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.registerscontains combinators that interact with the context-sensitive functionality in the form of registers.parsley.tokencontains theLexerclass that provides a host of helpful lexing combinators when provided with the description of a language.parsley.unsafecontains unsafe (and not thread-safe) ways of speeding up the execution of a parser.