Parses an interpolated string expression into some extractor
Type parameters
- A
-
the type of the parsed result
- Expr
-
the macro-level expression type
- Type
-
the macro-level type type
Attributes
- Companion
- object
- Source
- Extractor.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Grouped members
parse
Extract subexpressions from the given value according to the given StringContext
Extract subexpressions from the given value according to the given StringContext
Attributes
- Source
- Extractor.scala
Parses a StringContext into an extractor
Parses a StringContext into an extractor
Attributes
- Example
-
def valueImpl(sc:Expr[scala.StringContext])(using Quotes):Expr[Unapply[Result]] = { val myParser:Extractor[Expr[Result]] = ??? myParser.extractor(sc) } extension (inline sc:scala.StringContext) inline def value:Unapply[Result] = ${valueImpl('sc)}
- Inherited from:
- VersionSpecificExtractor (hidden)
- Source
- VersionSpecificExtractor.scala
Result Changing Combinators
Returns an extractor which invokes this extractor after mapping the input value using contrafn
Returns an extractor which invokes this extractor after mapping the input value using contrafn
Attributes
- Source
- Extractor.scala
Returns an extractor which runs this parser but ignores the input
Returns an extractor which runs this parser but ignores the input
Approximately equivalent to this.contramap({_ => a})
, where a
is some value this extractor will accept, except this discards all match groups
Attributes
- Source
- Extractor.scala
Returns an extractor which invokes the contrafn, then
Returns an extractor which invokes the contrafn, then
- If the Expr is true, passes the value to this extractor
- If the Expr is false, fails the match
Attributes
- Source
- Extractor.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
- Extractor.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
- Extractor.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
- Extractor.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
- Extractor.scala
Error Enriching Combinators
Returns a extractor which invokes this parser, but has the given description upon failure
Returns a extractor which invokes this parser, but has the given description upon failure
Attributes
- Source
- Extractor.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
- Extractor.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
- Extractor.scala