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
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
- Known subtypes
- object NotConfigured.type
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
- Self type
- Hidden.type
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
- 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
- Self type
- LabelAndReason.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
- Known subtypes
- object Hidden.typeobject 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
- Known subtypes
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
- trait ExplainConfigtrait LabelConfigtrait LabelWithExplainConfigclass Objecttrait Matchableclass Any
- Self type
- NotConfigured.type
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
- 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
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.
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 VanillaFilterConfig[A]trait SpecialisedFilterConfig[A]trait FilterConfig[A]class Objecttrait Matchableclass Any
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
- Since:
4.1.0
- Source:
- ConfigImplTyped.scala
- Graph
- Supertypes
- Self type
- Because[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
- Known subtypes
- trait SpecialisedFilterConfig[A]class BasicFilter[A]class SpecialisedMessage[A]trait VanillaFilterConfig[A]class Because[A]class Unexpected[A]class UnexpectedBecause[A]
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
- Known subtypes
- class BasicFilter[A]class SpecialisedMessage[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
- Since:
4.1.0
- Source:
- ConfigImplTyped.scala
- Graph
- Supertypes
- Self type
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
- Since:
4.1.0
- Source:
- ConfigImplTyped.scala
- Graph
- Supertypes
- Self type
- Unexpected[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
- Since:
4.1.0
- Source:
- ConfigImplTyped.scala
- Graph
- Supertypes
- Self type
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
- Known subtypes
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
- Self type
- BadCharsFail.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
- Self type
- BadCharsReason.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
- Self type
- Unverified.type
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
- 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
.
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
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
- Self type
- UnexpectedZeroDot.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
- 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
- Self type
- ZeroDotFail.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
- Self type
- ZeroDotReason.type