parsley.token.errors

This package contains the relevant functionality for configuring the error messages generated by the parsers provided by the Lexer class.

Attributes

Members list

Concise view

Labelling and Explain Configuration

These classes can be used to configure both labels and/or explains for simple description configurations.

This type can be used to configure errors that make reasons.

This type can be used to configure errors that make reasons.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NotConfigured.type
object Hidden extends LabelConfig

This object configures labels by stating that it must be hidden.

This object configures labels by stating that it must be hidden.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Hidden.type
object Label

This object has a factory for configurations producing labels: if the empty string is provided, this equivalent to Hidden.

This object has a factory for configurations producing labels: if the empty string is provided, this equivalent to Hidden.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Label.type

This object has a factory for configurations producing labels and reasons: if the empty label is provided, this equivalent to Hidden with no reason; if the empty reason is provided this is equivalent to Label.

This object has a factory for configurations producing labels and reasons: if the empty label is provided, this equivalent to Hidden with no reason; if the empty reason is provided this is equivalent to Label.

Attributes

Since:

4.1.0

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

This type can be used to configure errors that make labels.

This type can be used to configure errors that make labels.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Hidden.type
object NotConfigured.type

This type can be used to configure both errors that make labels and those that make reasons.

This type can be used to configure both errors that make labels and those that make reasons.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NotConfigured.type
object Hidden.type

This object specifies that no special labels or reasons should be generated, and default errors should be used instead.

This object specifies that no special labels or reasons should be generated, and default errors should be used instead.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
object Reason

This object has a factory for configurations producing reasons: if the empty string is provided, this equivalent to NotConfigured.

This object has a factory for configurations producing reasons: if the empty string is provided, this equivalent to NotConfigured.

Attributes

Since:

4.1.0

Source:
ConfigImplUntyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Reason.type

Error Configuration

This is the main class that defines the configuration for errors from the Lexer.

This class is used to specify how errors should be produced by the Lexer class.

This class is used to specify how errors should be produced by the Lexer class.

The Lexer is set up to produce a variety of different errors via label-ing, explain-ing, and filter-ing, and some applications of the Verified and Preventative error patterns. The exact content of those errors can be configured here. Errors can be suppressed or specified with different levels of detail, or even switching between vanilla or specialised errors.

This class should be used by extending it and overriding the relevant parts: all methods here are non-abstract and their default is documented inside. Not configuring something does not mean it will not appear in the message, but will mean it uses the underlying base errors.

Attributes

Since:

4.1.0

Source:
ErrorConfig.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Filtering Configuration

These classes can be used to describe how to generate the filters to rule out specific parses. They can used to either generate types of vanilla error or specialised errors.

final class BasicFilter[A] extends SpecialisedFilterConfig[A] with VanillaFilterConfig[A]

This class can be used to not specify an error configuration for the filter, a regular filter is used instead.

This class can be used to not specify an error configuration for the filter, a regular filter is used instead.

Attributes

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
abstract class Because[A](fullAmend: Boolean) extends VanillaFilterConfig[A]

This class ensures that the filter will generate a vanilla reason for the given failing parse.

This class ensures that the filter will generate a vanilla reason for the given failing parse.

Attributes

fullAmend

filters usually have partial amend semantics: should this instead do a full amend?

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
Self type
trait FilterConfig[A]

This trait, and its subclasses, can be used to configure how filters should be used within the Lexer.

This trait, and its subclasses, can be used to configure how filters should be used within the Lexer.

Attributes

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

This subtrait of FilterConfig specifies that only filters generating specialised errors may be used.

This subtrait of FilterConfig specifies that only filters generating specialised errors may be used.

Attributes

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
Known subtypes
abstract class SpecialisedMessage[A](fullAmend: Boolean) extends SpecialisedFilterConfig[A]

This class ensures that the filter will generate specialised messages for the given failing parse.

This class ensures that the filter will generate specialised messages for the given failing parse.

Attributes

fullAmend

filters usually have partial amend semantics: should this instead do a full amend?

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
Self type
abstract class Unexpected[A](fullAmend: Boolean) extends VanillaFilterConfig[A]

This class ensures that the filter will generate a vanilla unexpected item for the given failing parse.

This class ensures that the filter will generate a vanilla unexpected item for the given failing parse.

Attributes

fullAmend

filters usually have partial amend semantics: should this instead do a full amend?

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
Self type
abstract class UnexpectedBecause[A](fullAmend: Boolean) extends VanillaFilterConfig[A]

This class ensures that the filter will generate a vanilla unexpected item and a reason for the given failing parse.

This class ensures that the filter will generate a vanilla unexpected item and a reason for the given failing parse.

Attributes

fullAmend

filters usually have partial amend semantics: should this instead do a full amend?

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
Self type
trait VanillaFilterConfig[A] extends FilterConfig[A]

This subtrait of FilterConfig specifies that only filters generating vanilla errors may be used.

This subtrait of FilterConfig specifies that only filters generating vanilla errors may be used.

Attributes

Since:

4.1.0

Source:
ConfigImplTyped.scala
Graph
Supertypes
trait FilterConfig[A]
class Object
trait Matchable
class Any
Known subtypes
class BasicFilter[A]
class Because[A]
class Unexpected[A]

Verifying Bad Characters

These classes can be used to help configure the Verified Error pattern for illegal string and character literal characters, used by verifiedCharBadCharsUsedInLiteral and verifiedStringBadCharsUsedInLiteral.

This object makes "bad literal chars" generate a bunch of given messages in a specialised error.

This object makes "bad literal chars" generate a bunch of given messages in a specialised error. Requires a map from bad characters to their messages.

Attributes

Since:

4.1.0

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

This object makes "bad literal chars" generate a reason in a vanilla error.

This object makes "bad literal chars" generate a reason in a vanilla error. Requires a map from bad characters to their reasons.

Attributes

Since:

4.1.0

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

This object disables the verified error for bad characters: this may improve parsing performance slightly on the failure case.

This object disables the verified error for bad characters: this may improve parsing performance slightly on the failure case.

Attributes

Since:

4.1.0

Source:
VerifiedAndPreventativeErrors.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract class VerifiedBadChars

This class is used to configure what error should be generated when illegal characters in a string or character literal are parsable.

This class is used to configure what error should be generated when illegal characters in a string or character literal are parsable.

Attributes

Since:

4.1.0

Source:
VerifiedAndPreventativeErrors.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Unverified.type

Preventing Double Dot

These classes and objects help to configure the Preventative Error pattern for bad .s, used by peventRealDoubleDroppedZero.

sealed abstract class PreventDotIsZeroConfig

This class is used to configure what error is generated when . is parsed as a real number.

This class is used to configure what error is generated when . is parsed as a real number.

Attributes

Since:

4.1.0

Source:
VerifiedAndPreventativeErrors.scala
Graph
Supertypes
class Object
trait Matchable
class Any

This object makes "dot is zero" generate a given unexpected message in a vanilla error.

This object makes "dot is zero" generate a given unexpected message in a vanilla error.

Attributes

Since:

4.1.0

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

This object makes "dot is zero" generate a given unexpected message with a given reason in a vanilla error.

This object makes "dot is zero" generate a given unexpected message with a given reason in a vanilla error.

Attributes

Since:

4.1.0

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

This object makes "dot is zero" generate a bunch of given messages in a specialised error.

This object makes "dot is zero" generate a bunch of given messages in a specialised error.

Attributes

Since:

4.1.0

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

This object makes "dot is zero" generate a given reason in a vanilla error.

This object makes "dot is zero" generate a given reason in a vanilla error.

Attributes

Since:

4.1.0

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