← ZIO Parser docs

Syntax

zio.parser.Syntax
See theSyntax companion class

Attributes

Companion
class
Source
Syntax.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Syntax.type

Members list

Value members

Concrete methods

def any[T]: Syntax[Nothing, T, T, T]

Syntax that reads or writes one element without modification

Syntax that reads or writes one element without modification

Attributes

Source
Syntax.scala
def char(value: Char): Syntax[String, Char, Char, Unit]

Parse or print a specific character 'value' and result in unit

Parse or print a specific character 'value' and result in unit

Attributes

Source
Syntax.scala
def char[Err](value: Char, failure: Err): Syntax[Err, Char, Char, Unit]

Parse or print a specific character 'value' or fail with 'failure', result in unit

Parse or print a specific character 'value' or fail with 'failure', result in unit

Attributes

Source
Syntax.scala
def charIn(chars: Char*): Syntax[String, Char, Char, Char]

Syntax that parses/prints a single character that matches one of 'chars'

Syntax that parses/prints a single character that matches one of 'chars'

Attributes

Source
Syntax.scala
def charIn(chars: String): Syntax[String, Char, Char, Char]

Syntax that parses/prints a single character that matches one of the characters in 'chars'

Syntax that parses/prints a single character that matches one of the characters in 'chars'

Attributes

Source
Syntax.scala
def charNotIn(chars: Char*): Syntax[String, Char, Char, Char]

Syntax that parses/prints a single character that does not match any of 'chars'

Syntax that parses/prints a single character that does not match any of 'chars'

Attributes

Source
Syntax.scala

Syntax that parses/prints a single character that does not match any of the characters in 'chars'

Syntax that parses/prints a single character that does not match any of the characters in 'chars'

Attributes

Source
Syntax.scala
def fail[Err](failure: Err): Syntax[Err, Any, Nothing, Nothing]

Syntax that does not pares or print anything but fails with 'failure'

Syntax that does not pares or print anything but fails with 'failure'

Attributes

Source
Syntax.scala
def filterChar[Err](filter: Char => Boolean, failure: Err): Syntax[Err, Char, Char, Char]

Syntax that parses/prints a single character that matches the given predicate, or fails with 'failure'

Syntax that parses/prints a single character that matches the given predicate, or fails with 'failure'

Attributes

Source
Syntax.scala
def notChar(value: Char): Syntax[String, Char, Char, Char]

Parse or print a single character and fail if it is 'value'

Parse or print a single character and fail if it is 'value'

Attributes

Source
Syntax.scala
def notChar[Err](value: Char, failure: Err): Syntax[Err, Char, Char, Char]

Parse or print a single character and fail with 'failure' if it is 'value'

Parse or print a single character and fail with 'failure' if it is 'value'

Attributes

Source
Syntax.scala
def regex[Err](regex: Regex, failure: Err): Syntax[Err, Char, Char, Chunk[Char]]

Syntax that executes a regular expression on the input and results in the chunk of the parsed characters, or fails with 'failure'.

Syntax that executes a regular expression on the input and results in the chunk of the parsed characters, or fails with 'failure'.

Attributes

Source
Syntax.scala
def regexChar[Err](regex: Regex, failure: Err): Syntax[Err, Char, Char, Char]

Syntax that during parsing executes a regular expression on the input and results in the last parsed character, or fails with 'failure'. Useful for regexes that are known to parse a single character. The printer prints the character provided as input value.

Syntax that during parsing executes a regular expression on the input and results in the last parsed character, or fails with 'failure'. Useful for regexes that are known to parse a single character. The printer prints the character provided as input value.

Attributes

Source
Syntax.scala
def regexDiscard[Err](regex: Regex, failure: Err, value: Chunk[Char]): Syntax[Err, Char, Char, Unit]

Parse with a given regular expression and discard its results. If the regex fails, fail with 'failure'. When printing, the chunk of characters in 'value' gets printed.

