abstract class String extends AnyRef
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.
- Source
- String.scala
- Since
4.0.0
- Note
implementations of this class found within
Lexermay employ sharing and refine thedefs in this class intovalorlazy valwhen overriding.
- Alphabetic
- By Inheritance
- String
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def ascii: Parsley[scala.Predef.String]
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.
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
- 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: - abstract def fullUtf16: Parsley[scala.Predef.String]
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.
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")
- 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: - abstract def latin1: Parsley[scala.Predef.String]
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.
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")
- 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:
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): java.lang.String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()