Syntax

zio.parser.Syntax
See theSyntax companion class

Attributes

Companion
class
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

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

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

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

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

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

def charNotIn(chars: String): Syntax[String, Char, Char, Char]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Concrete fields

lazy val alphaNumeric: Syntax[String, Char, Char, Char]

Syntax of a single alpha-numeric character

Syntax of a single alpha-numeric character

Attributes

val anyChar: Syntax[Nothing, Char, Char, Char]

Syntax that parses/prints a single character

Syntax that parses/prints a single character

Attributes

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

lazy val digit: Syntax[String, Char, Char, Char]

Syntax of a single digit

Syntax of a single digit

Attributes

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

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

lazy val letter: Syntax[String, Char, Char, Char]

Syntax of a single letter

Syntax of a single letter

Attributes

lazy val unit: Syntax[Nothing, Any, Nothing, Unit]

Syntax that results in unit

Syntax that results in unit

Attributes

lazy val whitespace: Syntax[String, Char, Char, Char]

Syntax of a single whitespace character

Syntax of a single whitespace character

Attributes