-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple example no longer runs on scala 3.5.1 #320
Comments
This can be manually worked around by replacing |
also applies to 3.6. Tho the error message is now The change I applied is:
which is easier than creating the lambda explicitly. Also: TIL about |
Ow man I was so frustrated to make it work. Thx for this. I can confirm that examples do not work on Scala 3.6.3. But what is the solution I have to write using all the time? Will there be a fix for this? |
Ok I have kinda create a wrapper function so I don't need to write those using keywords all the time. If any of you have suggestions but this worked for me: def parseAlternative[T](input: ParserInputSource,
parser: P[?] ?=> P[T],
verboseFailures: Boolean = false,
startIndex: Int = 0,
instrument: Instrument = null): Parsed[T] = {
parse[T](
input,
parser = v => parser(using v),
verboseFailures,
startIndex,
instrument
)
} Example code: def parseA[$: P] = P("a")
val Parsed.Success(value, successIndex) =
parseAlternative("a", parseA) |
import fastparse._
object TestFastParse {
def parseA[$: P] = P("a")
val Parsed.Success(value, successIndex) = parse("a", parseA(_))
assert(value == (), successIndex == 1)
}
The text was updated successfully, but these errors were encountered: