StringParsers

parsley.token.text.StringParsers
abstract class StringParsers

This class defines a uniform interface for defining parsers for string literals, independent of whether the string is raw, multi-line, or should consume whitespace after the literal.

Attributes

Since

4.0.0

Note

implementations of this class found within Lexer may employ sharing and refine the defs in this class into val or lazy val when overriding.

Source
String.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

This parser will parse a single string literal, which may contain any number of graphic ascii characters.

This parser will parse a single string literal, which may contain any number of graphic ascii characters. It may contain escape sequences, and potentially support string gaps and zero-width characters depending on the configuration.

Attributes

Since

4.0.0

Note

the exact behaviour of this parser is decided by the implementations given in Lexer, which will depend on user-defined configuration. Please see the relevant documentation of these specific objects.

Example

scala> ascii.parse("\"μαϊντανός!\"")
val res0 = Failure(...) // Greek is not part of ascii
scala> ascii.parse("\"hello world\"")
val res1 = Success("hello world")
scala> ascii.parse("\"🙂\"")
val res2 = Failure(...) // Emoji are not part of ascii
scala> ascii.parse("\"£10\"")
val res3 = Failure(...) // £ is not part of ascii
Source
String.scala

This parser will parse a single string literal, which may contain any number of graphical UTF-16 unicode characters; including those that span multiple 32-bit codepoints.

This parser will parse a single string literal, which may contain any number of graphical UTF-16 unicode characters; including those that span multiple 32-bit codepoints. It may contain escape sequences, and potentially support string gaps and zero-width characters depending on the configuration.

Attributes

Since

4.0.0

Note

the exact behaviour of this parser is decided by the implementations given in Lexer, which will depend on user-defined configuration. Please see the relevant documentation of these specific objects.

Example

scala> fullUtf16.parse("\"μαϊντανός!\"")
val res0 = Success("μαϊντανός!")
scala> fullUtf16.parse("\"hello world\"")
val res1 = Success("hello world")
scala> fullUtf16.parse("\"🙂\"")
val res2 = Success("🙂")
scala> fullUtf16.parse("\"£10\"")
val res3 = Success("£10")
Source
String.scala

This parser will parse a single string literal, which may contain any number of graphic extended ascii characters (known as latin1).

This parser will parse a single string literal, which may contain any number of graphic extended ascii characters (known as latin1). It may contain escape sequences, and potentially support string gaps and zero-width characters depending on the configuration.

Attributes

Since

4.0.0

Note

the exact behaviour of this parser is decided by the implementations given in Lexer, which will depend on user-defined configuration. Please see the relevant documentation of these specific objects.

Example

scala> latin1.parse("\"μαϊντανός!\"")
val res0 = Failure(...) // Greek is not part of latin1
scala> latin1.parse("\"hello world\"")
val res1 = Success("hello world")
scala> latin1.parse("\"🙂\"")
val res2 = Failure(...) // Emoji are not part of latin1
scala> latin1.parse("\"£10\"")
val res3 = Success("£10")
Source
String.scala