Parse with a given regular expression and discard its results. If the regex fails, fail with 'failure'. When printing, the chunk of characters in 'value' gets printed.

Attributes

Source
Syntax.scala
def string[Result](str: String, value: Result): Syntax[String, Char, Char, Result]

Syntax that parses/prints a specific string 'str', and results in 'value'

Syntax that parses/prints a specific string 'str', and results in 'value'

Attributes

Source
Syntax.scala
def succeed[Value](value: Value): Syntax[Nothing, Any, Nothing, Value]

Syntax that does not parse or print anything but succeeds with 'value'

Syntax that does not parse or print anything but succeeds with 'value'

Attributes

Source
Syntax.scala
def unsafeRegex[Err](regex: Regex): Syntax[Nothing, Char, Char, Chunk[Char]]

Syntax that executes a regular expression on the input and results in the chunk of the parsed characters. The regex should never fail.

Syntax that executes a regular expression on the input and results in the chunk of the parsed characters. The regex should never fail.

Attributes

Source
Syntax.scala
def unsafeRegexChar(regex: Regex): Syntax[Nothing, Char, Char, Char]

Syntax that during parsing executes a regular expression on the input and results in the last parsed character. The regex should never fail. Useful for regexes that are known to parse a single character. The printer prints the character provided as input value.

Syntax that during parsing executes a regular expression on the input and results in the last parsed character. The regex should never fail. Useful for regexes that are known to parse a single character. The printer prints the character provided as input value.

Attributes

Source
Syntax.scala
def unsafeRegexDiscard(regex: Regex, value: Chunk[Char]): Syntax[Nothing, Char, Char, Unit]

Parse with a given regular expression and discard its results. The regex should never fail. When printing, the chunk of characters in 'value' gets printed.

Parse with a given regular expression and discard its results. The regex should never fail. When printing, the chunk of characters in 'value' gets printed.

Attributes

Source
Syntax.scala

Inherited methods

inline def oneOf[A, I, O](inline syntax: Syntax[String, I, O, _ <: A], inline syntaxes: Syntax[String, I, O, _ <: A]*): Syntax[String, I, O, A]

Syntax that combines all the constructors of subclasses of a sum type

Syntax that combines all the constructors of subclasses of a sum type

Attributes

Inherited from:
SyntaxCompanionVersionSpecific
Source
SyntaxCompanionVersionSpecific.scala

Concrete fields

Syntax of a single alpha-numeric character

Syntax of a single alpha-numeric character

Attributes

Source
Syntax.scala
val anyChar: Syntax[Nothing, Char, Char, Char]

Syntax that parses/prints a single character

Syntax that parses/prints a single character

Attributes

Source
Syntax.scala
lazy val anyString: Syntax[Nothing, Char, Char, String]

Syntax that parses/prints an arbitrary long string

Syntax that parses/prints an arbitrary long string

Attributes

Source
Syntax.scala
lazy val digit: Syntax[String, Char, Char, Char]

Syntax of a single digit

Syntax of a single digit

Attributes

Source
Syntax.scala
lazy val end: Syntax[Nothing, Any, Nothing, Unit]

Syntax that in parser mode only succeeds if the input stream has been consumed fully.

Syntax that in parser mode only succeeds if the input stream has been consumed fully.

This can be used to require that a parser consumes the full input.

Attributes

Source
Syntax.scala
lazy val index: Syntax[Nothing, Any, Nothing, Int]

Syntax that in parser mode results in the current input stream position

Syntax that in parser mode results in the current input stream position

Attributes

Source
Syntax.scala
lazy val letter: Syntax[String, Char, Char, Char]

Syntax of a single letter

Syntax of a single letter

Attributes

Source
Syntax.scala
lazy val unit: Syntax[Nothing, Any, Nothing, Unit]

Syntax that results in unit

Syntax that results in unit

Attributes

Source
Syntax.scala

Syntax of a single whitespace character

Syntax of a single whitespace character

Attributes

Source
Syntax.scala