class ParserFirstOpt[In] extends Stateless[In, Option[In]]
- Source
- ParserFirstOpt.scala
- Grouped
- Alphabetic
- By Inheritance
- ParserFirstOpt
- Stateless
- Handler
- Parser
- AnyRef
- Any
- by ParserFollowedByOps
- by InvariantOps
- by ParserFollowedByOps
- by InvariantOps
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ParserFirstOpt()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toany2stringadd[ParserFirstOpt[In]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (ParserFirstOpt[In], B)
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toArrowAssoc[ParserFirstOpt[In]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asTopLevelHandler(caller: SpacTraceElement): Handler[In, Option[In]]
Wraps this handler as a "top level" handler, which will inject a SpacTraceElement (representing the current input or the "EOF" signal) to any exception is thrown by this handler when calling its
step
orfinish
methods.Wraps this handler as a "top level" handler, which will inject a SpacTraceElement (representing the current input or the "EOF" signal) to any exception is thrown by this handler when calling its
step
orfinish
methods.Used internally by
Parser
'sparse
methods.- Definition Classes
- Handler
- def asTransformer: Transformer[In, Option[In]]
Represent this parser as a
Transformer
which emits this parser's resultRepresent this parser as a
Transformer
which emits this parser's result- Definition Classes
- Parser
- def attempt: Parser[In, Either[Throwable, Option[In]]]
Like
wrapSafe
, but represents exceptions asLeft
and successful results asRight
Like
wrapSafe
, but represents exceptions asLeft
and successful results asRight
- Definition Classes
- Parser
- def beforeContext[I2 <: In, StackElem](matcher: ContextMatcher[StackElem, Any])(implicit stackable: StackLike[I2, StackElem], pos: CallerPos): Parser[I2, Option[In]]
Specialization of
interruptedBy
for stack-like input types, such that an interruption will occur upon entering a stack context that can be matched by the givenmatcher
.Specialization of
interruptedBy
for stack-like input types, such that an interruption will occur upon entering a stack context that can be matched by the givenmatcher
.Example:
val preludeContext = * \ "prelude" val dataContext = * \ "data" for { prelude <- Splitter(preludeContext).firstOption[Prelude].beforeContext(dataContext).followedByStream data <- Splitter(dataContext).as[Data] } yield data
- I2
Subtype of
In
, or justIn
(to satisfy contravariance of Parser'sIn
type)- StackElem
Specialization of the
In
type for when it represents a stack push or pop- matcher
A matching function that operates on a context stack
- stackable
Interprets the inputs as stack push/pop events to accumulate a context stack
- returns
A parser which will perform an early
finish()
when a matching context is encountered
- Definition Classes
- Parser
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (ParserFirstOpt[In]) => Boolean, msg: => Any): ParserFirstOpt[In]
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toEnsuring[ParserFirstOpt[In]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (ParserFirstOpt[In]) => Boolean): ParserFirstOpt[In]
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toEnsuring[ParserFirstOpt[In]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): ParserFirstOpt[In]
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toEnsuring[ParserFirstOpt[In]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): ParserFirstOpt[In]
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toEnsuring[ParserFirstOpt[In]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def expectInputs[I2 <: In](expectations: List[(String, (I2) => Boolean)]): Parser[I2, Option[In]]
Impose expectations on the sequence of inputs to be received by handlers created by this parser.
Impose expectations on the sequence of inputs to be received by handlers created by this parser. As this parser's handler receives an input, the input will be tested against the head of the expectations list. If the test returns
false
, the expectation is failed and the handler will throw an exception. If the test returnstrue
, the expectation is satisfied, and the handler will advance to the next expectation. If there are no more expectations left in the list (i.e. N inputs have satisfied the corresponding N expectations), then all expectations have been met and inputs will be treated as normal by the handler. If the handler receives an EOF before all expectations are met, it will throw an exception.- expectations
A sequence of
label -> test
expectations imposed on inputs to this parser- returns
A copy of this parser with expectations imposed on its inputs
- Definition Classes
- Parser
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def finish(): None
Signal the end of the data stream to this handler, forcing it to generate a result.
Signal the end of the data stream to this handler, forcing it to generate a result. Handlers may throw exceptions in response to this, such as a handler which wants the first event from an empty stream.
Further calls to
step
orfinish
after the first call tofinish
will result in undefined behavior. The general assumption is that a handler should be discarded after itsfinish
method is called.- returns
the final result of this parser
- Definition Classes
- ParserFirstOpt → Handler
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toStringFormat[ParserFirstOpt[In]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def interruptedBy[I2 <: In](interrupter: Parser[I2, Any]): Parser[I2, Option[In]]
Create a copy of this parser that will treat a result from the
interrupter
as an early EOF.Create a copy of this parser that will treat a result from the
interrupter
as an early EOF. This is especially useful for creatingfollowedBy
chains involving optional elements.Normally, a parser for an optional item in some context will not finish until that context ends, or until the item is encountered. So if the item is not present,
followedBy
logic won't work since thefollowUp
parser/transformer will not see any events.To make sure the leading parser can "fail fast", you can "interrupt" it, typically by creating a parser that immediately returns a result upon entering a particular context, i.e. the context in which the "following" parser will start.
Parser#beforeContext
provides a convenience for doing so.Note that if the
interrupter
throws an exception, that exception will not be caught. If your interrupter might throw, passinterrupter.wrapSafe
instead to swallow the exception.- I2
Subtype of
In
, or justIn
(to satisfy contravariance of Parser'sIn
type)- interrupter
A parser which will be run in parallel with this parser, and whose result will be treated as an early EOF for this parser, forcing an early call to
finish()
.- returns
A parser which will perform an early
finish()
call when theinterrupter
produces a result.
- Definition Classes
- Parser
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[Out2](f: (Option[In]) => Out2): Parser[In, Out2]
Create a copy of this Parser whose result is transformed by the given function
f
.Create a copy of this Parser whose result is transformed by the given function
f
.- Out2
The new parser's result type
- f
Result transformation function
- Definition Classes
- Parser
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newHandler: ParserFirstOpt.this.type
Parser's main abstract method; constructs a new Handler representing this parser's logic.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def orElse[In2 <: In, Out2 >: Option[In]](fallback: Parser[In2, Out2]): Parser[In2, Out2]
Combine this parser with the
fallback
such that failures from the underlying parsers will be ignored as long as at least one succeeds.Combine this parser with the
fallback
such that failures from the underlying parsers will be ignored as long as at least one succeeds. The result will be the result of whichever underlying parser succeeds first. If all of the underlying parsers fail, aSpacException.FallbackChainFailure
will be thrown by the returned parser's handler.- In2
Subtype of
In
, or justIn
(to satisfy Parser's contravariance on theIn
type)- Out2
Supertype of
Out
, or justOut
(to satisfy Parser's covariance on theOut
type)- fallback
another parser of the same(ish) type as this one
- returns
A new parser that will succeed if either this parser or the fallback succeed
- Definition Classes
- Parser
- def parse[S](source: S)(implicit S: Parsable[Id, S, In], pos: CallerPos): Option[In]
Interpret the given
source
as a data stream of typeIn
, using this parser to produce a result of typeOut
.Interpret the given
source
as a data stream of typeIn
, using this parser to produce a result of typeOut
. Exceptions thrown by the underlying parser logic will bubble up and be thrown by this method.- S
The source type. Will typically be a
File
or aList[In]
.- source
The source of a data stream
- S
Typeclass instance that provides the logic for feeding values from
source
into this parser- pos
Captures the caller filename and line number, used to fill in the 'spac trace' if the parser throws an exception
- Definition Classes
- Parser
- Annotations
- @throws(scala.this.throws.<init>$default$1[io.dylemma.spac.SpacException[_]])
- def rethrow[T](implicit ev: <:<[Option[In], Either[Throwable, T]]): Parser[In, T]
Like
unwrapSafe
, but rethrows exceptions fromLeft
or returns results fromRight
.Like
unwrapSafe
, but rethrows exceptions fromLeft
or returns results fromRight
. This operation is the opposite ofattempt
.- Definition Classes
- Parser
- def step(in: In): Left[Some[In], Nothing]
Advance the state of this handler by accepting a single input of type
In
.Advance the state of this handler by accepting a single input of type
In
. If doing so would cause this parser to complete, return aLeft
containing the output. Otherwise, return aRight
containing the next parser state.Handlers are assumed to be internally-mutable, so it is acceptable to simply update some internal state and then return
Right(this)
, although in some cases it will be desirable to return a separate handler entirely.- in
A single input event from a data stream
- returns
If the input would finish the parser, return a
Left
containing the result. Otherwise, return aRight
containing a Handler which represents the next parsing state. The handler in aRight
may be this handler, or a completely separate one.
- Definition Classes
- ParserFirstOpt → Handler
- def stepMany[C[_], In2 <: In](inputs: C[In2])(implicit C: Unconsable[C]): Either[(Option[In], C[In2]), Handler[In, Option[In]]]
Convenience function to call
step
on a sequence of inputs all at once.Convenience function to call
step
on a sequence of inputs all at once. If thestep
returns a result, this method will return aLeft
containing that result and the remainder of theinputs
that were not consumed. If theinputs
run out before the handler returns a result from astep
, this method will return aRight
containing the latest state of the handler. This method will not call the handler'sfinish()
.In general, you won't call this method directly. Instead, use one of the Parser trait's
parse
methods.- C
An
Unconsable
collection, i.e.List
orcats.data.Chain
- In2
Subtype of
In
, orIn
(to satisfy contravariance)- inputs
A sequence of inputs
- C
Evidence that the
inputs
has ahead/tail
split operation- returns
Either the handler's result paired with the remaining inputs, or the new handler state
- Definition Classes
- Handler
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toPipe[F[_]](implicit pos: CallerPos): Pipe[F, In, Option[In]]
Convert this parser to a FS2 "Pipe".
Convert this parser to a FS2 "Pipe". The resulting pipe will forward inputs from the upstream into this parser, emitting a single value to the downstream when this parser finishes. Since a
Parser
may abort early (e.g. withParser.first
), the pipe may not pull the entire input stream.- Definition Classes
- Parser
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unwrapSafe[T](implicit ev: <:<[Option[In], Try[T]]): Parser[In, T]
Creates a copy of this parser which unwraps the resulting
Try
, throwing an exception if the result was aFailure
.Creates a copy of this parser which unwraps the resulting
Try
, throwing an exception if the result was aFailure
. This operation is the opposite ofwrapSafe
.- Definition Classes
- Parser
- def upcast[Out2](implicit ev: <:<[Option[In], Out2]): Parser[In, Out2]
Returns this parser, with the output type widened to
Out2
, which is some supertype ofOut
.Returns this parser, with the output type widened to
Out2
, which is some supertype ofOut
. UsesasInstanceOf
rather than creating a new parser.- Definition Classes
- Parser
- 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()
- def withName(name: String): Parser[In, Option[In]]
Creates a copy of this parser, but with a different
toString
Creates a copy of this parser, but with a different
toString
- name
The new "name" (i.e.
toString
) for this parser- returns
A copy of this parser whose
toString
returns the givenname
- Definition Classes
- Parser
- def wrapSafe: Parser[In, Try[Option[In]]]
Create a copy of this Parser whose handler will catch NonFatal exceptions thrown by the underlying logic.
Create a copy of this Parser whose handler will catch NonFatal exceptions thrown by the underlying logic. Caught exceptions will be yielded as a
Failure
output. Normal results will be wrapped inSuccess
.- returns
A copy of this parser that will return a
Failure
instead of throwing exceptions
- Definition Classes
- Parser
Shadowed Implicit Value Members
- def followedBy: FollowedBy[In, Option[In], Parser]
Intermediate object for creating a sequenced parser in which the result of this parser will be used to initialize a second parser as soon as it is available.
Intermediate object for creating a sequenced parser in which the result of this parser will be used to initialize a second parser as soon as it is available.
In other words, the source (series of
In
values) will be fed into this Parser until this parser's handler returns a result of typeOut
. At that point, the second parser (as specified by using theapply
orflatMap
methods on theFollowedBy
returned by this method) will be instantiated. Any relevant "stack events" (seeStackable
) will be replayed so the second parser has the right context, and from that point on, allIn
values will be sent to the second parser. When that second parser returns a result, that result becomes the output of the combined parser created bythis.followedBy(out => makeSecondParser(out))
Examples:
val p1: Parser[A] = /* ... */ def getP2(p1Result: A): Parser[B] = /* ... */ val combined: Parser[B] = p1.followedBy(getP2) // alternative `flatMap` syntax val combined: Parser[B] = for { p1Result <- p1.followedBy p2Result <- getP2(p1Result) } yield p2Result
See Parser's
interruptedBy
, which is useful when atransformer.parseFirstOption
must befollowedBy
some other parser.- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toParserFollowedByOps[In, Option[In]] performed by method ParserFollowedByOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: ParserFollowedByOps[In, Option[In]]).followedBy
- Definition Classes
- ParserFollowedByOps
- def followedBy: FollowedBy[In, Option[In], Parser]
Intermediate object for creating a sequenced parser in which the result of this parser will be used to initialize a second parser as soon as it is available.
Intermediate object for creating a sequenced parser in which the result of this parser will be used to initialize a second parser as soon as it is available.
In other words, the source (series of
In
values) will be fed into this Parser until this parser's handler returns a result of typeOut
. At that point, the second parser (as specified by using theapply
orflatMap
methods on theFollowedBy
returned by this method) will be instantiated. Any relevant "stack events" (seeStackable
) will be replayed so the second parser has the right context, and from that point on, allIn
values will be sent to the second parser. When that second parser returns a result, that result becomes the output of the combined parser created bythis.followedBy(out => makeSecondParser(out))
Examples:
val p1: Parser[A] = /* ... */ def getP2(p1Result: A): Parser[B] = /* ... */ val combined: Parser[B] = p1.followedBy(getP2) // alternative `flatMap` syntax val combined: Parser[B] = for { p1Result <- p1.followedBy p2Result <- getP2(p1Result) } yield p2Result
See Parser's
interruptedBy
, which is useful when atransformer.parseFirstOption
must befollowedBy
some other parser.- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toParserFollowedByOps[In, Option[In]] performed by method ParserFollowedByOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: ParserFollowedByOps[In, Option[In]]).followedBy
- Definition Classes
- ParserFollowedByOps
- def followedByParser: FollowedBy[In, Option[In], Parser]
Alias for
followedBy
, for use when Cat'sApplyOps
gets in the way with its own uselessfollowedBy
method.Alias for
followedBy
, for use when Cat'sApplyOps
gets in the way with its own uselessfollowedBy
method.- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toParserFollowedByOps[In, Option[In]] performed by method ParserFollowedByOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: ParserFollowedByOps[In, Option[In]]).followedByParser
- Definition Classes
- ParserFollowedByOps
- def followedByParser: FollowedBy[In, Option[In], Parser]
Alias for
followedBy
, for use when Cat'sApplyOps
gets in the way with its own uselessfollowedBy
method.Alias for
followedBy
, for use when Cat'sApplyOps
gets in the way with its own uselessfollowedBy
method.- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toParserFollowedByOps[In, Option[In]] performed by method ParserFollowedByOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: ParserFollowedByOps[In, Option[In]]).followedByParser
- Definition Classes
- ParserFollowedByOps
- def followedByStream: FollowedBy[In, Option[In], Transformer]
Intermediate object creating a transformer that depends on this parser.
Intermediate object creating a transformer that depends on this parser. Particularly useful in cases where one or more specific "info" elements precede a stream of other elements which require that "info" to be parsed.
Examples:
val p1: Parser[In, A] = /* ... */ def getP2Stream(p1Result: A): Transformer[In, B] = /* ... */ val combined: Transformer[In, B] = p1.andThenStream(getP2Stream) // alternative `flatMap` syntax val combined: Transformer[In, B] = for { p1Result <- p1.andThenStream p2Result <- getP2Stream(p1Result) } yield p2Result
See
followedBy
for a general explanation of how the combination works.See also,
interruptedBy
, which is useful when atransformer.parseFirstOption
must befollowedBy
some other transformer.- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toParserFollowedByOps[In, Option[In]] performed by method ParserFollowedByOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: ParserFollowedByOps[In, Option[In]]).followedByStream
- Definition Classes
- ParserFollowedByOps
- def followedByStream: FollowedBy[In, Option[In], Transformer]
Intermediate object creating a transformer that depends on this parser.
Intermediate object creating a transformer that depends on this parser. Particularly useful in cases where one or more specific "info" elements precede a stream of other elements which require that "info" to be parsed.
Examples:
val p1: Parser[In, A] = /* ... */ def getP2Stream(p1Result: A): Transformer[In, B] = /* ... */ val combined: Transformer[In, B] = p1.andThenStream(getP2Stream) // alternative `flatMap` syntax val combined: Transformer[In, B] = for { p1Result <- p1.andThenStream p2Result <- getP2Stream(p1Result) } yield p2Result
See
followedBy
for a general explanation of how the combination works.See also,
interruptedBy
, which is useful when atransformer.parseFirstOption
must befollowedBy
some other transformer.- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toParserFollowedByOps[In, Option[In]] performed by method ParserFollowedByOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: ParserFollowedByOps[In, Option[In]]).followedByStream
- Definition Classes
- ParserFollowedByOps
- def parseF[F[_], S](source: S)(implicit S: Parsable[F, S, In], pos: CallerPos): F[Option[In]]
Interpret the given
source
as a data stream of typeIn
, using this parser to produce a result of typeOut
.Interpret the given
source
as a data stream of typeIn
, using this parser to produce a result of typeOut
. In this version of theparse
method, the data-pull and handler logic is run in theF
context. Exceptions thrown by the underlying parser logic will be raised in the F context instead of thrown.- F
An effect type in which the data-pull and handler logic will be run
- S
The source type. Will typically be a
File
or aList[In]
.- source
The source of a data stream
- S
Typeclass instance that provides the logic for feeding values from
source
into this parser- pos
Captures the caller filename and line number, used to fill in the 'spac trace' if the parser throws an exception
- returns
An effect which, when evaluated, will consume data events from the
source
using this parser to produce a result. Note that if theF
type isn't "lazy", the actual evaluation of the stream may happen as part of the *construction* of theF[Out]
, rather than during the *evaluation*.
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toInvariantOps[In, Option[In]] performed by method InvariantOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: InvariantOps[In, Option[In]]).parseF(source)(S, pos)
- Definition Classes
- InvariantOps
- def parseF[F[_], S](source: S)(implicit S: Parsable[F, S, In], pos: CallerPos): F[Option[In]]
Interpret the given
source
as a data stream of typeIn
, using this parser to produce a result of typeOut
.Interpret the given
source
as a data stream of typeIn
, using this parser to produce a result of typeOut
. In this version of theparse
method, the data-pull and handler logic is run in theF
context. Exceptions thrown by the underlying parser logic will be raised in the F context instead of thrown.- F
An effect type in which the data-pull and handler logic will be run
- S
The source type. Will typically be a
File
or aList[In]
.- source
The source of a data stream
- S
Typeclass instance that provides the logic for feeding values from
source
into this parser- pos
Captures the caller filename and line number, used to fill in the 'spac trace' if the parser throws an exception
- returns
An effect which, when evaluated, will consume data events from the
source
using this parser to produce a result. Note that if theF
type isn't "lazy", the actual evaluation of the stream may happen as part of the *construction* of theF[Out]
, rather than during the *evaluation*.
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toInvariantOps[In, Option[In]] performed by method InvariantOps in io.dylemma.spac.Parser.
- Shadowing
- This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
To access this member you can use a type ascription:(parserFirstOpt: InvariantOps[In, Option[In]]).parseF(source)(S, pos)
- Definition Classes
- InvariantOps
Deprecated Value Members
- def →[B](y: B): (ParserFirstOpt[In], B)
- Implicit
- This member is added by an implicit conversion from ParserFirstOpt[In] toArrowAssoc[ParserFirstOpt[In]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.