Packages

c

parsley.syntax

OperatorSugar

final class OperatorSugar[+A] extends AnyRef

This class enables "operator-style" alternative combinators on parsers.

This extension class exposes a collection of "operator-style" combinators on values that are convertible to parsers that are plain syntactic sugar for other functionality in the library; they are potentially less readable than the combinators they replace, so should be used sparingly.

Source
extension.scala
Since

4.0.0

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OperatorSugar
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *: Parsley[List[A]]

    This combinator, pronounced "star", will parse this parser zero or more times returning a list of the parsed results.

    This combinator, pronounced "star", will parse this parser zero or more times returning a list of the parsed results.

    Equivalent to many, but as a postfix operator: many(p) is the same as p.*.

    Note

    an alias for many.

    See also

    many for more details.

  4. def +: Parsley[List[A]]

    This combinator, pronounced "plus", will parse this parser one or more times returning a list of the parsed results.

    This combinator, pronounced "plus", will parse this parser one or more times returning a list of the parsed results.

    Equivalent to some, but as a postfix operator: some(p) is the same as p.+.

    Note

    an alias for some.

    See also

    some for more details.

  5. def -(q: Parsley[_]): Parsley[A]

    This combinator, pronounced "and not", first parses its argument q, and if it fails, it will parse this parser, returning its result.

    This combinator, pronounced "and not", first parses its argument q, and if it fails, it will parse this parser, returning its result.

    First q is parsed, which will never consume input regardless of failure or success. If it failed, then this parser is executed and its result is returned. If either q succeeds or this parser fails, the combinator fails.

    q

    the parser to quotient this parser by.

    returns

    a parser that only parses this parser if q cannot parse.

    Example:
    1. // a less efficient version of a keyword: it's more efficient to not have to read the entire keyword twice
      def keyword(kw: String): Parsley[Unit] = {
          string(kw).void - identifier
      }
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def ?: Parsley[Option[A]]

    This combinator, pronounced "option", will try parsing this parser wrapping its result in Some, and return None if it fails.

    This combinator, pronounced "option", will try parsing this parser wrapping its result in Some, and return None if it fails.

    Equivalent to option, but as a postfix operator: option(p) is the same as p.?.

    Note

    an alias for option.

    See also

    option for more details.

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. def unary_!: Parsley[Unit]

    This combinator, pronounced "not", will succeed when this parser fails, and vice-versa, never consuming input.

    This combinator, pronounced "not", will succeed when this parser fails, and vice-versa, never consuming input.

    Equivalent to notFollowedBy, but as a prefix operator: notFollowedBy(p) is the same as !p.

    Note

    an alias for notFollowedBy.

    See also

    notFollowedBy for more details.

  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped