score:1

Accepted answer

here i assume, that the text you parse always contains exactly two say nodes and that you don't want to check that the line --make_123-- is valid (i.e., has the same id as the first line).

you don't have to omit the empty line manually. it gets skipped automatically, because it's whitespace.

you are using parseall, that means that your parser should match the whole text sent to it. so you have to add to your grammar the code to parse the second say line and the closing line --make_123--.

that's simple to do with the parser functions you have already defined, and with a slight modification to the function producing mapcontent from the parsed result.

the parserequest function should be changed to have the following definition:

  def parserequest: parser[mapcontent] = 
    parsemakeid ~ parsetext ~ parsetext <~ parsemakeid ^^ {
      case makeid ~ firstnode ~ secondnode =>
        mapcontent(
          map("makeid" -> makeid,
              "firstnode" -> firstnode,
              "secondnode" -> secondnode))
  }

Related Query

More Query from same tag