Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Failing test
package org.neo4j.lab.cypher
import commands.Query
import util.parsing.combinator.JavaTokenParsers
import org.junit.Assert._
import org.junit.Test
class ParserTest {
@Test def lowerCaseWorks() {
val parser = new TestParser
val option: Option[Let] = parser.parse("let a = \"hello world\"")
if (option.isEmpty)
@Test def upperCaseWorks() {
val parser = new TestParser
val option: Option[Let] = parser.parse("LET a = \"hello world\"")
if (option.isEmpty)
case class Let(variable:String, value:String)
class TestParser extends JavaTokenParsers {
def let: Parser[Let] = "let" ~> ident ~ "=" ~ stringLiteral ^^ {
case variable ~ "=" ~ value => Let(variable, value)
def parse(statement: String): Option[Let] =
parseAll(let, statement) match {
case Success(r, q) => Option(r)
case x => println(x); None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.