character

object character

This module contains many parsers to do with reading one or more characters. Almost every parser will need something from this module.

This module contains many parsers to do with reading one or more characters. Almost every parser will need something from this module.

Since

2.2.0

class Object
trait Matchable
class Any

Value members

Concrete methods

def char(c: Char): Parsley[Char]

Reads a character from the input stream and returns it, else fails if the character is not found at the head of the stream.

Reads a character from the input stream and returns it, else fails if the character is not found at the head of the stream.

Value Params
c

The character to search for

Returns

c if it can be found at the head of the input

def isHexDigit(c: Char): Boolean

Helper function, equivalent to the predicate used by hexDigit. Useful for providing to LanguageDef

Helper function, equivalent to the predicate used by hexDigit. Useful for providing to LanguageDef

def isOctDigit(c: Char): Boolean

Helper function, equivalent to the predicate used by octDigit. Useful for providing to LanguageDef

Helper function, equivalent to the predicate used by octDigit. Useful for providing to LanguageDef

def isSpace(c: Char): Boolean

Helper function, equivalent to the predicate used by space. Useful for providing to LanguageDef

Helper function, equivalent to the predicate used by space. Useful for providing to LanguageDef

def isWhitespace(c: Char): Boolean

Helper function, equivalent to the predicate used by whitespace. Useful for providing to LanguageDef

Helper function, equivalent to the predicate used by whitespace. Useful for providing to LanguageDef

def noneOf(cs: Set[Char]): Parsley[Char]

As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied set of characters cs. Returns the parsed character.

As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied set of characters cs. Returns the parsed character.

def noneOf(cs: Char*): Parsley[Char]

As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied sequence of characters cs. Returns the parsed character.

As the dual of oneOf, noneOf(cs) succeeds if the current character is not in the supplied sequence of characters cs. Returns the parsed character.

def oneOf(cs: Set[Char]): Parsley[Char]

oneOf(cs) succeeds if the current character is in the supplied set of characters cs. Returns the parsed character. See also satisfy.

oneOf(cs) succeeds if the current character is in the supplied set of characters cs. Returns the parsed character. See also satisfy.

def oneOf(cs: Char*): Parsley[Char]

oneOf(cs) succeeds if the current character is in the supplied sequence of characters cs. Returns the parsed character. See also satisfy.

oneOf(cs) succeeds if the current character is in the supplied sequence of characters cs. Returns the parsed character. See also satisfy.

def satisfy(f: Char => Boolean): Parsley[Char]

Reads a character from the head of the input stream if and only if it satisfies the given predicate. Else it fails without consuming the character.

Reads a character from the head of the input stream if and only if it satisfies the given predicate. Else it fails without consuming the character.

Value Params
f

The function to test the character on

Returns

c if f(c) is true.

def string(s: String): Parsley[String]

Reads a string from the input stream and returns it, else fails if the string is not found at the head of the stream.

Reads a string from the input stream and returns it, else fails if the string is not found at the head of the stream.

Value Params
s

The string to match against

Returns

s if it can be found at the head of the input

Concrete fields

val alphaNum: Parsley[Char]

Parses a letter or digit. Returns the parsed character.

Parses a letter or digit. Returns the parsed character.

val anyChar: Parsley[Char]

The parser anyChar accepts any kind of character. Returns the accepted character.

The parser anyChar accepts any kind of character. Returns the accepted character.

val crlf: Parsley[Char]

Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.

Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.

val digit: Parsley[Char]

Parses a digit. Returns the parsed character.

Parses a digit. Returns the parsed character.

val endOfLine: Parsley[Char]

Parses a CRLF or LF end-of-line. Returns a newline character ('\n').

Parses a CRLF or LF end-of-line. Returns a newline character ('\n').

val hexDigit: Parsley[Char]

Parses a hexadecimal digit. Returns the parsed character.

Parses a hexadecimal digit. Returns the parsed character.

val letter: Parsley[Char]

Parses a letter. Returns the parsed character.

Parses a letter. Returns the parsed character.

val lower: Parsley[Char]

Parses a lower case letter. Returns the parsed character.

Parses a lower case letter. Returns the parsed character.

val newline: Parsley[Char]

Parses a newline character ('\n'). Returns a newline character.

Parses a newline character ('\n'). Returns a newline character.

val octDigit: Parsley[Char]

Parses an octal digit. Returns the parsed character.

Parses an octal digit. Returns the parsed character.

val space: Parsley[Char]

Parses a whitespace character (either ' ' or '\t'). Returns the parsed character.

Parses a whitespace character (either ' ' or '\t'). Returns the parsed character.

val spaces: Parsley[Unit]

Skips zero or more whitespace characters. See also skipMany. Uses space.

Skips zero or more whitespace characters. See also skipMany. Uses space.

val tab: Parsley[Char]

Parses a tab character ('\t'). Returns a tab character.

Parses a tab character ('\t'). Returns a tab character.

val upper: Parsley[Char]

Parses an upper case letter. Returns the parsed character.

Parses an upper case letter. Returns the parsed character.

val whitespace: Parsley[Char]

Parses a whitespace character (' ', '\t', '\n', '\r', '\f', '\v'). Returns the parsed character.

Parses a whitespace character (' ', '\t', '\n', '\r', '\f', '\v'). Returns the parsed character.

val whitespaces: Parsley[Unit]

Skips zero or more whitespace characters. See also skipMany. Uses whitespace.

Skips zero or more whitespace characters. See also skipMany. Uses whitespace.