Parses an interpolated string expression into some value
Type parameters
- A
-
the type of the parsed result
- Expr
-
the macro-level expression type.
Attributes
- Companion
- object
- Source
- Interpolator.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Grouped members
parse
Processes an immediate string context and its arguments into a value
Processes an immediate string context and its arguments into a value
Attributes
- Example
-
extension (sc:StringContext) def prefix(args:Any*):Result = val interpolator:Interpolator[Result] = ??? interpolator.interpolate(sc, args)
- Source
- Interpolator.scala
Parses a StringContext and its arguments into a value
Parses a StringContext and its arguments into a value
Attributes
- Example
-
extension (inline sc:StringContext) inline def prefix(inline args:Any*):Result = ${prefixImpl('sc, 'args)} def prefixImpl(sc:Expr[StringContext], args:Expr[Seq[Any]])(using Quotes):Expr[Result] = val interpolator:Interpolator[Expr[Result]] = ??? interpolator.interpolate(sc, args)
- Inherited from:
- VersionSpecificInterpolator (hidden)
- Source
- VersionSpecificInterpolator.scala
Result Changing Combinators
Returns a parser which invokes this parser, then modifies a successful result according to fn
Returns a parser which invokes this parser, then modifies a successful result according to fn
Attributes
- Source
- Interpolator.scala
Returns a parser which invokes this parser, then maps a successful result by lifting the successful result into an Expr
Returns a parser which invokes this parser, then maps a successful result by lifting the successful result into an Expr
Attributes
- Source
- Interpolator.scala
Returns an interpolator which invokes this parser, then maps a successful result to the Unit value
Returns an interpolator which invokes this parser, then maps a successful result to the Unit value
Approximately equivalent to this.map({_ => ()})
Attributes
- Source
- Interpolator.scala
Sequencing Combinators
Returns a parser which invokes this parser, and upon success invokes the other parser.
Returns a parser which invokes this parser, and upon success invokes the other parser.
Type parameters
- Z
-
the result parser's parsed value type
Value parameters
- ev
-
A descriptor of how to combine two values into one value
- rhs
-
the parser to call after this one
Attributes
- Source
- Interpolator.scala
Returns a parser which invokes this parser, then modifies a successful result according to the parser returned by fn
Returns a parser which invokes this parser, then modifies a successful result according to the parser returned by fn
Attributes
- Source
- Interpolator.scala
Branching Combinators
Returns a parser which invokes this parser, and then:
Returns a parser which invokes this parser, and then:
- If this parser run succeeded, return this internal's success
- If this parser failed and consumed input, return this parser's failure
- If this parser failed but did not consume input, run the other parser and return the other parser's result
Type parameters
- Z
-
the result parser's parsed value type
Value parameters
- ev
-
A descriptor of how to treat either value as one value
- rhs
-
the parser to call after this one
Attributes
- Source
- Interpolator.scala
Filtering Combinators
Returns a parser which invokes this parser, then fails a successful result if it does not pass the predicate
Returns a parser which invokes this parser, then fails a successful result if it does not pass the predicate
Attributes
- Source
- Interpolator.scala
Repeating Combinators
Returns a parser which invokes this parser and provides a value whether this parser succeeded or failed
Returns a parser which invokes this parser and provides a value whether this parser succeeded or failed
Type parameters
- Z
-
the result parser's parsed value type
Value parameters
- ev
-
A descriptor of how to mark present or absent values
- strategy
-
whether the optionally will attempt to match as much or as little as possible, and whether it will backtrack. Default is RepeatStrategy.Possessive
Attributes
- Source
- Interpolator.scala
Returns a parser which invokes this parser repeatedly and returns the aggregated result
Returns a parser which invokes this parser repeatedly and returns the aggregated result
Type parameters
- Z
-
the result parser's parsed value type
Value parameters
- delimiter
-
a parser describing separators between each repeat. Defaults to a parser that always succeeds and consumes no input.
- ev
-
A descriptor of how to combine the repeated values into one value
- max
-
the maximum number of repeats to consume
- min
-
the minimum number of repeats to be considered successful
- strategy
-
whether the repeat will attempt to match as much or as little as possible, and whether it will backtrack. Default is RepeatStrategy.Possessive
Attributes
- Source
- Interpolator.scala
Error Enriching Combinators
Returns a parser which invokes this parser, but has the given description upon failure
Returns a parser which invokes this parser, but has the given description upon failure
Attributes
- Source
- Interpolator.scala
Other Combinators
Returns a parser which invokes this parser, but treats the result of a failed parse as if it does not consume input
Returns a parser which invokes this parser, but treats the result of a failed parse as if it does not consume input
Attributes
- Source
- Interpolator.scala
Creates a parser that will
Creates a parser that will
- when interpolating, act like this parser
- when extractoring, invoke this parser and check that the extractor input is equal to the parsed value
The extractor parsing will probably fail if this parser expects to find holes.
Attributes
- Source
- Interpolator.scala
Returns a parser which invokes this parser, but does not show the expected value in failure messages
Returns a parser which invokes this parser, but does not show the expected value in failure messages
Attributes
- Source
- Interpolator.scala