Skip to content

Is the current version consistent with the intro example ? #39

@tizuck

Description

@tizuck

Hi,

I am new to parseback and this could be completly me running against a wall, but I am having trouble getting your example of the arithmetic expression grammar to work. This line here,

val result: Eval[Either[List[ParseError], List[Int]]] = expr(input)

gives me the following Error message:

Error:(28, 63) type mismatch;
found : cats.Eval[List[parseback.ParseError] / parseback.util.Catenable[Int]]
(which expands to) cats.Eval[scala.util.Either[List[parseback.ParseError],parseback.util.Catenable[Int]]]
required: cats.Eval[Either[List[parseback.ParseError],List[Int]]]
val result: Eval[Either[List[ParseError], List[Int]]] = expr(input)

However, the example executes when omitting the explicit type declaration of variable result. But it will fail to parse and throw the following error message:

Left(List(UnexpectedCharacter(Line(1 + 2,0,0),Set(\s+))))

Moreover when inserting a whitespace before the 1 in the LineStream like this " 1 + 2" the example parses correctly. Am i doing anything wrong?

And also, is there a forum for questions like this? I wasn't able to find any, so i posted it here. Please let me know.

Cheers

Besides, here is my SBT File :

version := "0.1"
scalaVersion := "2.12.7"
resolvers += "bintray-djspiewak-maven" at "https://dl.bintray.com/djspiewak/maven"
val ParsebackVersion = "0.3"
libraryDependencies += "com.codecommit" %% "parseback-core" % ParsebackVersion
libraryDependencies += "com.codecommit" %% "parseback-cats" % ParsebackVersion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions