com-lihaoyi / fastparse

Writing Fast Parsers Fast in Scala
https://com-lihaoyi.github.io/fastparse
MIT License
1.09k stars 164 forks source link

Parser doesn't generate any output #31

Closed omidb closed 9 years ago

omidb commented 9 years ago

I have this code:

import fastparse._
object playGround extends App{

  someParsing()

  def someParsing() = {
    val ID =
      P(!CharIn('0' to '9') ~ (
          CharIn('0' to '9').rep ~
          CharIn('a' to 'z').rep ~
          CharIn('A' to 'Z').rep ~
          "-".rep ~ "_".rep).rep ~ " "
      )

    ID.parse("a ")
  }
}

and when I run it in SBT, it just hangs and doesn't return anything!

lihaoyi commented 9 years ago

It's meant to hang and you're doing it wrong. I'll explain in gitter